MaplePrimes Questions

I found there is assume=[...] syntax. So I changed my code to use it, instead of .... assuming 

Now I find that some tests fail.  Should assuming and assume not give same result?

restart;
sol :=y(x)^(1/2) = -1+2*exp(x):
ode:=diff(y(x),x)-2*y(x) = 2*y(x)^(1/2):

odetest(sol,ode) assuming x::real, x>0

gives 0

but

odetest(sol,ode,assume=[x::real, x >0])

does not give zero. Please see screen shot below.

Reason I changed, since I started saving assumptions to use in a list. So it was easier to use assume=[....] than assuming ...., since assuming wants expression sequence in front of it and I did not know how to convert the list of assumptions I have collected to an expression sequence on the fly to use assuming, otherwise I would not have changed the code.

But my question is: Should both give same result? Why is the result different?

Help says

The assume routine sets variable properties and relationships between variables. Similar functionality is provided by the assuming command.

I am probably not using assume= correctly.   I thought I could use the same thing I had on assuming, just put it in a list. 
 

This happens each time I run a long loop.  (2,500 iterations, which takes about 3 hrs to complete)

Maple always hangs (it does not time out on odetest() ). But my question is not about this (as this is something I have to deal with for long time now and mentioned it before many times. May be one day Maplesoft will fix this). 

But I noticed this also.  When Maple hangs, (and it always hangs at least once during this loop), I then click on the button "interrupt the current operation". This does stop the hangs.

Next I do a restart and starts the loop from the loop counter where it hanged in order to continue.  

But It still hangs at that same iteration. I repeate this again, and it still hangs.

Now I close Maple altogether, start Maple again, open same worksheet, and repeat from the same iteration again from where it was at before, now it does not hang.

This tells me that restart and "interrupt the current operation" do not clean everything as expected. Else why only restarting Maple makes it work?

It means mserver.exe (separate process from the frontend) still is caching something related, and that is why it hangs at that iteration.

I can reproduce this each time I run the whole loop from the start.

I can't make a minimal example, since I have no idea where it hangs and why. And it is related to running a long loop.

I just know it hangs when doing odetest() with timeout which never timeout, and it seems random at what iteration it decides to hang.

But my question is really basic here: Does mserver.exe keep any information about the earlier user session/worksheet even after restart ? help says that restarts clear internal memory of the kernel.

Isn't mserver.exe  the Maple kernel? If so, then what could explain that only restarting Maple clears the hang? I am just looking for ideas that could explain this.

This type of problem is the most annoying thing about Maple for me. 

Maple 2020.1 on windows 10.

 

Whoever designed Maple's user-interface thinks very differently from me. How can I insert a 2nd section into Chapter 1? There's no space between the end of Section 1 and the end of Chapter 1 for me to put the cursor, so where should I put the cursor, and what should I do?


Eigenvector result is changing every time it run.

How to make eigenvectors result the same every time it run?

 

Study a example 

Procedures. Declare local variables within procedures.
> # Program 1: Procedures.
> # The norm of a 3-dimensional vector.
> norm3d:=proc() local a,b,c;sqrt(aˆ2+bˆ2+cˆ2) end;
> norm3d(3,4,5);
5√(2)

Must say it was never clear for me the procedure () 
Never have read in the tutorials or study material the use of proc ( )  ( i did not read them all, so probably i missed it somewhere )

The procedure norm3d()  i get not working , because i don't not know how to use it 

 

What do I need to do to the "2 + 3" in the attached Document in order to make it evaluate? I know about F5 to switch between Text and Math modes, but that's not enough to get me where I want to be. The "2 + 3" is already in Math mode, but that's not enough to get it to evaluate.

The Document: t.mw

I would appreciate seeing how Maple handles concatenation, digital sums and selection of related least terms. Here are two examples of problems currently of interest:

1. Construct the lexicographically earliest sequence of distinct positive integers such that the sum of the digits of the first n terms is coprime to their concatenation; first term is 1:

1,3,7,2,4,5,9,6,13,8,19,11....

(I already have many terms for this, computed by a  Mathematica code, but would like to see it done in Maple).

2. Lexicographically earliest sequence of distinct positive integers such that the n-th term divides the concatenation of the first n terms; first term is 1:

1,2,3,5,10,4,8,6,11,20,13,7,9,12,15,18,14,25,30.....

(these terms found one by one, using Maple in manual mode, no code).

Thanks in advance for any assistance with this 

Regards

David.

 

 

Is there a possibility to test the result of a numerically solved deq?

Something goes wrong in this worksheet with old code

Must be corrected
Thanks

fmatrix.mws

Anyone maybe helps me with writing the maple code mentioned in the following pdf.

I want to know about the potential flow around 3D domain.

 

Doc1.pdf

R2,R3,R4,R5 have been given,I try to solve the following ode equation: The initial value:r2(0)=r3(0)=r4(0)=r5#(0);system={diff(r2(theta),theta)=R2;diff(r3(theta),theta)=2*R2*U2+R3;diff(r4(theta),theta)=R2*(U2^2+2*U3)+3*R3*U2+R4;diff(r5(theta),theta)=2*R2*(U2*U3+U4)+3*R3*(U2^2+U3)+4*R4*U2+R5}.I want to get the exact solution of subs(theta=2*Pi,U5),But it just gives the form include _Z1,_Z_2,_Z3.How can I get exact value?
 

