MaplePrimes Questions

I have written a Maple code which extracts terms in a matrix into two new matrices dependent on certain markers. I am running into problems with this particular code as it requires enormous amounts of RAM when going to large matrix sizes (32GB+); and will take 4-5 days to complete for larger matrix sizes, or simply crashes.

Each matrix element is an algebraic expression containing A and B and the markers hh and ss. The example in the attached Maple file (3 x 3 matrix) is a minimal working example and the actual expressions are much longer and the matrices much larger (5000 x 5000 or larger). I utilise the symmetry of the matrix to ease the process, and use the tril command of MTM to extract only the lower triangular matrix; as this is all that is needed for the next stage (I have yet to test how efficient this command is, but use it for now).

The two markers hh and ss are targeted and if found in an expression that term will be extracted accordingly. The matrix elements are expanded and a procedure run over the matrix and will extract terms with hh into one matrix and terms with ss into another matrix. I think the map(expand,...) part is what causes the memory issue; but I believe this needs to be done to correctly extract terms.

Any help or tips are greatly appreciated on how to increase efficiency and improve this method.
 

Sub_matrix_extraction.mw

-Yeti

 

 

aa := tan(Pi/11)^2;
bb := RootOf(_Z^5-55*_Z^4+330*_Z^3-462*_Z^2+165*_Z-11, index = 1); # bb = aa
ee := (exp(-Pi-I*Pi*aa/bb))^(1+I);

seq((proc() try timelimit(k, signum(Re(ee)-1/k)) catch: lprint(lastexception) end try end proc)(),
    k = 1..10);

`shake/shake`, "time expired"
`expand/sin`, "time expired"
`evalr/tan`, "time expired"
sdmp:-mul, "time expired"
                        1, 1, 1, 1, 1, 1

An explanation: aa/bb=1, so, as we know from here, ee=exp(-2*Pi), and ee is tricky to evaluate numerically. Normally signum(Re(ee)-1/5) just seems to hang indefinitely, which is not the worst thing it could do. But after one of the timelimit interrupts (or after clicking "Interrupt the current operation"), something breaks, and Maple starts returning wrong values.

This is in Maple 2017.2, system="X86 64 WINDOWS", wordsize=64.

Also, is there any way to clear the cached values so that this computation can be repeated without doing restart?

 

Hi, I have a system of 15 polynomial equations (of 15 variables) of 2nd degree. Meaning, every monomial has at most mulplications of 2 different variables or a single variable squared.

I tried to solve them in Maple but it's been 2 hours and Maple is still thinking.. I don't have any indication if Maple is just stuck or it should return a solution at some point.  

Below I wrote the Maple commands that I tried to run (sorry but I'm new here so I didn't know how to write them nicely). I also wrote one of the solutions that I'm expecting to get (15 values for the 15 variables). and you can see that by typing eq7 for example I got -2.5=-2.5 (and the same for the rest of the equations) which means that the values are correct.

I know there is an algorithm for solving any system of numerical polynomial equations of any degree. I don't know if Maple implemented it.

Anyone knows if Maple is able to solve the equations below? and if not, is there any other way that can be done to solve them?

Thanks

David

 

Here's the commands for Maple (including one of the solutions I'm expecting to get).

The variables are: r11, r12, r13, r21, r22, r23, r31, r32, r33, t1, t2, t3, s1, s2, s3

eq1:=r11^2+r21^2+r31^2 = 1;
eq2:=r12^2+r22^2+r32^2 = 1;
eq3:=r13^2+r23^2+r33^2 = 1;
eq4:=r11*r12+r21*r22+r31*r32 = 0;
eq5:=r11*r13+r21*r23+r31*r33 = 0;
eq6:=r12*r13+r22*r23+r32*r33 = 0;
eq7:=-30*r13-.79382581863774e-1*s1*r11-.95259098236529e-1*s1*r12+.992282273297173*s1*r13 = -.83717247687439e-1*t1;
eq8:=-30*r13+.79382581863774e-1*s2*r11+.95259098236529e-1*s2*r12+.992282273297173*s2*r13 = .76364294519742e-1*t2;
eq9:=-30*r13-.86165283952334e-1*s3*r11+.103398340742801*s3*r12+.990900765451843*s3*r13 = -.81460429387834e-1*t3;
eq10:=-30*r23-.79382581863774e-1*s1*r21-.95259098236529e-1*s1*r22+.992282273297173*s1*r23 = -.107930827800543*t1;
eq11:=-30*r23+.79382581863774e-1*s2*r21+.95259098236529e-1*s2*r22+.992282273297173*s2*r23 = .60269029165473e-1*t2;
eq12:=-30*r23-.86165283952334e-1*s3*r21+.103398340742801*s3*r22+.990900765451843*s3*r23 = .105021268850622*t3;
eq13:=-30*r33-.79382581863774e-1*s1*r31-.95259098236529e-1*s1*r32+.992282273297173*s1*r33 = .990627255252918*t1-30;
eq14:=-30*r33+.79382581863774e-1*s2*r31+.95259098236529e-1*s2*r32+.992282273297173*s2*r33 = .995256820446840*t2-30;
eq15:=-30*r33-.86165283952334e-1*s3*r31+.103398340742801*s3*r32+.990900765451843*s3*r33 = .991128009660183*t3-30;


