Items tagged with detools

Feed

Ive been trying to plot the following system



With these initial conditions (Also G*M=1)

ics:=[x(0)=1, y(0)=0,vx(0)=0,vy(0)=1];

I use this command to try and do this

with(DEtools):
DEplot(subs({G=1,M=1},satODE1),{x(t),y(t),vx(t),vy(t)},t=-2..2,ics,scene=[x(t),y(t)],scaling=constrained);

But I get this error message

Error, (in DEtools/DEplot/CheckInitial) too few initial conditions: [x(0) = 1]

Which I find odd because I have an initial condition for each variable

Im not sure what makes this different to other DE's Ive plotted other than having more equations in the system

 

Hello. I have a problem with DEplot and I hope someone could help me with this:

Hi,everyone!!

I want to plot a phaseplane of the following equation.

this is my code:

But,I can't get what i want. What*s wrong with my code? And how do I modify it?

Thanks you very much.

 

 

 

I am trying to use y* to label a point on the axis of a graph made with DEplot, and am currently unable to.


with(DEtools);
NLC := diff(y(t), t) = k*(Am-y(t));
Am := 20; k := .1;
ivs := [y(0) = 10, y(0) = 30, y(0) = 50];
DEplot(NLC, y(t), t = 0 .. 20, ivs, tickmarks = [default, [20 = y^`*`]], font = [default, default, 30]);

makes y`*` apear as the label, as does the code

tickmarks = [default, [20 = y^`*`]]

wheras if i remove the `` marks I get an error

 

 

 

a := 18; b := 2; c := 1; d := 1; f := 1; DEtools[phaseportrait]({diff(x(t), t) = a*x-b*exp(x)*y/(1+exp(x))-f*x*x, diff(y(t), t) = -c*y+b*exp(x)*d*y/(1+exp(x))}, [x(t), y(t)], t = 0 .. 100, {[x(0) = .1, y(0) = 18], [x(0) = .1, y(0) = 27], [x(0) = .2, y(0) = 28], [x(0) = .5, y(0) = 16], [x(0) = .6, y(0) = 14], [x(0) = .7, y(0) = 8], [x(0) = .7, y(0) = 29], [x(0) = 1.0, y(0) = 18], [x(0) = 1.0, y(0) = 22], [x(0) = 1.2, y(0) = 20], [x(0) = 1.5, y(0) = 20], [x(0) = 1.5, y(0) = 24.0], [x(0) = 1.6, y(0) = 26.0], [x(0) = 1.7, y(0) = 28], [x(0) = 1.8, y(0) = 21], [x(0) = 2.0, y(0) = 9], [x(0) = 2.0, y(0) = 28]}, x = 0 .. 2, y = 0 .. 30, dirgrid = [13, 13], stepsize = 0.5e-1, arrows = SLIM, axes = BOXED, thickness = 2)

H2 := [a(t)*(diff(c(t), t))+b(t) = 100, a(t)*(diff(b(t), t))+c(t)*(diff(b(t), t)) = exp(t), a(t)*(diff(c(t), t))+a(t)*(diff(b(t), t))+b(t) = 90];
H1 := subs([diff(a(t),t)=a1,diff(b(t),t)=b1,diff(c(t),t)=c1], H2);
H := subs([a(t)=a0, b(t)=b0, c(t)=c0], H1);
ics := generate_ic(H, {a0=-2..2, b0=-2..2, c0=-2..2,a1 = -2 .. 2, b1 = -2 .. 2, c1 = -2 .. 2, t = 0, energy = 0}, 100);

 

Error, (in generate_ic) invalid input: `DEtools/generate_ic` expects its 1st argument, H, to be of type algebraic, but received [a0*c1+b0 = 100, a0*b1+c0*b1 = exp(t), a0*c1+a0*b1+b0 = 90]

