MaplePrimes Questions

Hi,

I am trying to solve an equation and plot it as an implicit plot, I would like to increase the number of points in the plot calculation but it seems that there is a limit for it, I chose 10^8 and for a bigger values I get an memorry error from Maple. Is there anyway I can solve this problem?

This is just for an example:

implicitplot(subs({values = ...}), function), for a given values, numpoints=10^8)

 

Regards,

Baharm31

Is there a simple way to see wich packages that I have loaded, without being forced to see thru the entire document?

I'd like to differentiate  3*(r/sqrt(a))+ (r/sqrt(a))^2  w.r.t  r/sqrt(a) and obtain

    3 + 2* (r/sqrt(a))

in otherwords, treat (r/sqrt(a)) as a single variable. This is what I tried:

restart;
v:=r/sqrt(a);    #the single expression to differentiate w.r.t
p:=x->x^2+3*x;
expr:=Diff(p(v),v);
algsubs(v=x,expr);
algsubs(x=v,value(%));

The problem is that when doing x^2 and x is r/sqrt(a), then it become r^2/a and it does not remain (r/sqrt(a))^2, so now the algsubs does not "see" it. I get as final answer

ofcourse, one can now try to simplify the above to the required form, maybe using assumptions or by dividing by sqrt(a) the numerator and denominator of the first term above to get  3+2*(r/sqrt(a)) but this is all requires extra work and can be hard depending on the result.

is there a better way to do the above so it works in general? The problem is in the function p, I need a way to tell Maple now to simplify it somehow. In Mathematica, I can do this like this:

Clear[p, x, r, a]
p[x_] := x^2 + 3*x;
v = r/Sqrt[a];
With[{v = x}, Inactive[D][p[v], v]];
Activate[%];
% /. x -> v

 

 

Hello Maple primers

I am trying to do a coordinate transformation which involves a number of partial derivatives. I turned to the PDETools[dchange] to accomplish this but it will just return 0 when run through.

The problem is as such. First two functions are defined which contain a lot of "stuff". Then the forward and reverse transformations are defined between the coordinates; and finally the transformation is done.

   del_1:=Diff(Y,r1,r1)+2/r1*(Diff(Y,r1)) + Diff(Y,r2,r2)+2/r2*(Diff(Y,r2))+2*(Diff(Y,r3,r3))+4/r3*(Diff(Y,r3))+((r1^2-r2^2+r3^2)/(r1*r3))*(Diff(Y,r1,r3))+(r2^2-r1^2+r3^2)/(r2*r3)*(Diff(Y,r2,r3)):

   del_2:=Diff(Y,r1,r1)+2/r1*(Diff(Y,r1))+(r1^2-r2^2+r3^2)/(r1*r3)*Diff(Y,r1,r3)+Diff(Y,r2,r2)+2/r2*(Diff(Y,r2))+(-r1^2+r2^2+r3^2)/(r2*r3)*(Diff(Y,r2,r3))+4/r3*(Diff(Y,r3))+2*(Diff(Y,r3,r3)):

#Forward transformation

R1:=0.5*(v)+0.25*(w):
R2:=0.5*(u)+0.25*(w):
R3:=0.5*(u)+0.5*(v):

tr:={r1=R1,r2=R2,r3=R3}:

#Reverse transformation
rR1:=(-r1+r2+r3):
rR2:=(r1-r2+r3):
rR3:=2*(r1+r2-r3):

rtr:={u=rR1,v=rR2,w=rR3}:
nv:={u,v,w}:
AA:=simplify(del_1+del_2);
PDEtools[dchange](tr,AA,nv,rtr);

This will return zero. Is there something obvious I am missing here? I have used the dchange tool before in a similar manner and it has worked without issue.

I have a system of equations in several variables and I just need one numerical solution of it, I tryed to use fsolve of Maple but it always show me some errors or gives back the command as the output.

aaghulu := {-6-4*y-x-(1+y)*x+sqrt((4*(1+y))*(2+x)*(4+2*y+x)+(-(1+y)*x+2+x)^2), (2*(4+2*y+x))*(1+y)-(1+y)*x+2+x+sqrt((4*(1+y))*(2+x)*(4+2*y+x)+(-(1+y)*x+2+x)^2)-(2+y)*(-(1+y)*x+2+x+sqrt((4*(1+y))*(2+x)*(4+2*y+x)+(-(1+y)*x+2+x)^2))};

fsolve(aaghulu, {x, y}, maxsols = 1);

 

I will be happy if someone guide me how to do these kinds of things using Maple.

Using worksheet, in 2015. I have an execution group, such as

>....code
....
...

>... another execution group

 

And want to copy all the code from the first group, using the mouse. Is there another way, other than having to move the mouse by hand and select all the code in order to copy it?  In Mathematica, I can right-click on the cell edge, and select copy. This copies the cell to the buffer, then one can paste the code somewhere else. In Maple, I could not duplicate this behaviour which is annoying when one wants to copy large amount of code.

I found that if I put the code in a "code edit region", ie., do insert->code edit region, then right-click inside the small window of the code edit region, the copy is enabled, so I can copy the whole region without manually select it first.