restart:

#interface(echo = 2)

c10:=-26/9:c01:=-9.330480048:c11:=-199/33:c02:=-7.162134941:c12:=-93/11:c03:=-.756797589:d10:=11/9:d01:=26/9:d11:=19/3:d02:=25/3:d12:=8:d03:=1:

 

 

A1 := c03*y^3+c12*x*y^2+c02*y^2+c11*x*y+c01*y+c10*x:B1:=d03*y^3+d12*x*y^2+d02*y^2+d11*x*y+d01*y+d10*x:

aa1:=diff(arctan(v/u),u):bb1:=diff(arctan(v/u),v):

  A11:= subs({x = -u, y = (v+c10*u/sqrt(w))*sqrt(w)/c01}, -A1):B11:= subs({x = -u, y = (v+c10*u/sqrt(w))*sqrt(w)/c01}, B1):

w :=-c01*d10+c10*d01:

f11 := subs({x = -u, y = (v+c10*u/sqrt(w))*sqrt(w)/c01}, -A1): collect(%, v):f2 := subs({x = -u, y = (v+c10*u/sqrt(w))*sqrt(w)/c01}, B1): collect(%, v):g := simplify(-c10*f11/sqrt(w)+c01*f2/sqrt(w)): collect(%, v):

f111:=collect(1/sqrt(w)*f11,v):f222:=collect(1/sqrt(w)*g,v):

F1:=u*f111+v*f222:F11:=subs({u=r*cos(theta),v=r*sin(theta)},F1):F11:=F11/r:F2:=aa1*f111+bb1*f222:F22:=subs({u=r*cos(theta),v=r*sin(theta)},F2):

M:=F11/F22:M:=taylor(M,r,6):r1:=coeff(M,r,1):simplify(%):subs(c10=-d01,r1):simplify(%):

 

c10:=-d01:R2:=coeff(M,r,2):R3:=coeff(M,r,3):R4:=coeff(M,r,4):R5:=coeff(M,r,5):

 

#R2,R3,R4,R5 have been given,I try to solve the following ode equation: The initial value:r2(0)=r3(0)=r4(0)=r5#(0);system={diff(r2(theta),theta)=R2;diff(r3(theta),theta)=2*R2*U2+R3;diff(r4(theta),theta)=R2*(U2^2+2*U3)+3*R3*U2+R4;diff(r5(theta),theta)=2*R2*(U2*U3+U4)+3*R3*(U2^2+U3)+4*R4*U2+R5}.I want to get the exact solution of subs(theta=2*Pi,U5),But it just gives the form include _Z1,_Z_2,_Z3.How can I get exact value?

 

U2:=rhs(dsolve({diff(r2(theta),theta)=R2,r2(0)=0})):

U3:=rhs(dsolve({diff(r3(theta),theta)=2*R2*U2+R3,r3(0)=0})):

U4:=rhs(dsolve({diff(r4(theta),theta)=R2*(U2^2+2*U3)+3*R3*U2+R4,r4(0)=0})):

U5:=rhs(dsolve({diff(r5(theta),theta)=2*R2*(U2*U3+U4)+3*R3*(U2^2+U3)+4*R4*U2+R5,r5(0)=0})):

U6:=subs(theta=2*Pi,U5):save U6, output5:

 

 

``


 

Download Li2.mw
 

 

How to turn the "a" into a number before it gets plotted? Here's how not to do it:

 

eval(plot(x, x = 0 .. a), a = 3);
Error, (in plot) expecting a real constant as range endpoint but received a
subs(plot(x, x = 0 .. a), a = 3);
Error, (in plot) expecting a real constant as range endpoint but received a

 

My limited experience with Maple graphics consists so far of plotting simple graphs using plot(). Now I'd like to do one like this (digital signal-processing: discretely sampling a continuous signal):

In addition to the graph of the continuous function, I've drawn dots on the graph at integer x-values, and then I've dropped verticals from the dots to the x-axis.

There will always be a dot on the graph at x=0, and the horizontal distance from one dot to the next will always be constant within a single graph, but not always equal to 1. For example, in one graph the dots might be spaced 0, Pi, 2*Pi, etc. It would be nice to show numerical labels for the x-values of the dots in that case too.

What functions should I read about in the docs for this? Thank you.

1. The attached file is a small test sample out of a larger program. I do not understand what is wrong with the code.

2. What does 'global variables are deprecated' mean when I want to solve a deq numerically? Cannot acces link indicated for further explanation.

3. Is there a means to use 'odetest' when a deq was solved numerically?

 

Dear everyone,

I want to execute a simple example by using Grid:-Send and Grid:-Receive commands. I have two questions:
1) Why does the Grid:-GetLastResult(0) command not return anything?

2) I tried to send the value of a, namely 2, from node 0 to node 1. It seems the execution is not stopped by Grid:-Send(1,a) and a_1:=Grid:-Receive(0) while CPU is not working.
Would anyone guide me?

The answer to the second question is more important to me.

Best wishes

 

 

restart;

Grid:-Run(0,"a:=2;");

Grid:-GetLastResult(0);

Grid:-Get(0,a);

Grid:-Send(1,a);

a_1:=Grid:-Receive(0);

First 395 396 397 398 399 400 401 Last Page 397 of 2308