r11 := 1;
r12 := 0;
r13 := 0;
x := .523598775598299;
r21 := 0;
r22 := cos(x);
r23 := -sin(x);
r31 := 0;
r32 := sin(x);
r33 := cos(x);
t1 := 29.862424638395044;
t2 := 32.737813080348531;
t3 := 30.689747387623886;
s1 := 31.493054789905649;
s2 := 31.493054789905628;
s3 := 29.014005238849720;
eq1;
eq2;
eq3;
eq4;
eq5;
eq6;
eq7;
eq8;
eq9;
eq10;
eq11;
eq12;
eq13;
eq14;
eq15;

unassign('r11', 'r12', 'r13', 'r21', 'r22', 'r23', 'r31', 'r32', 'r33', 't1', 't2', 't3', 's1', 's2', 's3');
solve({eq1, eq10, eq11, eq12, eq13, eq14, eq15, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9}, {r11, r12, r13, r21, r22, r23, r31, r32, r33, s1, s2, s3, t1, t2, t3});

how to resolve this error... ?? 



I did dummy indices implication using add command as below. is it OK or there are mistakes?

Is there another way to imply dummy index summation in maple instead of using add command?

any suggestion???

restart

II := 9:

JJ := 9:

with(LinearAlgebra):

 

 

F := add(add(add(add(R[i, m]*R[k, m]*(U[i, j]*U[k, j]+U[i, j]*V[k, j]+V[i, j]*V[k, j]+W[i, j]*W[k, j])/((2*m+1)*(2*j+1)), i = 0 .. II), k = 0 .. II), m = 0 .. II), j = 0 .. JJ):

EqU := seq(seq(diff(F, U[i, j]), j = 0 .. JJ), i = 0 .. II):

EqV := seq(seq(diff(F, V[i, j]), j = 0 .. JJ), i = 0 .. II):

EqW := seq(seq(diff(F, W[i, j]), j = 0 .. JJ), i = 0 .. II):

var := [seq(seq(U[i, j], j = 0 .. JJ), i = 0 .. II), seq(seq(V[i, j], j = 0 .. JJ), i = 0 .. II), seq(seq(W[i, j], j = 0 .. JJ), i = 0 .. II)]:

NULL

sys := [EqU, EqV, EqW]:

Aa, bb := GenerateMatrix(sys, var):

Aa

RTABLE(18446744074191847422, anything, Matrix, rectangular, Fortran_order, [], 2, 1 .. 300, 1 .. 300)

(1.1)

``


 

