Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Dear forum,

my name is Klaus, I am a former mathcad-user and new to maple. I try to get some sheets converted and found a maple-behaviour I don't understand.

I made up a simple function with an if statement. When I try different inputs by hand, I get correct results.
But if I try to plot it, I get the message that the if-statement does not work.

My question : How can I solve this ? And what is the difference between plotting a function and entering values manually ?

restart;
with(Units[Simple]);

funktion := x -> if 2*Unit('m') < x then 1/x; else 2*Unit('m'); end if;

r1 := 3.0*Unit('m');

r2 := 6*Unit('m');

plot(funktion(x), x = r1 .. r2);
Error, (in funktion) cannot determine if this expression is true or false: 2 < x*Units:-Unit(1/m)

I have encountered the problem of extracting multivariable polynomial coefficients, such as using the remove command,

eq2 := 3*p^4*a[2]^2+6*p^2*q^2*a[2]*b[2]+3*q^4*b[2]^2+p^4;
eq2 :=convert(eq2,list);    

eq2 := [3*p^4*a[2]^2, 6*p^2*q^2*a[2]*b[2], 3*q^4*b[2]^2, p^4]

map(t->remove(has,t,{p,q}),eq2);
[3*a[2]^2, 6*a[2]*b[2], 3*b[2]^2, undefined]

eq3 := 3*p^4*a[2]^2+6*p^2*q^2*a[2]*b[2]+3*q^4*b[2]^2;
eq3 :=convert(eq3,list);

map(t->remove(has,t,{p,q}),eq3);

[3*a[2]^2, 6*a[2]*b[2], 3*b[2]^2]

Because the term p ^ 4 similar to power appears, a program should be written to calculate it,      Programming           

extractxishu:=proc(p)           

local i,xishulist,teamlist;           

teamlist:=convert(p,list);           

xishulist:=[]:           

for i in teamlist do           

if type(i,`^`) then           

xishulist:=[xishulist[],1];           

else           

xishulist:=[xishulist[],remove(has,i,{p,q})];          

  end if;           

end do:           

end proc:           

Inspection procedure:         

 eq2 := 3*p^4*a[2]^2+6*p^2*q^2*a[2]*b[2]+3*q^4*b[2]^2+p^4*c[3]+p^3*q*c[3]+6*p^3*a[1]*a[2]+6*p^2*q*a[2]*b[1]+p*q^3*d[3]+6*p*q^2*a[1]*b[2]+q^4*d[3]+6*q^3*b[1]*b[2]+p^4+4*p^3*q+p^3*c[2]+6*p^2*q^2+p^2*q*c[2]+6*p^2*a[0]*a[2]+3*p^2*a[1]^2+6*p^2*a[2]*b[0]+4*p*q^3+p*q^2*d[2]+6*p*q*a[1]*b[1]+q^4+q^3*d[2]+6*q^2*a[0]*b[2]+6*q^2*b[0]*b[2]+3*q^2*b[1]^2+p^2*c[1] +p*q*c[1]+p*q*d[1]+6*p*a[0]*a[1]+6*p*a[1]*b[0]+q^2*d[1]+6*q*a[0]*b[1]+6*q*b[0]*b[1]+p*c[0]+p*d[0]+q*c[0]+q*d[0]+3*a[0]^2+6*a[0]*b[0]+3*b[0]^2            extractxishu(eq2);           

The result is incorrect  , It is found that the command is successful in a separate calculation, but extractxishu is invalid in the program. Why?

  Can any expert tell me where this mistake is? How to modify this program!

Can someone tell me why there is a difference between global and local variables in this code?

...cannot determine if this expression is true or false

GlobalLocal.mw

Maybe I am missing something here. Maybe it's just a new feature?

I have just installed Maple 2021 on Mac.

A simple sheet, using simplify-simplify to get units right.

Sometimes Maple doesn't update result when pressing Enter.

Sometimes Maple doesn't give any result when pressing Enter.

First everything ok:

Then I change a to 5 m. Pressing Enter on all three lines gives:

The value of A is not updated.

If I then delete the 'simplify 9 m^2' and presses Enter on the line with A:=a*b, there is no output?

