Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi,

 

  I think similar question has been asked by several people, but I did not find a suitable thread. My question is, suppose I have a probablity distirubtion function like

  p(x,y) = exp(-alpha (x+y) ) x^2 y^2 / |x-y|  , alpha>0

 x,y goes from - \infty to + \infty. This function is normalizable but unbounded, which makes the rejection algorithm a bit difficult(?).

 

  How to generate samping points from this type of probability distribution function?

 

Thank you very much!

 

Hello,

I would like to plot gait diagrams (the lines you can see on the picture belowà from the solutions obtained with a NL oscillator (composed with 8 coupled odes). Here the result that I would like to obtain.

Initial plot:

 

Desired plot

 

 

I would like to obtain 4 lines corresponding to the 4 elliptic trajectories obtained with the NL oscillator. The four lines should be done like this. When the trajectory is above 0, the line should be colored in green. When the trajectory is below 0, the line should be colored in black. 

May you help me to define this kind of graph called gait diagrams from the solution of the NL oscillator ?

Here you can find my maple code:

K:=Matrix([<0, -1, 1, -1>,<-1, 0, -1, 1>,<-1, 1, 0,-1>,<1, -1, -1,0>]);

for i to 4
do
r[i]:=sqrt((u[i](t))^2+(v[i](t))^2):
omega[i]:=omega[sw]/(1+exp(b*v[i](t)))+omega[st]/(1+exp(-b*v[i](t))):
Equ[i]:=diff(u[i](t),t)=Au*(1-r[i]^2)*u[i](t)-omega[i]*v[i](t):
Eqv[i]:=diff(v[i](t),t)=Av*(1-r[i]^2)*v[i](t)+omega[i]*u[i](t)+MatrixVectorMultiply(K,<seq(v[i](t),i=1..4)>)[i]:
EqSys[i]:=[Equ[i],Eqv[i]]:
end do:

paramsCycle:=omega[st]=4*2*Pi,omega[sw]=2*Pi,Au=5,Av=50,b=100;
params:=paramsCycle;

Differential system 
sys:=map(op,eval([seq(EqSys[i],i=1..4)],[params]));
ic:=[u[1](0)=0, v[1](0)=0,u[2](0)=0, v[2](0)=-0.1,u[3](0)=0, v[3](0)=0.1,u[4](0)=0, v[4](0)=0.1];
Résolution1
res:=dsolve([sys[],ic[]],numeric):
Initial boundaries
tcalc:=4;
ic2:=[seq(u[i](0)=eval(u[i](t), res(tcalc)),i=1..4),seq(v[i](0)=eval(v[i](t), res(tcalc)),i=1..4)];
Résolution2
res:=dsolve([sys[],ic2[]],numeric):

tmax:= 40:
numpts:=100*tmax:
plots:-odeplot(res,[t,v[1](t)],0..tmax,thickness=2, view=[0..5, -1.5..1.5],numpoints = numpts);
plots:-odeplot(res,[t,v[2](t)],0..tmax,thickness=2, view=[0..5, -1.5..1.5],numpoints = numpts);
plots:-odeplot(res,[t,v[3](t)],0..tmax,thickness=2, view=[0..5, -1.5..1.5],numpoints = numpts);
plots:-odeplot(res,[t,v[4](t)],0..tmax,thickness=2, view=[0..5, -1.5..1.5],numpoints = numpts);
plots:-odeplot(res,[seq([t,v[i](t)+i*5],i=1..4)],0..tmax,thickness=2,view=[0..5,0..25], numpoints = numpts);

Thanks a lot for your help

HI, I am trying to solve two PDEs but in boundry conditions there is arising an error plz help.
Nazi.mw

Hi,

I recently noticed that Maple 2015 has become irresponsive on mac (macbook pro) with the latest java release (Java 8 update 66). Did anywone experience the same problem ?

Hi,

I have a first order differential eq. for some variable say $r(x)$, where $x$ is the independent variable.

After solving this differential equation numerically, I want to use its solution in other expression for $r(x)$ and plot the expession with $x$.

Please let me know how to do it.

Thanks in advance.

 

 

hi.for linear coupling equation

dsys3 := {-72.49829200*(diff(f1(x), x, x))+0.8377580411e-2*(diff(f2(x), x))-8.873545400*10^9*(diff(f3(x), x))+2.114533515*10^18*f1(x), -878.8477313*(diff(f2(x), x, x))+1.590065471*10^20*f2(x)-7.353421206*10^(-26)*(diff(f3(x), x, x))+4.891459762*10^10*f3(x), 4.027667395*10^(-20)*(diff(f3(x), x, x, x, x))-0.6274394007e-2*(diff(f3(x), x, x))+8.873545401*10^9*(diff(f1(x), x))-7.352113720*10^(-26)*(diff(f2(x), x, x))+4.904509456*10^10*f2(x)+1.208381068*10^19*f3(x)-2.499990383*10^26*omega*(diff(f3(x), x, x))}

by assuming and to expand these functions(f1-f2-f3) in polynomial form(e.g. Chebyshev, power polynomials, Legendre and etc).:

f1(x):=(&sum;)H[i] *(e)^(lambda[i] *x); f2(x):=(&sum;)alpha[i]*H[i] *(e)^(lambda[i] *x);f3(x):=(&sum;)GAMMA[i]*H[i] *(e)^(lambda[i] *x)

 

how i detemine lambda[i] which are roots of the  characteristic equations?in other word how i can build characteristic relation for coupling equation?

2)how i can gain value for alpha[i] and GAMMA[i]