Download Mesal.mw

 

 

 

 ODE:= -2 sin(1/2 theta(t)) cos(1/2 theta(t)) (diff(theta(t),t)^2-9.8000 sin(theta(t))-(150+4 sin(1/2 theta(t))^2) (diff(theta(t),t,t)=0:

 ICS:=  theta(0) = Pi/6, D(theta)(0) = DthetaZero:

When I use functions from the DocumentTools to display information in a Maple document, they display a weird bracked along the left hand side of the display. I would like them to display in the same way they do in the help pages. I have attached a document showing the results I get when I repeat some of the examples from the help pages.

display-problems.mw

 

subs can not make diff(1, t) = 0

sys := simplify(subs(diff(1,t)=0,subs(c(t)=1,[ode1a,ode3a])));
sys := [diff(a(t), t) = 1.342398800*10^5*a(t)+89591*b(t)+44647, 44647*a(t)+44902*b(t)+44859];

DEplot(sys, [a(t), b(t)], t = 0 .. 16, a = -16 .. 16, b = -16 .. 16, color = magnitude, title = `Stable Limit Cycles`, arrows = curve, dirfield = 800, axes = none);
Error, (in DEtools/DEplot/CheckDE) derivatives must be given explicitly

why can not plot?


 

How do I use characters in a file using the "read" statement?

Example: The following function code is written in a textfile test.mpl.

test:=proc()
print("hüstel");
end proc:

I read the file with

> read("test.mpl");
> test()

"h�stel"

The Letter "ü" appears like "�".

If the comand is input direct in the document mode it appears correct:

print("hüstel");

"hüstel"

 

ygraph1 := -.736312023696564122*exp(2.26140104440167664*10^5*tt)-.591826613918776445*exp(28994.5376895644186*tt)+.328002839648234568*o*exp(13767.7178702679158*tt);
ygraph2 := -.591859486202007235*exp(2.26140104440167664*10^5*tt)+.328381376616263988*exp(28994.5376895644186*tt)-.736116852194203974*o*exp(13767.7178702679158*tt);
ygraph3 := -.327943520064913564*exp(2.26140104440167664*10^5*tt)+.736143281263262450*exp(28994.5376895644186*tt)+.592069351595225779*o*exp(13767.7178702679158*tt);
FunctionAdvisor(branch_points, ygraph1);
plot(ygraph1, tt=-5..5);
plot(ygraph2, tt=-5..5);
plot(ygraph3, tt=-5..5);
Warning, unable to evaluate the function to numeric values in the region;
 
how to plot this system?

I have encountered bug in factors/fsolve while working with 19-th degree polynomial: 

 

restart;

Digits:=150:
T:=-6.22380759047872668130713536877030256364968636070065651396334810246948704517800844289400608484048587112392332204805530128070851889819985512874202683743*10^11*x^15+1.30320674544020861155773378297484119553167774488351680864188235543008368581731239587845304516984389100205019741111280194189829856859808540642557769603*10^10*x^6-4.66269056752439302342961934783764679009596024511170531603537327397832302302620600217387943312388922053304167698527169182278585860427802821480352854136*10^11*x^9-2.23704996926446119043671514798254764988240075983626880645807120500701523185370168392321824617257975062292105400290171941856646211919772527234308968846*10^9*x^5+1.70227750800986164284793608409450414651109713000703213281475661248797845709368255736580952492853671050778821135335145407044800619189451776936359075686*10^12*x^12+2.75132914316444017343930750158891109941047127103886960894939389127711887329536485172215512793127850186551483171384960841607262449527761786758828223621*10^8*x^4-34932.1305741980482332724462824276603543110574918698909627427160477228536038554704823433224807581628905769847550345090785500099182662763447500819501675*x+1.14859089243616386902401277001127426741536679789632050800564282457083136981495352758127041512610195469873039580049988570650313838832989727748112868586*10^12*x^14-6.60479740997269404871863401649844958253760499264982628400515571200965556608668632440745621931354881132921476624343305820884923453724427367494415551238*10^10*x^17-5.62833694496139881587566825658979473046292640751330993837612787833792702707901920475562429114656627532669843830531312111426766840057855202536781521123*10^10*x^7-1.41317084251894030640575308228417182186337397538022537825365672333611503622567981167488384741420461775617951229535582868905095341476313150469092017698*10^12*x^11-8.21268191019727949807038061270674769712976810595535494085869238004490345847174711476348954310804852930678468602300916137608391140935636924900016951244*10^8*x^19+397.252699937115297695173788383107213691513398731729934944369484808586994493337920006396692649274392699364304534062337678482629861430643165733668575822+2.45061767631130714142188028061597642324588736935628490184983950396964320020866945354270367821778753632385377702112725604392839751008695021580743844404*10^11*x^16+1.08699947236093139248842860047684411564605736115175003178583710408973712475471303403438454553797809672473740940054172927497665894877177132800140413775*10^10*x^18+1.84485142971549353599220669614768264648023215439682851036030548807708252959822522849421648368214446092969270608024147362000126035954415744321702508798*10^11*x^8-2.30461084758765666852675422975553976835398815305842562217293737088819307979848024374022174488508670823626363788957243202121075401744096241597591787541*10^7*x^3+9.17691101238967627829517731270700894639677345422963842539705370480050031196020089039807157125184117990094461042715726886282973724309183151499484709563*10^11*x^10-1.59505142070054081045558935086478494555622632474984266672719416019069437321867830698450310020630535513817946854845186492455277659549284062382504657541*10^12*x^13+1.21399269842294123787022397507857250840398420627023248941081275489711499859955449395398103964932227544163416388726749227644470585060488880538430515276*10^6*x^2:

infolevel[fsolve]:=3:
fsolve(T,fulldigits); # <-- completes without issues

factors(T);           # <-- freezes with log:
fsolve: ill-conditioned polynom of degree 19, with 0(0) given roots
fsolve: 1th root found in 9 iters at 165 Digits
fsolve: 2th root found in 11 iters at 164 Digits
fsolve: 3th root found in 11 iters at 165 Digits
fsolve: 4th root found in 10 iters at 174 Digits
fsolve: 5th root found in 10 iters at 167 Digits
fsolve: 6th root found in 11 iters at 168 Digits
fsolve: 7th root found in 11 iters at 174 Digits
fsolve: 8th root found in 11 iters at 170 Digits
fsolve: 9th root found in 11 iters at 181 Digits
fsolve: 10th root found in 11 iters at 172 Digits
fsolve: 11th root found in 12 iters at 175 Digits
fsolve: 12th root found in 11 iters at 182 Digits
fsolve: 14th root found in 14 iters at 177 Digits
fsolve: 15th root found in 10 iters at 176 Digits
fsolve: 16th root found in 11 iters at 173 Digits
Warning,  computation interrupted

 

The most interesting thing is that standalone 'fsolve' finishes fine, but 'factors' freezes in 'fsolve:-polyill' on the same polynomial.

My system is: Windows 7 x64, Maple 2017.0.

Would appreciate any help on how to avoid the issue with 'factors'.

ode1a := diff(a(t), t) = 1.342398800*10^5*a(t)+round(89591.20000)*b(t)+round(44647.44000)*c(t);
ode2a := diff(b(t), t) = round(89591.20000)*a(t)+round(89803.24000)*b(t)+round(44901.60000)*c(t);
ode3a := diff(c(t), t) = round(44647.44000)*a(t)+round(44901.60000)*b(t)+round(44859.24000)*c(t);
sol := dsolve([ode1a=exp(t), ode2a=exp(t), ode3a=exp(t)], [a(t),b(t),c(t)]);

Error, (in dsolve) invalid input: `PDEtools/NumerDenom` expects its 1st argument, ee, to be of type algebraic, but received diff(a(t), t) = (3355997/25)*a(t)+89591*b(t)+44647*c(t)

 

initially i guess the error come from decimal number coefficient

but after round it, still have error

ode1a := diff(y1(tt), tt) = 1.342398800*10^5*y1(tt)+89591.20000*y2(tt)+44647.44000*y3(tt);
ode2a := diff(y2(tt), tt) = 89591.20000*y1(tt)+89803.24000*y2(tt)+44901.60000*y3(tt);
ode3a := diff(y3(tt), tt) = 44647.44000*y1(tt)+44901.60000*y2(tt)+44859.24000*y3(tt);

would like to find the origin eigenstate before it collapse to eigenvalues

how to apply ricci flow in this situation?

i find help file , and can not find some relationship between this application and inputs of ricci related function

which functions in maple can help to find origin of eigenstate

ode1a := diff(y1(tt), tt) = 1.342398800*10^5*y1(tt)+89591.20000*y2(tt)+44647.44000*y3(tt);
ode2a := diff(y2(tt), tt) = 89591.20000*y1(tt)+89803.24000*y2(tt)+44901.60000*y3(tt);
ode3a := diff(y3(tt), tt) = 44647.44000*y1(tt)+44901.60000*y2(tt)+44859.24000*y3(tt);
 
DEplot3d({ode1a,ode2a,ode3a}, {y1(tt), y2(tt), y3(tt)}, tt=0..10,[[y1(0) = 0, y2(0) = 0, y3(0) = 0]],scene=[tt,y1(tt),y2(tt)]);
DEplot3d({ode1a,ode2a,ode3a}, {y1(tt), y2(tt), y3(tt)}, tt=0..10,[[y1(0) = 0, y2(0) = 0, y3(0) = 0]],scene=[tt,y1(tt),y3(tt)]);
DEplot3d({ode1a,ode2a,ode3a}, {y1(tt), y2(tt), y3(tt)}, tt=0..10,[[y1(0) = 0, y2(0) = 0, y3(0) = 0]],scene=[tt,y2(tt),y3(tt)]);
 
can it plot 3 functions ?
and why it return a straight line 3d graph
 
is there some interesting graph from this system?


iam trying to apply newton method on non liner system but i have a problem for apply while loop inside other while loop 
any help please

with(VectorCalculus):

NULL

f[1] := VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`+`(x^2, VectorCalculus:-`-`(VectorCalculus:-`*`(z, exp(y)))), VectorCalculus:-`-`(VectorCalculus:-`*`(y, exp(z)))), 61):