with(DEtools):
phaseportrait([secret], [a(t), b(t), c(t)], t = -2 .. 2, [[a(0) = 1, b(0) = 0, c(0) = 2]], stepsize = 0.5e-1, scene = [c(t), a(t)], linecolour = sin((1/2)*t*Pi), method = classical[foreuler]);

Error, (in DEtools/phaseportrait) the ODE system does not contain derivatives of the unknown function a

I am trying to have the output of DETOOLS as 3dpolarplot. As in the following example:

 

EF := {2*(diff(w[2](t), t)) = 10, diff(w[1](t), t) = sqrt(2/w[1](t)), diff(w[3](t), t) = 0}; with(DEtools); DEplot3d(EF, {w[1](t), w[2](t), w[3](t)}, t = 0 .. 100, [[w[1](0) = 1, w[2](0) = 0, w[3](0) = 0]], scene = [w[1](t), w[2](t), w[3](t)], stepsize = .1, orientation = [139, -106])

 

how can I get the output as a polarplot in 3d where, w[2] and w[3] have range 0..2*pi.

Please help in this respect asap.

 

 

eq2 := b(t)*(diff(c(t), t))*(diff(a(t), t))+b(t)*(diff(a(t), t))+a(t)*(diff(c(t), t));
eq3 := a(t)*(diff(b(t), t))(diff(a(t), t))+b(t)*(diff(b(t), t))*(diff(c(t), t));
eq4 := b(t)*(diff(c(t), t))(diff(b(t), t))+a(t)*(diff(b(t), t))+b(t)*(diff(c(t), t));
dfieldplot([eq2,eq3,eq4],[t,x],t=0..5,a=-5..5,b=-5..5,c=-5..5);
dfieldplot([eq2,eq3],[t,x],t=0..5,a=-5..5,b=-5..5);
eq2a := eval(subs(c(t)=exp(t), eq2));
eq3a := eval(subs(c(t)=exp(t), eq3));
eq4a := eval(subs(c(t)=exp(t), eq4));
dfieldplot([eq2a,eq3a], [a(t), b(t)], t = -5 .. 5, a = -5 .. 5, b = -5 .. 5, arrows = SLIM, color = black, dirfield = [10, 10]);

restart;

with(DETools, diff_table);

kB := 0.138064852e-22;

R := 287.058;

T := 293;

p := 101325;

rho := 0.1e-2*p/(R*T);

vr := diff_table(v_r(r, z));

vz := diff_table(v_z(r, z));

eq_r := 0 = 0;

eq_p := (vr[z]-vz[r])*vr[] = (vr[]*(vr[r, z]-vz[r, r])+vz[]*(vr[z, z]-vz[z, r]))*r;

eq_z := 0 = 0;

eq_m := r*vr[r]+r*vz[z]+vr[] = 0;

pde := {eq_m, eq_p};

IBC := {v_r(1, z) = 0, v_r(r, 0) = 0, v_z(1, z) = 0, v_z(r, 0) = r^2-1};

sol := pdsolve(pde, IBC, numeric, time = z, range = 0 .. 1);

 

what am I doing wrong?

it's telling me: Error, (in pdsolve/numeric/par_hyp) Incorrect number of boundary conditions, expected 3, got 2
but i did just as in the example :-/

I am trying to use maple to plot a poincare section for the following Hamiltonain:

H:=(1/8)*(p1^2+16*p2^2-4*p1*p2*cos(q1-q2))/(3+sin(q1-q2)^2) - cos(q2)-8cos(q1)

I've been using Maples built in command as follows:

poincare(H, t=-5000..5000, ics, stepsize = 0.1, iterations = 1, scene = [q2,p2]);

for a given set of initial conditions ics. My problem is however I need to restrict the plotting value to p1>0, as otherwise i seem to get two overlapping maps as seen below:



How exactly can i do this?
Thanks
Connor

Hello,

we have a "little" Multibody Dynamics Project in our University. We try to compute a system with 4 DOF with Lagrange. The problem is that in the end our dsolve give us an error. We checked the whole system like 5 times and searched only for the dsolve problem over 6 hours.

