Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I'm trying to solve system of ODE (Temperature changing with time) which are going to use the heat capacity obtained from thermophysical package (heat capacity is changing with temperature).

In the support page there is an example in which they were able to integrate the heat capacity from the package. So I wondering if it is possible to include it in an ODE system.

I used their same approach, I tried defining the call to the package as a function but I'm getting an error:

"Error, (in dsolve/numeric/process_input) input system must be an ODE system, found {ThermophysicalData:-CoolProp:-PropsSI(C,P,101325,T,T1(t),"hydrogen"), T1(t), T2(t), T3(t)}"

Attached question.mw

 

restart:
with(ThermophysicalData):
with(CoolProp):
with(plots):

#I would like to get the heat capacity from this package. Heat capacity is a function of temperature and pressure.
CP:=T1->PropsSI(C, P, 101325, T, T1, "hydrogen")/10000:

#Parameters
UA:=10:T0:=20:TS:=250:W:=100:M:=1000:

#The temperature is changing in this system of ODE with time. I would like to have the heat capacity value changing with temperature using the values obtained from the package.
EQ1:=diff(T1(t),t)=(W*CP(T1(t))*(T0-T1(t))+UA*(TS-T1(t)))/M/CP(T1(t)):
EQ2:=diff(T2(t),t)=(W*CP(T1(t))*(T1(t)-T2(t))+UA*(TS-T2(t)))/M/CP(T1(t)):
EQ3:=diff(T3(t),t)=(W*CP(T1(t))*(T2(t)-T3(t))+UA*(TS-T3(t)))/M/CP(T1(t)):

sol:=dsolve({EQ1,EQ2,EQ3,T1(0)=25,T2(0)=25,T3(0)=25},[T1(t),T2(t),T3(t)],numeric):
odeplot(sol,[[t,T1(t)],[t,T2(t)],[t,T3(t)]],t=0..140,legend=[T1,T2,T3],labels = ["time [min]", "Ti [C]"],axes=boxed)
sol(57.7);
 

Dear Maple user i want to extract the data from the given graph and store in excel file. where the first column contain the value of lambda in that substitude the values of delta2 ranging from 0.002 to 0.1 (atleast 20 values) and second column  contain Nb =0.1, third column Nb= 0.2 and third column Nb=0.3. Thanks in advance

restart:
h:=z->1-(delta2/2)*(1 + cos(2*(Pi/L1)*(z - d1 - L1))):
K1:=((4/h(z)^4)-(sin(alpha)/F)-h(z)^2+Nb*h(z)^4):
lambda:=Int(K1,z=0..1):
L1:=0.2: F:=10:
d1:=0.2:
alpha:=Pi/6:
plot( [seq(eval(lambda, Nb=j), j in [0.1,0.2,0.3])], delta2=0.02..0.1);

I am trying to solve this PDE, but I am facing challenges when it comes to handling the collection and organization of terms in the equations. Some of these result in as many as 60 equations, and I’ve seen similar cases in research papers. Is there an effective method or approach to manage such complexity and construct the equations more efficiently?

p9.mw

restart; # Clear all variables expr := (x^3 - 2*x^2 + x) / (x^2 - 1); simplify(expr);

Hello sir, how are you?
Sorry to bother you, I needed your help. I have the script from your textbook "3D Graph Equation of Motorcycle run on Maple Software". It's not working. I'd appreciate it if you could take a look.