f[2] := VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`*`(VectorCalculus:-`*`(x, y), z), VectorCalculus:-`-`(exp(x))), -3):

f[3] := VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`+`(x^2, y^2), z^2), -14):

F := Matrix([[f[1]], [f[2]], [f[3]]]):

FF := eval(F, [x = x[k], y = y[k], z = z[k]]):

X := Matrix([[x], [y], [z]]):

XX := eval(X, [x = x[k], y = y[k], z = z[k]]):

J := Jacobian([f[1], f[2], f[3]], [x, y, z]):

JJ := eval(J, [x = x[k], y = y[k], z = z[k]])

JJ := Matrix(3, 3, {(1, 1) = 2*x[k], (1, 2) = -z[k]*exp(y[k])-exp(z[k]), (1, 3) = -exp(y[k])-y[k]*exp(z[k]), (2, 1) = y[k]*z[k]-exp(x[k]), (2, 2) = x[k]*z[k], (2, 3) = x[k]*y[k], (3, 1) = 2*x[k], (3, 2) = 2*y[k], (3, 3) = 2*z[k]})

(1)

``

k := 0:

xi := convert(exp(-10), float):

maxval := 10^4:

NULL

while convert(Norm(FF, 2), float) > xi do alpha[k] := min(1, alpha[k]/lambda); L := 1/JJ.FF; K := -L*alpha[k]+XX; x[k+1] := evalf(Determinant(K[1])); y[k+1] := evalf(Determinant(K[2])); z[k+1] := evalf(Determinant(K[3])); A := convert(Norm(FFF, 2), float)^2; B := convert(Norm(FF, 2), float)^2; while A > B do L := 1/JJ.FF; alpha[k+1] := lambda*alpha[k]; K := -L*alpha[k+1]+XX; x[k+1] := evalf(Determinant(K[1])); y[k+1] := evalf(Determinant(K[2])); z[k+1] := evalf(Determinant(K[3])) end do; k := k+1 end do

