mehdibgh

240 Reputation

6 Badges

7 years, 267 days

MaplePrimes Activity


These are replies submitted by mehdibgh

@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

@mehdibaghaee I am adding the relevant matrices as well as worksheet as you requeste to present.

For specific problem the eigenvalues are as below:
1.5477,  2.2752,  2.9762,  3.3202 , ...

I have tried different ways in Maple to find them but unfortunately was not accurate enough and also time consuming.

The only way I could find them is by changing the variable (LV-Method) as below which gave me the nearest solutions.

Download Problem.mw

What do you suggest to find the eigenvalue and eigen vectors of this problem fast and accurately in Maple (other than LV-Method)?

Change the txt to mat in the following files. This is because I could not upload mat format.

Ks.txt

Ms.txt

@mmcdara i HOPE this problem will be solved in new versions of maple, where we can use 2D math safely.

@Kitonum Why these problem occured and how to solve it? I just typed in Maple

@dharr Many thanks to your kind answer. Nice answer!

@mmcdara Thanks. I am looking for the possiblity to plot with only one plot3d command in one line short command?

@Rouben Rostamian excuse there were notation errors in my equations which decoupled them. Here I corrected them as below:

And the example is:

Actually, I know these kinds of equations do not have symbolic solutions, I am looking for the best way to solve them by Maple numerically.

@Rouben Rostamian  Actually I want to solve the following differential equation set:

for example:

Do you know how to do this in Maple?

 

 

@Carl Love your commands give error:

plot([seq(PPP[[1,k],..]^+, k= 2..rhs(rtable_dims(PPP)[1]))], color= black);
Error, invalid power

@Kitonum Thanks, Actually I dont have function, I have many vectors, where I want to plot all in one figure. How to plot all of them in one fig with only one line of commands, as you did above for functions.

It is tedious to plot one by one and then gather them as below

with(plots); g := 2926;
P1 := plot(PPP[1, 1 .. g], PPP[2, 1 .. g], style = line, color = black);

P2 := plot(PPP[1, 1 .. g], PPP[3, 1 .. g], style = line, color = black);

P3 := plot(PPP[1, 1 .. g], PPP[4, 1 .. g], style = line, color = black);

P4 := plot(PPP[1, 1 .. g], PPP[5, 1 .. g], style = line, color = black);

P5 := plot(PPP[1, 1 .. g], PPP[6, 1 .. g], style = line, color = black);

P6 := plot(PPP[1, 1 .. g], PPP[7, 1 .. g], style = line, color = black);

P7 := plot(PPP[1, 1 .. g], PPP[8, 1 .. g], style = line, color = black);

P8 := plot(PPP[1, 1 .. g], PPP[9, 1 .. g], style = line, color = black);

P9 := plot(PPP[1, 1 .. g], PPP[10, 1 .. g], style = line, color = black);

P10 := plot(PPP[1, 1 .. g], PPP[11, 1 .. g], style = line, color = black);

P11 := plot(PPP[1, 1 .. g], PPP[12, 1 .. g], style = line, color = black);

P12 := plot(PPP[1, 1 .. g], PPP[13, 1 .. g], style = line, color = black);

P13 := plot(PPP[1, 1 .. g], PPP[14, 1 .. g], style = line, color = black);

P14 := plot(PPP[1, 1 .. g], PPP[15, 1 .. g], style = line, color = black);

P15 := plot(PPP[1, 1 .. g], PPP[16, 1 .. g], style = line, color = black);

P16 := plot(PPP[1, 1 .. g], PPP[17, 1 .. g], style = line, color = black);

P17 := plot(PPP[1, 1 .. g], PPP[18, 1 .. g], style = line, color = black);

P18 := plot(PPP[1, 1 .. g], PPP[19, 1 .. g], style = line, color = black);

P19 := plot(PPP[1, 1 .. g], PPP[20, 1 .. g], style = line, color = black);

