mehdibgh

240 Reputation

6 Badges

7 years, 242 days

MaplePrimes Activity


These are replies submitted by mehdibgh

@acer Actually the amount of t is very small, I corrected it, but could not get the answer.

restart

EQ := Matrix(4, 1, {(1, 1) = 32.1640740637930*Tau[1]-0.172224519601111e-4*Tau[2]-0.270626540730518e-3*Tau[3]+0.1570620334e-9*P[1]+0.3715450960e-14*sin(t), (2, 1) = -0.172224519601111e-4*Tau[1]+32.1667045885952*Tau[2]+0.587369829416537e-4*Tau[3]-0.1589565489e-8*P[1]+0.1004220091e-12*sin(t), (3, 1) = -0.270626540730518e-3*Tau[1]+0.587369829416537e-4*Tau[2]+32.1816411689934*Tau[3]-0.7419658527e-8*P[1]+0.5201228088e-12*sin(t), (4, 1) = 0.1570620334e-9*Tau[1]-0.1589565489e-8*Tau[2]-0.7419658527e-8*Tau[3]+601.876235436204*P[1]})

V := Matrix(1, 4, {(1, 1) = Tau[1], (1, 2) = Tau[2], (1, 3) = Tau[3], (1, 4) = P[1]})

q := 0:

X := Matrix(4, 1, {(1, 1) = -0.1156532164e-15*sin(t), (2, 1) = -0.3121894613e-14*sin(t), (3, 1) = -0.1616209235e-13*sin(t), (4, 1) = -0.2074537757e-24*sin(t)})

t := 0.5617399480550e-5:

Xf := fsolve({seq(EQ[r, 1], r = 1 .. 4)}, {seq(V[1, r] = X[r, 1] .. q, r = 1 .. 4)});

fsolve({0.1570620334e-9*Tau[1]-0.1589565489e-8*Tau[2]-0.7419658527e-8*Tau[3]+601.876235436204*P[1], -0.270626540730518e-3*Tau[1]+0.587369829416537e-4*Tau[2]+32.1816411689934*Tau[3]-0.7419658527e-8*P[1]+0.2921737596e-17, -0.172224519601111e-4*Tau[1]+32.1667045885952*Tau[2]+0.587369829416537e-4*Tau[3]-0.1589565489e-8*P[1]+0.5641105418e-18, 32.1640740637930*Tau[1]-0.172224519601111e-4*Tau[2]-0.270626540730518e-3*Tau[3]+0.1570620334e-9*P[1]+0.2087117229e-19}, {P[1], Tau[1], Tau[2], Tau[3]}, {P[1] = -0.1165350732e-29 .. 0, Tau[1] = -0.6496703178e-21 .. 0, Tau[2] = -0.1753692918e-19 .. 0, Tau[3] = -0.9078892918e-19 .. 0})

(1)

NULL

Download SoalNewton2.mw

@acer I used {seq(V[r] = q .. X[r], r = 1 .. 4)} because I want to solve the equation within that interval only. {seq(V[1, r] = q, r = 1 .. 4)} does not define interval.
Any help to considering intervals within fsolve?

@vv results also imaginary part. why???

@Carl Love I did it manually as below (rational elements of matrix A):


 

NULL

restart

NULL

with(LinearAlgebra):

``

``

f1 := expand((a+2*b+c+5*d)^3)

a^3+6*a^2*b+3*a^2*c+15*a^2*d+12*a*b^2+12*a*b*c+60*a*b*d+3*a*c^2+30*a*c*d+75*a*d^2+8*b^3+12*b^2*c+60*b^2*d+6*b*c^2+60*b*c*d+150*b*d^2+c^3+15*c^2*d+75*c*d^2+125*d^3

(1)

f2 := expand((3*a+b+4*c+d)^3)

27*a^3+27*a^2*b+108*a^2*c+27*a^2*d+9*a*b^2+72*a*b*c+18*a*b*d+144*a*c^2+72*a*c*d+9*a*d^2+b^3+12*b^2*c+3*b^2*d+48*b*c^2+24*b*c*d+3*b*d^2+64*c^3+48*c^2*d+12*c*d^2+d^3

(2)

f3 := expand((a+b+5*c+d)^3)

