Bendesarts

440 Reputation

10 Badges

14 years, 277 days

MaplePrimes Activity


These are questions asked by Bendesarts

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

Hello,

I have many tests to conduct on a MapleSim model. At each test simulations, I would like to change slightly some parameters.

As I have many tests to do (with different parameters), I would like to use a script so as to do like this :

Parameters test1
Launch MapleSim simulation
Store results of test 1

And so on ...

How can I do this kind of script ?

Is it possible to store the 3D animation results ?

Thank you for your help.

 

Hello,

I have an non coupled non linear oscillator.

I notice that, if I try to plot for a time too big, my plot doesn't converge anymore and didn't keep an elliptic trajectory. In other words, the plot didn't stay in the limit cycle.

Do you know why, if tmax is too big, the solution is no longer stable ? Do you have ideas so that I can keep a stable limit cycle even if I increase tmax ?

My code is the following :

r:=sqrt((x(t)/a)^2+(z(t)/b)^2);
eqx:=diff(x(t),t)=alpha*(1-r^2)*x(t)+w*a/b*z(t);
eqz:=diff(z(t),t)=beta*(1-r^2)*z(t)-w*b/a*x(t);
EqSys:=[eqx,eqz];

params := alpha=1, beta=1, a=0.4, b=0.2, w=1;

EqSys := eval([eqx,eqz], [params]);
xmax := 0.8; zmax := 0.4;
tmax := 400;
ic:=[x(0)=0.4, z(0)=0];
DEplot(EqSys, [x(t),z(t)], t= 0..tmax, [ic],linecolor=black, thickness=1,x(t)=-xmax..xmax, z(t)=-zmax..zmax, scaling=constrained,arrows=none);

Thanks a lot for your help.

Hello,

I would like to plot an non coupled non linear oscillator.

The equations are the following:

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

My parameters are the following:

paramsGeo:=L=0.015,H=0.015,beta=0.5,Vf=0.3;
omegaS:=eval(Pi*Vf/L, [paramsGeo]);
paramsCycle:=omega[s]=omegaS,Au=1,Av=1,b=100;
params:=paramsGeo,paramsCycle;

I'm not sure with my initial equations. But, may be it is possible to start with:

ic:=[u[1](0)=0.8, v[1](0)=0,u[2](0)=0.8, v[2](0)=0,u[3](0)=0.8, v[3](0)=0,u[4](0)=0.8, v[4](0)=0];

For these equations, I would like to obtain the following plots:
- plot 1: horizontal axis : u[1](t) vertical axis : v[1](t).
- plot 2: horizontal axis : u[2](t) vertical axis : v[2](t).
- plot 3: horizontal axis : u[3](t) vertical axis : v[3](t).
- plot 4: horizontal axis : u[4](t) vertical axis : v[4](t).
- plot 5: horizontal axis : t, vertical axis : v[1](t), v[2](t), v[3](t), v[4](t).

For this last plot, I would like to obtain this kind of curve:

I image that since my equations are coupled i can not use directly use Deplot function but Dsolve.

May you help me for defining a good syntax for solving my system and then deducing the following plots?

Thanks a lot for your help

Hello,

I have a matrix K.

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

I would like to program this operation :

May you help me to code this operation?

Thanks a lot for your help

First 15 16 17 18 19 20 21 Last Page 17 of 33