MaplePrimes Questions

Hi guys,

 

I would like to convert a piecewise defined function of two variables into an if structure
Example :

F := (x,y) -> piecewise(x < 0, piecewise(y < 0, 0, 1), piecewise(y < 0, 1, 0));

What I expect is something like (the indentation is just for fun)
if x < 0 then
   if y < 0 then 0 else 1 end if;
else 
   if y < 0 then 1 else 0 end if;
 end if


I tried the following :

convert(F(x,y), `if`)  # but it only converts the "outer x condition" and keeps the "inner y conditions" unchanged

And next this :

map(u -> convert(u, `if`), F(x,y)):   # fails to give m
# and
map(u -> convert(u(x,y), `if`), F(x,y)): 
# ...

without success.

Can anoybody help me please.
I am also interested in an explanation of the reasons why the previous command do not work.

Thanks all

How do I get the Matrix to recalculate?

restart

a := 5

5

(1)

``

M := simplify(Matrix(2, 2, {(1, 1) = a, (1, 2) = 2*a, (2, 1) = 3*a, (2, 2) = a^2}))

M := Matrix(2, 2, {(1, 1) = 5, (1, 2) = 10, (2, 1) = 15, (2, 2) = 25})

(2)

``

unassign('a')

a

a

(3)

 

M

Matrix(2, 2, {(1, 1) = 5, (1, 2) = 10, (2, 1) = 15, (2, 2) = 25})

(4)

expand(M)

Matrix(2, 2, {(1, 1) = 5, (1, 2) = 10, (2, 1) = 15, (2, 2) = 25})

(5)

``

 

Download Re-evaluate_a_Matrix.mw

Hi,
I want to plot stream lines from a stream function given by " psi = x*f(eta)+int(h(s), s = 0 .. eta) " where "f(eta)" and "h(eta)" are the solution of the differential equation given below:

restart;
with(linalg);
Digits := 24;

eq1:=diff(f(eta),eta,eta,eta)+f(eta)*diff(f(eta),eta,eta)-(diff(f(eta),eta))^2+1;
eq2 := diff(h(eta),eta,eta)+f(eta)*diff(h(eta),eta)-diff(f(eta),eta)*h(eta);
bc:=f(0)=0,D(f)(0)=0,D(f)(6)=1,h(0)=0,D(h)(6)=1;
A1:=dsolve({eq1,eq2,bc},numeric,method=bvp[midrich],abserr = 1.*10^(-10),output=operator):

How can I do this?

I am using a stoiciometric matrix to generate a system of differential equations (this makes them easier to check). There are 13 chemical species and 16 reactions so I need to make and display vectors of length 13 and 16; as well as a 13x16 matrix.

When I make Vectors of this size they don't get displayed; I just get information about the vector (Fortran order etc) and this is the same for the matrix.

How do i make/edit/display Matrixes nd Vectors of this size?

I had a list of complex numbers that I wanted to find the argument of. Instead of individually inputting each complex number, I was told I could use:

argument~([complexn1,complexn2,complexn3]);

This gave me the argument approximations for each of the complex numbers. When I removed the tilde however, I got an error saying that the argument command could only deal with 1 complex number at a time.

What did the tilde do that allowed me to find all the arguments at once?

I'm trying to plot the varying results to a second degree differential function with different values for one constant in one graph. Here is what I have so far, which is already working.

______________________________________________________________________

> with(plots);
> m := 0.46e-1; d := 0.42e-1; v := 60; alpha0 := convert(12*degrees, radians); g := 9.81; pa := 1.205; cd := .2; n := 4000; omega := 2*Pi*(1/60);
                           
> p := 6*m/(Pi*d^3);
                           
> k1 := (3/4)*cd*pa/(d*p); k2 := (3/8)*omega*n*pa/p;
                  
> gl1 := vx(t) = diff(x(t), t);
                          
> gl2 := vy(t) = diff(y(t), t);
                     
> gl3 := diff(vx(t), t) = -k1*vx(t)*(vx(t)^2+vy(t)^2)^(1/2)-k2*vy(t);
       
> gl4 := diff(vy(t), t) = -g-k1*vy(t)*(vx(t)^2+vy(t)^2)^(1/2)+k2*vx(t);
 
> init1 := x(0) = 0;
> init2 := y(0) = 0;
> init3 := vx(0) = v*cos(alpha0);
> init4 := vy(0) = v*sin(alpha0);
> sol := dsolve({gl1, gl2, gl3, gl4, init1, init2, init3, init4}, {vx(t), vy(t), x(t), y(t)}, type = numeric);

> sol(.5);
> odeplot(sol, [x(t), y(t)], t = 0 .. 6.7);

______________________________________
What I'd like to do now is, for example, plot the solutions in one graph (preferably as a gif) for when n=1500, n=3000, n=4500 etc. Is there a simple way to achieve this? I've tried various methods so far without success.