a^3+3*a^2*b+15*a^2*c+3*a^2*d+3*a*b^2+30*a*b*c+6*a*b*d+75*a*c^2+30*a*c*d+3*a*d^2+b^3+15*b^2*c+3*b^2*d+75*b*c^2+30*b*c*d+3*b*d^2+125*c^3+75*c^2*d+15*c*d^2+d^3

(3)

f4 := expand((a+2*b+c+6*d)^3)

a^3+6*a^2*b+3*a^2*c+18*a^2*d+12*a*b^2+12*a*b*c+72*a*b*d+3*a*c^2+36*a*c*d+108*a*d^2+8*b^3+12*b^2*c+72*b^2*d+6*b*c^2+72*b*c*d+216*b*d^2+c^3+18*c^2*d+108*c*d^2+216*d^3

(4)

``

A := Matrix(4, 4, {(1, 1) = a^2+(6*b+3*c+15*d)*a+12*(b+(1/2)*c+(5/2)*d)^2, (1, 2) = 8*b^2+(12*c+60*d)*b+6*(c+5*d)^2, (1, 3) = c^2+15*c*d+75*d^2, (1, 4) = 125*d^2, (2, 1) = 27*a^2+(27*b+108*c+27*d)*a+9*(b+4*c+d)^2, (2, 2) = b^2+(12*c+3*d)*b+48*(c+(1/4)*d)^2, (2, 3) = 64*c^2+48*c*d+12*d^2, (2, 4) = d^2, (3, 1) = a^2+(3*b+15*c+3*d)*a+3*(b+5*c+d)^2, (3, 2) = b^2+(15*c+3*d)*b+75*(c+(1/5)*d)^2, (3, 3) = 125*c^2+75*c*d+15*d^2, (3, 4) = d^2, (4, 1) = a^2+(6*b+3*c+18*d)*a+12*(b+(1/2)*c+3*d)^2, (4, 2) = 8*b^2+(12*c+72*d)*b+6*(c+6*d)^2, (4, 3) = c^2+18*c*d+108*d^2, (4, 4) = 216*d^2})

B := Vector(4, {(1) = a, (2) = b, (3) = c, (4) = d})

simplify(A.B)

Vector[column]([[(a+2*b+c+5*d)^3], [(3*a+b+4*c+d)^3], [(a+b+5*c+d)^3], [(a+2*b+c+6*d)^3]])

(5)

``

``


 

Download GenMatrixNL.mw

You mean there is not generally a way to find such coefficient matrices!???

 

 

@Carl Love Your method could not solve my problem yet. Let me explain my problem simply.

I want to earn the coefficient matrix (A) of the following equations:

f1 := (a+2*b+c+5*d)^3;
f2 := (3*a+b+4*c+d)^3;
f3 := (a+b+5*c+d)^3;
f4 := (a+2*b+c+6*d)^3;

The above equations can be written in the following form:

f=A(a,b,c,d)X

Which X= Transpose{a b c d}

and A is a matrix which its element are functions of a,b,c,d.

I am looking for rational A

@Carl Love When me equation has time derivatives of the variables, your method face an eeror!Download GenMatrix.mw

Error, (in Matrix) unable to compute coeff

NULL

restart

``

with(LinearAlgebra):

Var[4] := [tau[1](t)^3, tau[2](t)^3, tau[3](t)^3, tau[4](t)^3, tau[5](t)^3, p[1](t)^3]:

