mehdibgh

215 Reputation

6 Badges

5 years, 165 days

MaplePrimes Activity


These are replies submitted by mehdibgh

@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.

@dharr Thanks for your response. What about the eigenvectors? As you can see I expect to have 2000*2000 eigenvector matrix since the size of X is 2000*1, but this method only returns 1200!!!

How to discern my eigenvectors???How to plot my eigenvectors???

@dharr Thanks for your knd answer. I am wondering if there are another ways to find the eigenvalues and eigenvectors of such eigenvalue problems.

It will be appreciated if somebody suggest another way.

There is also another using qr decomposition, which is also time consuming. Here I am attaching it.
 

NULL

restart

with(LinearAlgebra)

currentdir("E:/Project/Delamination")

M := ImportMatrix("Ms.mat", source = MATLAB)[2]

K := ImportMatrix("Ks.mat", source = MATLAB)[2]

m := 2000; n := 800

Mm__11 := M[1 .. m, 1 .. m]

Mm__12 := M[1 .. m, m+1 .. m+n]

Mm__21 := M[m+1 .. m+n, 1 .. m]

Mm__22 := M[m+1 .. m+n, m+1 .. m+n]

Kk__11 := K[1 .. m, 1 .. m]

Kk__12 := K[1 .. m, m+1 .. m+n]

Kk__21 := K[m+1 .. m+n, 1 .. m]

Kk__22 := K[m+1 .. m+n, m+1 .. m+n]

NULL

``

Q12, RR12 := QRDecomposition(Kk__12, fullspan):

Q2 := Q12[1 .. m, n+1 .. m]

LS := LinearAlgebra:-HermitianTranspose(Q2).Kk__11.Q2

RS := LinearAlgebra:-HermitianTranspose(Q2).M__11.Q2

VL, VR := Eigenvectors(LS, RS)

`ωω` := Re(`~`[sqrt](Vector(VL, datatype = complex)))

Omega := sort(0.7588455916e-5*`ωω`/(0.15176911835e-5))

 

 

 

 

``


 

Download Problem2.mw

1 2 3 4 5 6 7 Page 1 of 8