alpha[0] := 1

 

L := Matrix(3, 1, {(1, 1) = -(12900-300*exp(8)-1200*exp(2))/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500)-(2*exp(8)+31*exp(2))*(77-exp(5))/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500)-(395/2)*(7*exp(8)-4*exp(2))/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500), (2, 1) = (84+exp(5))*(86-2*exp(8)-8*exp(2))/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500)+(5/2)*(4+exp(8)+8*exp(2))*(77-exp(5))/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500)+(79/4)*(exp(8)*exp(5)+8*exp(2)*exp(5)-16*exp(8)-128*exp(2)-400)/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500), (3, 1) = -(-39+4*exp(5))*(86-2*exp(8)-8*exp(2))/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500)-(5/2)*(16+2*exp(8)+exp(2))*(77-exp(5))/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500)-(79/4)*(2*exp(8)*exp(5)+exp(2)*exp(5)-32*exp(8)-16*exp(2)-100)/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500)})

 

K := Matrix(3, 1, {(1, 1) = 5+(12900-300*exp(8)-1200*exp(2))/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500)+(2*exp(8)+31*exp(2))*(77-exp(5))/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500)+(395/2)*(7*exp(8)-4*exp(2))/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500), (2, 1) = 8-(84+exp(5))*(86-2*exp(8)-8*exp(2))/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500)-(5/2)*(4+exp(8)+8*exp(2))*(77-exp(5))/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500)-(79/4)*(exp(8)*exp(5)+8*exp(2)*exp(5)-16*exp(8)-128*exp(2)-400)/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500), (3, 1) = 2+(-39+4*exp(5))*(86-2*exp(8)-8*exp(2))/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500)+(5/2)*(16+2*exp(8)+exp(2))*(77-exp(5))/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500)+(79/4)*(2*exp(8)*exp(5)+exp(2)*exp(5)-32*exp(8)-16*exp(2)-100)/(2*exp(8)*exp(5)+31*exp(2)*exp(5)-207*exp(8)-396*exp(2)-1500)})

 

14.35960152

 

-12.24471811

 

39.82986865

 

HFloat(5.911285325999999e36)

 

35235903.22

 

Warning,  computation interrupted

 

 

 

First 935 936 937 938 939 940 941 Last Page 937 of 2429