EqML := [0.882409156392238e-2*(diff(tau[1](t), t, t))+0.125314643975621e-4*(diff(tau[4](t), t, t))+0.489692770272499e-4*(diff(tau[3](t), t, t))-0.134665933291458e-4*(diff(tau[2](t), t, t))+2.01660096372790*10^(-7)*(diff(tau[5](t), t, t))-0.467902632940817e-5*(-0.398588153114250e-4*tau[1](t)+0.571232697467613e-4*tau[2](t)+0.238866882336809e-4*tau[3](t)+0.333476161338209e-4*tau[4](t)+0.364093457033576e-4*tau[5](t)-p[1](t))^3, 0.107868005030144e-3*(diff(tau[3](t), t, t))-0.134665933291458e-4*(diff(tau[1](t), t, t))+0.259286897618259e-4*(diff(tau[4](t), t, t))+0.880033731385823e-2*(diff(tau[2](t), t, t))+0.272194088039206e-5*(diff(tau[5](t), t, t))+0.670570063557231e-5*(-0.398588153114250e-4*tau[1](t)+0.571232697467613e-4*tau[2](t)+0.238866882336809e-4*tau[3](t)+0.333476161338209e-4*tau[4](t)+0.364093457033576e-4*tau[5](t)-p[1](t))^3, 0.107868005030144e-3*(diff(tau[2](t), t, t))+0.489692770272499e-4*(diff(tau[1](t), t, t))-0.321951237078206e-5*(diff(tau[5](t), t, t))+0.838515305892306e-2*(diff(tau[3](t), t, t))-0.102780443768450e-3*(diff(tau[4](t), t, t))+0.280405833175180e-5*(-0.398588153114250e-4*tau[1](t)+0.571232697467613e-4*tau[2](t)+0.238866882336809e-4*tau[3](t)+0.333476161338209e-4*tau[4](t)+0.364093457033576e-4*tau[5](t)-p[1](t))^3, -6.36692217653445*10^(-7)*(diff(tau[5](t), t, t))+0.880577097422410e-2*(diff(tau[4](t), t, t))+0.125314643975621e-4*(diff(tau[1](t), t, t))+0.259286897618259e-4*(diff(tau[2](t), t, t))-0.102780443768450e-3*(diff(tau[3](t), t, t))+0.391467665794924e-5*(-0.398588153114250e-4*tau[1](t)+0.571232697467613e-4*tau[2](t)+0.238866882336809e-4*tau[3](t)+0.333476161338209e-4*tau[4](t)+0.364093457033576e-4*tau[5](t)-p[1](t))^3, -6.36692217653445*10^(-7)*(diff(tau[4](t), t, t))-0.321951237078206e-5*(diff(tau[3](t), t, t))+2.01660096372790*10^(-7)*(diff(tau[1](t), t, t))+0.663290400662409e-2*(diff(tau[5](t), t, t))+0.272194088039206e-5*(diff(tau[2](t), t, t))+0.427409309211715e-5*(-0.398588153114250e-4*tau[1](t)+0.571232697467613e-4*tau[2](t)+0.238866882336809e-4*tau[3](t)+0.333476161338209e-4*tau[4](t)+0.364093457033576e-4*tau[5](t)-p[1](t))^3, -.11739000000*(-0.398588153114250e-4*tau[1](t)+0.571232697467613e-4*tau[2](t)+0.238866882336809e-4*tau[3](t)+0.333476161338209e-4*tau[4](t)+0.364093457033576e-4*tau[5](t)-p[1](t))^3]:

``

KKNL := Matrix(nops(EqML), nops(Var[4]), proc (i, j) options operator, arrow; coeff(EqML[i], Var[4][j]) end proc)

Error, (in Matrix) unable to compute coeff

 

``

``

Download GenMatrix.mw

@Carl Love Thanks, Nice method you used, but why the GererateMatrix can not do so???

@Rouben Rostamian  Thanks Rouben,  Yes since in the provided example y can be solved in terms of x, the integration can be done easily. But in my early problem y can not be solved in terms of x, so it seems the area (integral) of the projected intersection curve can not be calculated easily.

I am looking for the equation of projected curve or at least find a way to calculate the projected area (S) and center of area (C.A), as below:

 

@vv Actually I want to find the equation of the projected curve. How is it possible in Maple?

If it is not possible, what a bout curve fitting? (extract enough numbers of points then fit a curve for it). I am looking for easiest and fast way.

@mmcdara I also tryed usng this m files, although the file is read successfully, the postprocessing which occurs after intialization takes so time to be done.

Any other way???/

@tomleslie as i said the matrix sise is big, so importing it to the new worksheet takes long time.

restart;
currentdir("E:/Project/");

ImportMatrix(f);
 

I attached f here, please delete .txt extension


 
https://usaupload.com/5XgZ/f.txt

 

@Rouben Rostamian  I provided the example, you can look at it.

@dharr I attached a short information about this method which may help others to understand and use this method in such problems.

 

ShortInfo.pdf

@dharr Unfortunately, in this method Q2 is rectangular (2000*1200) not square.

1 2 3 4 5 6 7 Page 2 of 9