with(plots);
implicitplot3d(((49.80*x + 19.44*y + 133.2300 - 19.08*sqrt(x^2 + 8.30*x + 19.8469 + y^2 + 3.24*y) - 66.6150*abs(-3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2))) + 0.42) + 0.5625*abs(3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2)) + 0.42 + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y + 2) = ((((((((((((2 + abs(3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2))) + 0.42) + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y + 2)*(x^2 + 8.30) + abs(3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2)) + 0.42 + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y + 2)*(y^2 + 3.24)) + abs(3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2))) + 0.42 + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y + 2)*(x^2 + 8.30) + abs(3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2))) + 0.42) + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y - 2)*(x^2 + 3.24) + abs(3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2)) + 0.42 + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y - 2)*(y^2 - 3.18)) + abs(3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2))) + 0.42 + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y + 2)*(x^2 + 8.30) - 3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2)) + 0.42) + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y - 2)*(x^2 + 8.30) - 3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2) + 0.42 + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y - 2)*(x^2 + 3.24)) - 3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2)) + 0.42 + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y + 2)*(y^2 + 3.24) + 0.42*abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y + 2) and ((((((((((((2 + abs(3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2))) + 0.42) + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y + 2)*(x^2 + 8.30) + abs(3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2)) + 0.42 + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y + 2)*(y^2 + 3.24)) + abs(3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2))) + 0.42 + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y + 2)*(x^2 + 8.30) + abs(3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2))) + 0.42) + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y - 2)*(x^2 + 3.24) + abs(3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2)) + 0.42 + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y - 2)*(y^2 - 3.18)) + abs(3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2))) + 0.42 + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y + 2)*(x^2 + 8.30) - 3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2)) + 0.42) + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y - 2)*(x^2 + 8.30) - 3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2) + 0.42 + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y - 2)*(x^2 + 3.24)) - 3.9*sqrt((x - 1.7)^2 + (y - 1.35)^2)) + 0.42 + abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y + 2)*(y^2 + 3.24) + 0.42*abs(0.00390625*(x^8 + y^8) - 0.5*x + 2*y + 2) = 0, x = -7 .. 7, y = -4 .. 3, z = -3 .. 3, numpoints = 350000, style = surface, color = "Niagara Azure");

While these things are a walk in the park with languages like C and system administration languages like bash, the maple file IO is really a bit wanting

I tried, but nowhere in the manual could I find how to use a variable in a filename.

As an example with bash,   you can assign a value to a variable say Ver=01.

The program code contains the filename as
filename$Ver.txt,
and upon execution of the file saved, it is saved as filename01.txt .
Where it replaced the variable with its value in the saved file.

There seems to be no such thing in Maple I could find.
If it exists, it must be so obscure that normal manual searches cannot find it.

So, how do you save a file using a variable in the filename, which then uses the value of the variable in the saved filename. ?
This is basically a prerequisite e.g. for server based maple doing large datasets, so maple must be capable doing it.

I have just posted a question about whether it is possible to modify a procedure once the procedure is created.

It disappeared.

I either want to add an option or change the body of the procedure by replacing functions.

The procedure is generated by Maple commands so I cannot do the changes as if I would do it normally when entering by hand.

Is adding an option or changing the body possible?

I can extract the operands by doing op(eval(procname)). But I can neither extract the body nor assemble everything together.

I will delete this message in case the other message reappears.

>FunctionAdvisor(Zeta)

Then go to the plot section. I would like to see the commands that were used (complexplot3d I guess) to plot the first Zeta Riemann function in 3-d. Usually, you go to the cell where you se the output that you are interested in. Then you right-click and choose properties of the Array. Then you check the "Show input". Then you click OK and you are suppose to see the input that generate the 3-d plot of the Riemann Zeta Function.

But it doesn't happen. So maybe I am doing something wrong. Any idea?

Thank you in advance for your help.