I resolve the surface flat grinding of a metal pieces in Mathematica, but I would like convert this program in Maple syntaxis. 

Thanks in advance!

Hi,

I am trying to calculate the commutator $[v,w]:=vw-wv$.

For the sake of simplicity lets say

$$v=\dfrac{\partial}{\partial x}$$
and

$$w=x\dfrac{\partial}{\partial t}$$

I know how to calculate the commutator by hand, but I would like to learn how I can do these kind of calculations with maple.

**In this example the calculations by hand look like:**

$$[v,w]=\dfrac{\partial}{\partial x}\left( x\dfrac{\partial}{\partial t}\right)-x\dfrac{\partial}{\partial t}\dfrac{\partial}{\partial x}$$
$$=\dfrac{\partial}{\partial t}+x\dfrac{\partial^2}{\partial x \partial t}-x\dfrac{\partial^2}{\partial t \partial x}=\dfrac{\partial}{\partial t}$$

How can I "teach" maple to do this?

Dear All

I have downloaded second version of DGApplications to work with abstract Lie algebra. The file is actually .mla file and it is executale(as when we open it, a prompt ask, "do you want to execute this file"), but when I press ok for execution, a file open with command like as

"march('open',"C:\\Users\\Manjit\\Downloads\\DGApplications.mla");",

what should I do after this, is it a some sort installation procedure. I keep all my Maple file in E drive with following path:

E:\Maple work\General Maple Workout

Please guide me in simple way, as I failed to install Maple package many times.

Regards

Hello everybody,

I've failured cause of a simple parallel computation.

Let us assume I have 3 procedures g,h,i, each of them does the some computation on a different way and returns the same value (for example two of them need a second and the third needs a day).

It's my goal, that if one of the tasks finished, the other tasks stops and my programm continues. But if I use for example

>Threads:-Task:-Start( null, Task=[f := g(100)], Task=[f:= h(100)], Task[f:= i(100)]);

every task computed to the end and after that the program continues. How can I solve this problem?

P.S. Sorry about my english, I do my best

I am currently working on FDM ,i have 2 coupled nonlinear pde ,i need help in solving these equation using maple code.

> restart:

> alias(f=f(tau,eta), theta=theta(tau,eta));

 

>

 

> PDE1:=S*diff(f,tau,eta)=eta^2*diff(f,eta)^2+(6*eta^2-2*f*eta)*diff(f,eta)+(6*eta^3-f*eta)*diff(f,eta,eta)-eta^4*diff(f,eta,eta,eta);

 

> PDE2:=eta^4*diff(theta,eta,eta)+2*eta^3*diff(theta,eta)-Pr*(f*eta^2*diff(theta,eta)+S*diff(theta,tau))=0;

 

I have encountered a behavior of Maple that I find hard to explain and I am hoping for help. The command

sum(floor((exp(Pi)-Pi)*n)/3^n,n=0..infinity);

was meant to be an example of "High-precision fraud" as in the 1992 paper of Borwein and Borwein, and indeed it gives 29/2 to within 531 digits. But I am unable to make Maple see this; indeed I get with evalf(%,1000)

14.50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

I find it hard to guess why Maple gets this wrong, actually. The point of the example is that floor((exp(Pi)-Pi)*n)=20*n-1 for many n, but Maple has no problems finding the first failure at n=1112. It must hence be trying something more advanced than just adding up all summands until the tail sum is small enough to satisfy the precision? I guess an alternative approach would indeed be possible since what is being "floored" is relatively simple, but then that seems to be buggy?

Would be very grateful for any assistance!

Best,

Soren Eilers

 

 

 

 

Hi all,

If you want to introduce the Heun Function to someone who dose not know anything about it (in the simple and not boring terms ), what would you do in the best??

As all of us know there are 5 Heun Functions: HeunB, HeunC, HeunD, HeunG and HeunT...

In the Maple help there is not enough and interesting information, and in the net I found complicated things about HeunT Function!!!

 

Dear, I want you to send me a simple definition about    HeunT  Function   in just one word page.

 

Thanks

 

of a (concrete/general) triangle, making use of Maple tools in an efficient way?  Mathematica applies the barycentric coordinates and the Dirichlet distribution to this end. More generally, how to efficiently choose a random point in a given bounded region?

i need this equation solve by maple

eql := alap*[(la(a)^4+6*la(a)+1+alap*(la(a)^4-1)/difl1)*la(a)*j(a)-((la(a)^2+1)*(1+2/difl)+la(a)^2-1)*intdj/a^4+[(4*(la(a)^4-1))/difl-8*la(a)^2]*intdj/a^2]-(4*(la(a)^2+1))*intdj/a^4+(4*(la(a)^4-1))*intdj1/a^2 = 0;

First 1130 1131 1132 1133 1134 1135 1136 Last Page 1132 of 2434