Pressing Enter on blue line, no output.

 

Given:

x'=-(1+0.1sin(10t))*x+1

https://www.wolframalpha.com/input/?i=x%27%3D-%281%2B0.1sin%2810t%29%29*x%2B1

I need to linearize this non-autonomous differential equation at the equilibrium point (which, according to numerical simulations, is present).

I am familiar with the usual approaches through the Jacobi matrix, but how to use this tool in the case of non-autonomous equations is not clear.

Dear Maple specialists, I ask for help. I would be grateful for your advice and support.

Reviewing the help Physics Examples worksheet Section 1, subsection 5 a transformation between cartesion and spherical coordinates is defined using the command ChangeCoordinates from the Physics[Vectors] package. This command is described briefly as follows in the Updates, Maple 2015, Physics page:

"New command: ChangeCoordinates, to rewrite an algebraic expression, using Cartesian, cylindrical, and spherical coordinates, an expression that involves these coordinates, either a scalar expression, or vectorial one but then not changing the orthonormal basis."

However, when I use the link to the ChangeCoordinates help page, the link simply loops back to the Updates, Maple 2015, Physics page.  Is there a specific help page for the ChangeCoordinates command?


The file is attached.

Download err.mw

The command 'coeff' doesn't work.

Hi!

I am trying to combine the plot in cobweb-diagram.mw (sorry for the messed up axes, you can adjust it in the 'axes properties') with the plot in modèle_graphes.mw. I've tried these two things : test1.mw and test2.mw, but I can't make it work. 

 

Can someone please help me combine these graphics ? Thank you very much for your time.

 Pictures on the theme of Klein bottle.  Wikipedia article
KL_B_1.mw

KL_B_2.mw

How do I make my Maple use delta instead of d for differential equations?

example:

The Document Tools, Tabulate command says this:

Calls to the Tabulate command cannot be nested within each other unless used with the option output=XML and other DocumentTools commands to construct your own content.

Is there an example of nesting Tabulate commands using output=XML ?

Thanks

I have a polynomial in c & d.  I wish to extract the coefficients of lets say 3rd order i.e c^3+c^2d+c d^2+d^3. 

The polynomials can be of 2,3,4.. variables.  

coeffs(14*c^4 + 84*c^3*d + 180*c^2*d^2 + 165*c*d^3 + 55*d^4 + 5*c^3 + 21*c^2*d + 28*c*d^2 + 12*d^3 + 2*c^2 + 5*c*d + 3*d^2 + c + d + 1, [c, d], 'l');
     14, 84, 180, 165, 55, 5, 21, 28, 12, 2, 5, 3, 1, 1, 1

l[1];
                                4
                               c 

l[2];
                               3  
                              c  d

l;
 4   3     2  2     3   4   3     2     2   3   2        2        
c , c  d, c  d , c d , d , c , d c , c d , d , c , d c, d , c, d, 

  1

 

hello everyone, i have an idea how to implement adomain decomposition method manually but want to transform the whole method on maple for any kind of non-linear ode.

Respected administration I already posted the same question for the other method, pls do not delete my question

 

help_adomian_decomposition_method.mw

Hi,

I'm trying to use "Matlab()" command to convert Maple expression into Matlab's expression.

but for some reason it doesn't work.

it works for simple expressions but not this one. It is just a long expression with only some symbols, and the most basic math operations. I don't see why it fails.

It says: "Error, (in Translate) options... not recognized"

I'm attaching the maple code so you can see the error.  

The reason I'm using it is because Matlab could not solve the equation in the file (even numerically). So I wrote the same equation symbolically in Maple so I can copy the symbolic solutions to matlab and use them instead of matlab's 'solve' command.

Hope anyone can help with it.

Here's the code attached:

calc_theta.mw

Rootfinding,Isolate seems to work on more that univariate expressions.

See https://www.mapleprimes.com/posts/215233-Another-Example-Of-A-Real-Manipulator-Model for example with a list of multivariate expressions.

Is there documentation/examples on that?

Thank you!

First 379 380 381 382 383 384 385 Last Page 381 of 2216