But this does not work outside the code edit region.

This is a stripped down example of something I've been doing. Basically I'm building matrices which I then, using unapply, convert into functions of some variables of t.
.... but found that simplify seems to often not work as i'd wish.
 

restart:
mm:=Matrix([[cos(sqrt(g__1^2)*t), (-I*g__1*sin(sqrt(g__1^2)*t))*(1/sqrt(g__1^2))], [(-I*g__1*sin(sqrt(g__1^2)*t))*(1/sqrt(g__1^2)) ,cos(sqrt(g__1^2)*t)]]);

#great - simplifies as i'd expect:
simplify(mm) assuming g__1::positive;

Do the same thing but when matrix is a function of t
mmFun:=unapply(mm, t);

#the function works - gives what i'd expect
mmFun(3); mmFun(t);

#but now the simplification does not work - why the g__1 in the argument of cos does not get properly simplified?
simplify(mmFun(t)) assuming g__1::positive;

Any ideas if this is a bug? I'm using maple 2015.2 on linux 64-bit.

here is the worksheet: simplify_issue.mw

thanks

EDIT:

as a side note once can sometimes overcome this with mapping simplify  as in :

map(simplify, resultMatrix ) assuming g__1::positive;

but this is not optimal, and sometimes does not work when i first multiply the matrix by say a vector.

 

 

 

Hi all

Assume that we have folowings:

Assume that we devide [0,1] to N subintervals and in each subinterval we have:

Also we want to approximate arbitrary function x(t) with following manner:

 

How can we produce these basic polynomials?

Thanks in advance

 

Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department

Hello,

I would like to create a function from an equation.
I have define 4 functions u[1](t), ..., u[4](t).
From these 4 functions, I would like to define 4 equations. I would like to obtain this result:
Equ[1]:=u[1](t)=L/2*cos(w*t+phi[1])
Equ[2]:=u[2](t)=L/2*cos(w*t+phi[2])
Equ[3]:=u[3](t)=L/2*cos(w*t+phi[3])
Equ[4]:=u[4](t)=L/2*cos(w*t+phi[4])

My code is the following:

for i to 4
do
u[i]:=unapply(L/2*cos(w*t+phi[i]),t);
Equ[i]:='u[i](t)'=u[i](t);
end do;

These lines are not working because the left member is not incremented (u[i](t) stays at each iteration u[i](t))

Generally, how can I transform a function to an equation ?
And, in this specific case, how can I obtain the four equations mentioned above ?

Thanks a lot for your help.

 

Hello,

I would like to plot a vertical line each time my function is null and is increasing.

Here an extract of my code:

v:=unapply(H*sin(w*t),t);
L:=0.080;
H:=0.020;
Vf:=0.3;
w:=10;
fsolve(v(t)=0,t=0.5..2);
zeros:=Roots(v(t),t=0.5..2);

vdot:=unapply(diff(v(t),t),t);
map(vdot,zeros);
LignesVerticales=implicitplot(x=To complete, colour=yellow,linestyle=3, thickness=2):

With Roots function, I could obtain the zero-crossings.

With the derative of the functions, I could obtain a vector which gives me when the derivative is positive or not.

I would like now to obtain the list of the zero-crossing values which are increasing but I have difficulties to obtain it. 

By list manipulation, it should be easy to do. 

May you help to plot obtain this list so that I can plot the desired vertical lines?

Thank you for your help

Hello,

I would like to obtain all the solutions of a equation.

Here an extract of my code:

v:=unapply(H*sin(w*t),t);
L:=0.080;
H:=0.020;
Vf:=0.3;
w:=10;
fsolve(v(t)=0,t=0.5..2);

How can I do to obtain all the solutions of the equation in the wanted interval ?

I'm not fixed to use fsolve function.

Thank you for your help

Hello
I need to plot this region :

 Can anyone explain me how to use the next feature that you can find in ?dsolve,numeric,events,Round-off and simple triggers or refer me to a previous answer that explain this:

   This is primarily desired to be able to apply events for an ODE system that has been separated into disjoint cases dependent on the values of particular triggers (in which case you always want to use a form that provides the values just past the trigger point).

 Specially how to separate the ODE system into disjoint cases. Thanks in advanced.

Hello all,

I am trying to create a matrix throgh a procedure but unfortunately I could not find how to define an empty matrix in Maple. This is how my procedure looks like,

Initial_Matrix := proc (BC::list, n, BP::list)
local M::Matrix, i;
M:=[][];
for i from 1 to numelems(BC) do
M:= <M,function_coeffs(BC[i], n, BP)>;
end do;

where the procedure function_coeffs returns a row vector. Logically, it should keep adding rows function_coeffs(BC[i], n, BP) to the emty matrix, but its not happening. Please help me out.

Thank you for your time.

Is there a help page which explains why braces provide the partial text evaluation in this code?

RopeLen := 30;RopeAddLen := .5;

plots[textplot]([1, 1, typeset("%1", (({(1/2)*RopeLen}+{(1/2)*RopeAddLen})^2-{(1/2)*RopeLen}^2)^(1/2))])

First 1175 1176 1177 1178 1179 1180 1181 Last Page 1177 of 2428