P20 := plot(PPP[1, 1 .. g], PPP[21, 1 .. g], style = line, color = black);

P21 := plot(PPP[1, 1 .. g], PPP[22, 1 .. g], style = line, color = black);

P22 := plot(PPP[1, 1 .. g], PPP[23, 1 .. g], style = line, color = black);

P23 := plot(PPP[1, 1 .. g], PPP[24, 1 .. g], style = line, color = black);

P24 := plot(PPP[1, 1 .. g], PPP[25, 1 .. g], style = line, color = black); 

plots[display]([P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22, P23, P24]);
 

@Kitonum What about the font size and type of the numbers in the axis? how adjust them?

@tomleslie yes i am running parallel computations, and monitoring cpu and ram usage during the run, min 44% of ram and 11% of Cpu are free. but error persists. 

@acer I changed GAMMA to PI and modified my ws as below:


 

``

restart

II := 6

6

(1)

JJ := 6

6

(2)

N := 2:

``

q := max(II+1, JJ+1):

M := 5:

seq(seq(seq(seq(assign(PI[i, j, r, m], a*`#mover(mi("Π",fontstyle = "normal"),mo("&uminus0;"))`[i, j, r, m]), i = 0 .. q), j = 0 .. q), r = 1 .. N), m = 1 .. M):``

a := .2:

RrProc := proc (i, m) local K, j, Q; if i <= m then 0 else K := 1; Q := Matrix(i, 1); for j by 2 to i do Q(j) := 2*i-K; K := 4+K end do; Q := FlipDimension(Q, 1); Q(m+1) end if end proc:
NULL

`#mover(mi("&Pi;",fontstyle = "normal"),mo("&uminus0;"))` := Array(0 .. II, 0 .. JJ, 1 .. 6, 1 .. M):

f1 := RandomArray(II+1, JJ+1):

for m to M do `&Pi;m`[1, m] := f1; `&Pi;m`[2, m] := f2; `&Pi;m`[3, m] := f3; `&Pi;m`[4, m] := f4; `&Pi;m`[5, m] := f5; `&Pi;m`[6, m] := f6 end do:

for m to M do `#mover(mi("&Pi;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 1, m] := ArrayTools:-Alias(`&Pi;m`[1, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Pi;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 2, m] := ArrayTools:-Alias(`&Pi;m`[2, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Pi;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 3, m] := ArrayTools:-Alias(`&Pi;m`[3, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Pi;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 4, m] := ArrayTools:-Alias(`&Pi;m`[4, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Pi;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 5, m] := ArrayTools:-Alias(`&Pi;m`[5, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Pi;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 6, m] := ArrayTools:-Alias(`&Pi;m`[6, m], [0 .. II, 0 .. JJ]) end do:

UP1 := proc (s, PI, N, M, a, b, II, JJ) local k; i, j, r, p, m, q, n, l; if s = 1 then add(add(add(add(add(add((2/3)*Rr[i, m]*Rr[k, m]*b*add(PI[i, j, q, p]*PI[k, j, q, r]*tau[p](t)*tau[r](t), q = 1 .. N)/((2*m+1)*(2*j+1)*a), i = 0 .. II), k = 0 .. II), m = 0 .. II), j = 0 .. JJ), p = 1 .. M), r = 1 .. M) elif s = 2 then add(add(add(add(add(add((1/2)*Rr[i, m]*Rr[k, m]*b*add(PI[i, j, q, p]*PI[k, j, q, r]*tau[p](t)*tau[r](t), q = 1 .. N)/((2*m+1)*(2*j+1)*a), i = 0 .. II), k = 0 .. II), m = 0 .. II), j = 0 .. JJ), p = 1 .. M), r = 1 .. M) end if end proc:

y1 := Grid:-Seq(UP1(s, PI, N, M, a, b, II, JJ), s = 1 .. 2):

UP2 := proc (s, PI, N, M, a, b, II, JJ, Rr) local k; i, j, r, p, m, q, n, l; if s = 1 then add(add(add(add(add(add((2/3)*Rr[i, m]*Rr[k, m]*b*add(PI[i, j, q, p]*PI[k, j, q, r]*tau[p](t)*tau[r](t), q = 1 .. N)/((2*m+1)*(2*j+1)*a), i = 0 .. II), k = 0 .. II), m = 0 .. II), j = 0 .. JJ), p = 1 .. M), r = 1 .. M) elif s = 2 then add(add(add(add(add(add((1/2)*Rr[i, m]*Rr[k, m]*b*add(PI[i, j, q, p]*PI[k, j, q, r]*tau[p](t)*tau[r](t), q = 1 .. N)/((2*m+1)*(2*j+1)*a), i = 0 .. II), k = 0 .. II), m = 0 .. II), j = 0 .. JJ), p = 1 .. M), r = 1 .. M) end if end proc:

``

Grid:-Set(`index/xxx`);

y2 := Grid:-Seq(UP2(s, PI, N, M, a, b, II, JJ, Rr), s = 1 .. 2):

y1-y2

-HFloat(7.834444204490865e-9)*tau[4](t)*tau[2](t)-HFloat(7.834529469619156e-9)*tau[5](t)*tau[3](t)-HFloat(7.83451525876444e-9)*tau[3](t)*tau[1](t)-HFloat(7.83448683705501e-9)*tau[3](t)*tau[2](t)-HFloat(7.834401571926719e-9)*tau[5](t)*tau[1](t)-HFloat(7.834472626200295e-9)*tau[2](t)*tau[1](t)-HFloat(7.834529469619156e-9)*tau[4](t)*tau[3](t)-HFloat(2.8468605250964174e-9)*tau[5](t)^2-HFloat(2.846810787104914e-9)*tau[3](t)^2-HFloat(2.846810787104914e-9)*tau[4](t)^2-HFloat(2.846832103386987e-9)*tau[1](t)^2-HFloat(7.834600523892732e-9)*tau[5](t)*tau[4](t)-HFloat(7.834529469619156e-9)*tau[5](t)*tau[2](t)-HFloat(2.8468249979596294e-9)*tau[2](t)^2-HFloat(7.834472626200295e-9)*tau[4](t)*tau[1](t), -HFloat(7.32531901803668e-9)*tau[4](t)*tau[2](t)-HFloat(7.325368756028183e-9)*tau[5](t)*tau[3](t)-HFloat(7.325326123464038e-9)*tau[3](t)*tau[1](t)-HFloat(7.3253829668828985e-9)*tau[3](t)*tau[2](t)-HFloat(7.325304807181965e-9)*tau[5](t)*tau[1](t)-HFloat(7.325326123464038e-9)*tau[2](t)*tau[1](t)-HFloat(7.325361650600826e-9)*tau[4](t)*tau[3](t)-HFloat(3.5004319443032728e-9)*tau[5](t)^2-HFloat(3.5004674714400608e-9)*tau[3](t)^2-HFloat(3.5004568132990244e-9)*tau[4](t)^2-HFloat(3.500460366012703e-9)*tau[1](t)^2-HFloat(7.32529059632725e-9)*tau[5](t)*tau[4](t)-HFloat(7.3253119126093225e-9)*tau[5](t)*tau[2](t)-HFloat(3.5004532605853456e-9)*tau[2](t)^2-HFloat(7.3253829668828985e-9)*tau[4](t)*tau[1](t)

(3)

``


 

Download soal-1.mw

I created 2 UPs procs (UP1,UP2), the only difference between them is in using Rr as argument.

First of all I thick y1 is computed faster than y2. Why?

Second, why y1-y2 is not zero???

I am amazed.

@Carl Love Thanks acer, vv and Carl Love. It was great help.

1 2 3 4 5 6 7 Page 3 of 9