by using equation

Q1 := subs(x = 0, sum(H[i]*exp(lambda[i]*x), i = 1 .. 8)); Q2 := subs(x = L, sum(H[i]*exp(lambda[i]*x), i = 1 .. 8)); Q3 := subs(x = 0, sum(alpha[i]*H[i]*exp(lambda[i]*x), i = 1 .. 8)); Q4 := subs(x = L, sum(alpha[i]*H[i]*exp(lambda[i]*x), i = 1 .. 8)); Q5 := subs(x = 0, sum(GAMMA[i]*H[i]*exp(lambda[i]*x), i = 1 .. 8)); Q6 := subs(x = L, sum(GAMMA[i]*H[i]*exp(lambda[i]*x), i = 1 .. 8)); M := diff(sum(GAMMA[i]*H[i]*exp(lambda[i]*x), i = 1 .. 8), x); Q7 := subs(x = 0, M); Q8 := subs(x = L, M)

????

thanks...

 

chebyshev.mw

I downloaded Maple Player, and I don't know how can I use it resolve Maths problems. Kindly, could you explain to me the procedure I shall follow for the reason to use it?

 

Qu_in_maple.mw

How to compute the  n component of U[i] even to reach the exact solution?

 

``

k := proc (t) options operator, arrow; t end proc:

U[0] := f(x):

for i to N do U1[i-1] := subs(x = t, U[i-1]); U[i] := (1/2)*x^2*(int(t*U1[i-1], t = a .. b)) end do:

Parse:-ConvertTo1D, "first argument to _Inert_ASSIGN must be assignable"

cos(x)+x^2+(1/2)*x^2*(-2+(1/4)*Pi^4)+(1/8)*x^2*(-1+(1/8)*Pi^4)*Pi^4+(1/64)*x^2*(-1+(1/8)*Pi^4)*Pi^8

 

cos(x)+(1/512)*x^2*Pi^12

(1)

Exact := proc (x) options operator, arrow; cos(x) end proc

``

 

 

``

 

 

 

 

 

 

 

 

 

 

 

 
 

 

``

 

Download Qu_in_maple.mwQu_in_maple.mw

How to find the  n component of U[i] even to reach the Exact solution cos(x)

I am trying to solve 4 nonlinear equations for four variables using fsolve  and the output that i am getting is basically the same equations repeated after some time.  I even tried reducing one of the equations using assumptions from my side but it results in same behaviour..  Quite new to maple, would like some advice as to this behaviour. Thanks

 Here's the file

fsolve_1.mw

 

PS- using do loop is part of the solving so i cannot remove that

using FDM or FEM rather than dsolve?

ode.docxode.docx