On donne une ellipse rapportée à ses axes x^2/a^2+y^2/b^2-1=0 et une droite (D) qui rencontre cette
courbe en 2 points A et B. 
On considère un cercle variable passant parles points A et B et on demande le lieu géométrique des points de rencontre des tangentes communes au cercle et à l'ellipse.
restart;
with(plots);
with(VectorCalculus);
a := 5;
b := 3;
ellipse_eq := (x, y) -> x^2/a^2 + y^2/b^2 - 1;
m := 1;
c := -2;
line_eq := (x, y) -> y - m*x - c;
intersections := solve({line_eq(x, y) = 0, ellipse_eq(x, y) = 0}, {x, y}, explicit);
A := intersections[1];
B := intersections[2];
A := [VectorCalculus:-`+`(VectorCalculus:-`*`(25, 17^VectorCalculus:-`-`(1)), VectorCalculus:-`*`(VectorCalculus:-`*`(15, sqrt(30)), 34^VectorCalculus:-`-`(1))), VectorCalculus:-`+`(VectorCalculus:-`-`(VectorCalculus:-`*`(9, 17^VectorCalculus:-`-`(1))), VectorCalculus:-`*`(VectorCalculus:-`*`(15, sqrt(30)), 34^VectorCalculus:-`-`(1)))];
B := [VectorCalculus:-`+`(VectorCalculus:-`*`(25, 17^VectorCalculus:-`-`(1)), VectorCalculus:-`-`(VectorCalculus:-`*`(VectorCalculus:-`*`(15, sqrt(30)), 34^VectorCalculus:-`-`(1)))), VectorCalculus:-`+`(VectorCalculus:-`-`(VectorCalculus:-`*`(9, 17^VectorCalculus:-`-`(1))), VectorCalculus:-`-`(VectorCalculus:-`*`(VectorCalculus:-`*`(15, sqrt(30)), 34^VectorCalculus:-`-`(1))))];
center_x := VectorCalculus:-`*`(VectorCalculus:-`+`(A[1], B[1]), 2^VectorCalculus:-`-`(1));
center_y := VectorCalculus:-`*`(VectorCalculus:-`+`(A[2], B[2]), 2^VectorCalculus:-`-`(1));
radius := VectorCalculus:-`*`(sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(A[1], VectorCalculus:-`-`(B[1]))^2, VectorCalculus:-`+`(A[2], VectorCalculus:-`-`(B[2]))^2)), 2^VectorCalculus:-`-`(1));
circle_eq := (x, y) -> (x - center_x)^2 + (y - center_y)^2 - radius^2;
L := (x1, y1, x2, y2, lambda1, lambda2) -> (x1 - x2)^2 + (y1 - y2)^2 + lambda1*ellipse_eq(x1, y1) + lambda2*circle_eq(x2, y2);
eq1 := diff(L(x1, y1, x2, y2, lambda1, lambda2), x1);
eq2 := diff(L(x1, y1, x2, y2, lambda1, lambda2), y1);
eq3 := diff(L(x1, y1, x2, y2, lambda1, lambda2), x2);
eq4 := diff(L(x1, y1, x2, y2, lambda1, lambda2), y2);
eq5 := ellipse_eq(x1, y1);
eq6 := circle_eq(x2, y2);
sols := solve({eq1, eq2, eq3, eq4, eq5, eq6}, {lambda1, lambda2, x1, x2, y1, y2}, explicit);
sols;
lieu_geometrique := [seq([sols[i][1], sols[i][2]], i = 1 .. nops(sols))];
plot(lieu_geometrique, style = point, symbol = cross, color = red, title = "Lieu géométrique des points de rencontre");
Ce code m'a été donné en partie par l'intelligence artificielle (Mistral), mais il se plante. Pourriez-vous corriger les erreurs. Merci.

I have solved my ODEs numerically and it's working now I am want to draw comparison so could anyone help me to generate a comparison table for two solutions? like analytic solution and numeric solution for u(y). Also, I need to draw the absolute error between them. 

Abs_Error_help.mw

evalindets API says 

             evalindets( expr, atype, transformer, rest )

Where the transformer will be applied on any indents of atype.

But I want to be able to do the opposit, i.e. 

             evalindets( expr, except_this_atype, transformer, rest )

ie. apply the transformer on everything except those of atype.

Here is a concrete example and what I tried.

I get result of apply inverse Fourier transform which can have some terms in it which can not be evaluated. Like this

Y:=(s+1)/s^2+Int(sqrt(s^2),s);
expr:=inttrans:-invlaplace(Y,s,t);

Now I want to evaluate the above at some specific value of t, say t=0 but I do not want change/touch any "t" inside invlaplace(....) function. 