Error from dsolve:

"Error, (in DEtools/convertsys) numeric exception: division by zero"


This error shouldnt be possible because we have no divisions at all in our system or somekind of inifity though arctan or what ever.

Any help would be perfekt.

Thanks a lot

Wackeraf

MultibodyDynamics_Gruppe_aktuell_V3.mw

 

Dear All,

I need your help to plot the phase portrait using DEtools[DEplot]  these are the lines of the code. But when I make RUN, there is an error. I need your help to fix the error. Many thinks.

 

r1:=1; r2:=1; q2:=2; q1=0.5;  a1:=1;

Sys1 := {diff(N(t),t) = r1*N*(1-N/q1)-P*N/(1+N), diff(P(t),t) = r2*P*(exp(-a1*P)-q2)+P*N/(1+N)};

DEtools[DEplot](Sys1,[N(t),P(t)],t=-10..10,N=0..2,P=0..2);

 

Many thinks

> with(DEtools);
> L := -1.576674; MU := 0; DE13 := {(D(x))(t) = x(t)*(1+4*x(t)*x(t)-y(t)*y(t))+MU*y(t)*(x(t)*x(t)-.43*y(t)*y(t)-L), (D(y))(t) = y(t)*(1+x(t)*x(t)-.5*y(t)*y(t))+MU*x(t)*(x(t)*x(t)-.43*y(t)*y(t)-L)}; DEplot(DE13, [x(t), y(t)], t = 0 .. 20, [[x(0) = 0.1e-1, y(0) = .99], [x(0) = -.1, y(0) = -.9], [x(0) = 1.1, y(0) = 0], [x(0) = 0, y(0) = .2], [x(0) = 0, y(0) = .6], [x(0) = .6, y(0) = 0], [x(0) = .75, y(0) = 1], [x(0) = .1, y(0) = .1], [x(0) = .5, y(0) = 1.0], [x(0) = -.5, y(0) = 1], [x(0) = .5, y(0) = -1], [x(0) = -.5, y(0) = -1], [x(0) = -0.1e-1, y(0) = .99], [x(0) = 0.1e-1, y(0) = -.99], [x(0) = -0.1e-1, y(0) = -.99], [x(0) = .5, y(0) = -1], [x(0) = -.5, y(0) = -1], [x(0) = 0.1e-1, y(0) = .9]], stepsize = 0.1e-1, scene = [x(t), y(t)], title = "phaseplane 3 prime plot", linecolor = black, thickness = 1);
-1.576674
0
/ / 2 2\
{ D(x)(t) = x(t) \1 + 4 x(t) - y(t) /,
\

/ 2 2\\
D(y)(t) = y(t) \1 + x(t) - 0.5 y(t) / }
/
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of .93908020e-1, probably a singularity
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of .26367741, probably a singularity
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of .23463732, probably a singularity
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of 1.7040014, probably a singularity
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of .62484768, probably a singularity
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of .62484768, probably a singularity
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of .62484768, probably a singularity
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of .62484768, probably a singularity

 

what do i need to do so there are no more singularites?

I'm taking calculus and my professor introduced us to maple software. The professor asked us to plot the families of curves for this orthogonal equation:

dy/dx = (x^2) - (2y^2) - C = 0

This is what I had so far:

 

restart;

with(DEtools):

with(plots):

 

Function:=unapply(simplify(x^2-2y^2-C),(x,y)):

'Function'(x,y) = Function(x,y);

plotFunction:=C->implicitplot(eval(F(x,y),a=C),x=-5..5,y=5..5,scaling=constrained):

plot1:=display(seq(plotFunction(a),a=-5..5)):

display(plot1);

 

This is only display one family. How do I code for it plot the other families?

(The graph should look like curves converging from left, top and right sides toward to the origin of the axes)

Please help.

1 2 Page 1 of 2