Occasionally I have need to import 1D Maple expressions into Mathematica, because I believe mma has superior simplify functionality (sorry Maple). Mathematica has its own syntax which (of course) differs to maple.  eg sin(x) in maple is Sin[x] in mma ; ln(x)=Log[x] ;....... I'm aware of the package MmaTranslator, but I think it only converts mma to maple.

so i need some code pls.

(i have bolded the functions which need to be converted)

eg: i/p:

(1/365)*(365*B21*EP*ln(1+i)*(1+i)^B21*hr*kw*p-365*EP*hr*kw*p*(1+i)^(-1+B21)*i-365*EP*hr*kw*p*(1+i)^(-1+B21)+365*EP*hr*kw*p+SC*i)/(hr*kw*(EP*ln(1+i)*(1+i)^B21*p-FIT*i*p+cos(omega)))

o/p:

(1/365)*(365*B21*EP*Log[1+i]*(1+i)^B21*hr*kw*p-365*EP*hr*kw*p*(1+i)^(-1+B21)*i-365*EP*hr*kw*p*(1+i)^(-1+B21)+365*EP*hr*kw*p+SC*i)/(hr*kw*(EP*Log[1+i]*(1+i)^B21*p-FIT*i*p+Cos[omega]))

 

Hi,

I'm null in statistic. I'm doing a calculation to calculate a set of parameter. By example:

I have to calculate 5 parameters x1,x2,x3,x4,x5 from 7 equations f1,f2,f3,f4,f5,f6,f7. Because it is difficult to calculate directly 5 parameters, I used chisquare to minimize the difference between experimental and theorical data. Then, I can get the results. After that, I used these 5 parameters to back-calculate the data using 7 equations above. My question is about how to calculate the error bar (or standard error) of the back-calculate datato add to the plot.

Thank you  for helping me,

Best regards.

 

Hi, Im now trying to run my code. But it took like years to even getting the results. may I know any solutions on how to get faster results? Because I have run this code for almost 4 hours yet there is still 'Evaluating...' at the corner left. And when I tried to stop the program, it will stop at 'R1...'.

 

Digits := 18;
with(plots):n:=1.4: mu(eta):=(diff(U(eta),eta)^(2)+diff(V(eta),eta)^(2))^((n-1)/(2)):
Eqn1 := 2*U(eta)+(1-n)*eta*(diff(U(eta), eta))/(n+1)+diff(W(eta), eta) = 0;
Eqn2 := U(eta)^2-(V(eta)+1)^2+(W(eta)+(1-n)*eta*U(eta)/(n+1))*(diff(U(eta), eta))-mu(eta)*(diff(U(eta), eta, eta))-(diff(U(eta), eta))*(diff(mu(eta), eta)) = 0;
Eqn3 := 2*U(eta)*(V(eta)+1)+(W(eta)+(1-n)*eta*U(eta)/(n+1))*(diff(V(eta), eta))-mu(eta)*(diff(V(eta), eta, eta))-(diff(V(eta), eta))*(diff(mu(eta), eta)) = 0;
bcs1 := U(0) = 0, V(0) = 0, W(0) = 0;
bcs2 := U(4) = 0, V(4) = -1;
R1 := dsolve({Eqn1, Eqn2, Eqn3, bcs1, bcs2}, {U(eta), V(eta), W(eta)}, initmesh = 30000, output = listprocedure, numeric);
Warning, computation interrupted
for l from 0 by 2 to 4 do R1(l) end do;
plot1 := odeplot(R1, [eta, U(eta)], 0 .. 4, numpoints = 2000, color = red);

 

Thankyou in advance :)

 

i have attchassignment.mwsassignment.pdf

 

 

Hi everyone

I've come across a RAM-issue.

My program creates a lot of plots using millions of variables-values and it eats up my computers memory since I use the plots to make an animation.

The plots are simple 3d plots created using the surfdata function.

How do I save plots into a single file as the program creates them concurrently such that after the program has terminated I can use the plots to create an animation?

and how do I efficiently delete variables I dont not need anymore?

First 157 158 159 160 161 162 163 Last Page 159 of 2097