If I just do 

eval(expr,t=0)

So I tried evalindets with flat option and used for atype anything, then inside the transformer, check if op(0,X) is invlaplace (i.e the head), and if so, skip it. But it did not work

Y:=(s+1)/s^2+Int(sqrt(s^2),s);
expr:=inttrans:-invlaplace(Y,s,t);
evalindets[flat](expr,anything,X->`if`( evalb(op(0,X)='invlaplace'),X,eval(X,t=0)));
evalindets[flat](expr,anything,X->`if`( op(0,X)='invlaplace',X,eval(X,t=0)));



Currently what I do to make this to work, is to first replace the "t" inside invlaplace by another unused symbol, then do the eval to change t, then replace the symbol back to t.

Like this, and this works:

Y:=(s+1)/s^2+Int(sqrt(s^2),s);
expr:=inttrans:-invlaplace(Y,s,t);
expr:=evalindets[flat](expr,'specfunc(anything,invlaplace)',X->eval(X,t=T));
expr:=eval(expr,t=0);
expr:=eval(expr,T=t);

Is it possible to do the above using one call to evalindets?  Why did the check I had the above using `if`(...) not work?

It will be really useful if evalindets had option NOT atype,  in addition of just atype.

i.e. tell it to do the transformation on everything except the type given.

Maple 2024.2

 

I am trying to animate images generated in a do loop using display and insequence. I get an output but there is no flipping of the image even while I see the frames count flip through the frames. What am I doing wrong? See attached code. Thanks!

Why_cant_I_animate_still_images_like_this.mw

This is about delayed input after executing this file Campo_Médio_spin_7_2_-_Forum_optimize_02.mw

from annother question dealing with very large physics expressions (containing about 100000 exponential functions).

The GUI shows but when I place the cursor in an inputline and type, characters are sometimes displayed with a huge delay (about 20 seconds). This is from time to time, i.e. not always. All on Windows 10, 64 Gb memory and 4 Gb graphic card memory.

Can someone reproduce this?

Has anybody experienced the same (kernel with large expressions & GUI not responsive)?

Anything that I can test or try?

(I had a similar question about file size but this time the file size is small 150 kB and no big plots are made.

Only the kernel has to deal with the large expression. Output displayed on the GUI is negligible.)

Hey guys, 

in the attached file you can see my problem. Since Maple was not able to calculate my set with 8 equations, 8 variables and 13 inequalities I had to split in into two steps. Here you can see how I try to take one solutions of what I got with solve onto 8 equations with 8 variables and to solve this together with my inequalities. It never was a problem before. So ow I get a weird error I dont understand.

restart; inequalities := {0 < k, 0 < m, 0 < s, 0 < x, 0 < y, 0 < n+(p-1)*s, 0 < (m*y-1)*n+(m*x-m+1)*(1-p), 0 < (m*x-m-s+1)*p+m*y*(s-n), 1 < x+y, k < 1, m < 1, s < t, t < 1}; solve(`union`({k = (x*(1-sqrt(x))+sqrt(x)-2*x)/((x^2-3*x+1)*x), m = (sqrt(x)+x)/(x-1), n = (sqrt(x)+x)/(x-1), p = (-1-sqrt(x))/(x-1), s = (-1-sqrt(x))/(x-1), t = (2*x*(1-sqrt(x))+1+sqrt(x)-5*x)/(x^2-3*x+1), y = 1-sqrt(x)}, inequalities)); inequalities := {0 < k, 0 < m, 0 < s, 0 < x, 0 < y, 0 < n+(p-1)*s, 0 < (m*y-1)*n+(m*x-m+1)*(1-p), 0 < (m*x-m-s+1)*p+m*y*(s-n), 1 < x+y, k < 1, m < 1, s < t, t < 1}

Error, (in unknown) invalid input: SolveTools:-Inequality expects its 1st argument, eqns, to be of type {list, set}({`<`, `<=`, `=`}), but received [p < 1, -p < 0, And(2*argument((p-1)/p) <= Pi,-Pi < 2*argument((p-1)/p))]

 

restart; solve(`union`({k = (x*(1-sqrt(x))+sqrt(x)-2*x)/((x^2-3*x+1)*x), m = (sqrt(x)+x)/(x-1), n = (sqrt(x)+x)/(x-1), p = (-1-sqrt(x))/(x-1), s = (-1-sqrt(x))/(x-1), t = (2*x*(1-sqrt(x))+1+sqrt(x)-5*x)/(x^2-3*x+1), y = 1-sqrt(x)}, {0 < x, 0 < y}))

{k = p^3/(p^3-2*p+1), m = -p+1, n = -p+1, s = p, t = (3*p-2)*p/(p^2+p-1), x = (p^2-2*p+1)/p^2, y = 1-((p^2-2*p+1)/p^2)^(1/2), 3/2+(1/2)*5^(1/2) < p}, {k = p^3/(p^3-2*p+1), m = -p+1, n = -p+1, s = p, t = (3*p-2)*p/(p^2+p-1), x = (p^2-2*p+1)/p^2, y = 1-((p^2-2*p+1)/p^2)^(1/2), 1 < p, p < 3/2+(1/2)*5^(1/2)}, {k = p^3/(p^3-2*p+1), m = -p+1, n = -p+1, s = p, t = (3*p-2)*p/(p^2+p-1), x = (p^2-2*p+1)/p^2, y = 1-((p^2-2*p+1)/p^2)^(1/2), 1/2 < p, p < (1/2)*5^(1/2)-1/2}, {k = p^3/(p^3-2*p+1), m = -p+1, n = -p+1, s = p, t = (3*p-2)*p/(p^2+p-1), x = (p^2-2*p+1)/p^2, y = 1-((p^2-2*p+1)/p^2)^(1/2), p < 1, (1/2)*5^(1/2)-1/2 < p}

(1)

restart; solve(`union`({k = (x*(1-sqrt(x))+sqrt(x)-2*x)/((x^2-3*x+1)*x), m = (sqrt(x)+x)/(x-1), n = (sqrt(x)+x)/(x-1), p = (-1-sqrt(x))/(x-1), s = (-1-sqrt(x))/(x-1), t = (2*x*(1-sqrt(x))+1+sqrt(x)-5*x)/(x^2-3*x+1), y = 1-sqrt(x)}, {0 < s, 0 < x, 0 < y}))

Error, (in unknown) invalid input: SolveTools:-Inequality expects its 1st argument, eqns, to be of type {list, set}({`<`, `<=`, `=`}), but received [-p < 0, And(2*argument((p-1)/p) <= Pi,-Pi < 2*argument((p-1)/p))]

 
 

NULL

So my question is why does this error occur? And what does it mean? the "but received..." argument in the error makes no sense to me. Why does it happen when I add 0<s but 0<x,0<y is okay?

Thank you in advance

Download Why_this_error.mw

When giving invlaplace an input with an Inert integral (becuase it can not be evaluated), it sometimes return 
              Error, (in depends) malformed integral

But sometimes it returns the inverse Laplace of the unresolved integral, which is the expected result.

In both cases, it should just return  inverse Laplace of the unresolved integral.

Below is worksheet showing such case.

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1836 and is the same as the version installed in this computer, created 2024, December 2, 10:11 hours Pacific Time.`

restart;

Y:=int(sqrt(s)*exp(-s)/(s+1), s);
inttrans:-invlaplace(Y,s,t)

int(s^(1/2)*exp(-s)/(s+1), s)

Error, (in depends) malformed integral

restart;

Y:=int(sqrt(cos(s^2)), s);
inttrans:-invlaplace(Y,s,t)

int(cos(s^2)^(1/2), s)

invlaplace(int(cos(s^2)^(1/2), s), s, t)

 

 

Download malformed_intergal_dec_7_2024.mw

Just reported to Maple support also.

1 2 3 4 5 6 7 Last Page 1 of 2165