## plot 2 functions versus each other...

Hello every body i need help with my program. how can i plot r&s versus each other?

 >
 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 (6)
 >
 (7)
 >

 >
 >
 >
 >
 >
 >
 >

 >

## how to buildsym in this case?...

with(DEtools, buildsym, equinv, symtest):
ans := dsolve([eq2,eq3,eq4], Lie);
Error, (in dsolve) too many arguments; some or all of the following are wrong: [{a(t), b(t), c(t)}, Lie]

ans := dsolve([eq2+eq3+eq4 = exp(t)], Lie);
Error, (in PDEtools/sdsolve) too many arguments; some or all of the following are wrong: [{a(t), b(t), c(t)}, Lie]

ans := dsolve([eq2,eq3,eq4]);
sym2 := buildsym(ans);
Error, (in buildsym) invalid input: `ODEtools/buildsym` expects its 1st argument, sol, to be of type {algebraic, algebraic = algebraic}, but received [{c(t) = ...}, {b(t) = ...}, {a(t) = ...)}]

PDEtools[declare](a(t), b(t), c(t), prime = t):
symgen(eq2+eq3+eq4=0);
a(t) will now be displayed as a
b(t) will now be displayed as b
c(t) will now be displayed as c
derivatives with respect to t of functions of one variable will now be
displayed with 'symgen(....)'

update
if it can not do for 3 function a(t),b(t),c(t) system of differential equations
then

i change to use
eq2 := subs(b(t)=a(t),subs(c(t)=a(t),eq2));
eq3 := subs(b(t)=a(t),subs(c(t)=a(t),eq3));
eq4 := subs(b(t)=a(t),subs(c(t)=a(t),eq4));

with(DEtools, buildsym, equinv, symtest):
ans := dsolve(eq2 = 0, Lie);
buildsym(ans[1], a(t));
buildsym(ans[2], a(t));
buildsym(ans[3], a(t));

there are 3 answers, can i use one of it to recover the equation eq2 or  eq3 or eq4?

ans := dsolve(eq3=0, Lie);
buildsym(ans[1], a(t));
sym2 := buildsym(ans[2], a(t));
buildsym(ans[3], a(t));

sym := [_xi=rhs(sym2[2]),_eta=rhs(sym2[1])];
ODE := equinv(sym, a(t));
eq3 - ODE;
sym := [_xi=rhs(sym2[1]),_eta=rhs(sym2[2])];
ODE := equinv(sym, a(t));
eq3 - ODE;
but ODE is not equal to original eq3
ans := dsolve(eq4=0, Lie);
buildsym(ans[1], a(t));
buildsym(ans[2], a(t));

ans := dsolve(eq2+eq3+eq4=0, Lie);
sym := buildsym(ans[1], a(t));
ODE := equinv(sym, a(t));
eq2+eq3+eq4 - ODE;
sym := buildsym(ans[2], a(t));
ODE := equinv(sym, a(t));
eq2+eq3+eq4 - ODE;
sym := buildsym(ans[3], a(t));
ODE := equinv(sym, a(t));
simplify(eq2+eq3+eq4 - - ODE);

can not recover the original result

## How to draw a plot in my situation?...

Hi! I have the system of differential equations

restart; with(plots); with(DEtools);

a := 1;

deq1 := u(s)*(diff(varphi(s), s, s))+2*(diff(u(s), s))*(diff(varphi(s), s))+sin(varphi(s)) = 0;

deq2 := diff(u(s), s, s)-u(s)*(diff(varphi(s), s))^2-cos(varphi(s))+a*(u(s)-1) = 0;

sol := dsolve({deq1, deq2, u(0) = 1, varphi(0) = (1/4)*Pi, (D(u))(0) = 0, (D(varphi))(0) = 0}, {u(s), varphi(s)}, numeric)

which is perfectly solved, but I need to convert it to Cartesian coordinates and draw a plot, so what I tried is

x := u(s)*sin(varphi(s));

y := -u(s)*cos(varphi(s));

plot([x, y, s = 0 .. 20])

But I'm getting an error "Warning, expecting only range variable s in expressions [u(s)*sin(varphi(s)), -u(s)*cos(varphi(s))] to be plotted but found names [u, varphi]"

I don't know why is this happens if I have a solution. For example, I can get solution for 2 seconds:

sol(2)

[s = 2., u(s) = 2.33095721668252, diff(u(s), s) = 1.02513293353371, varphi(s) = .213677391510693, diff(varphi(s), s) = -.242430995691885]

## struggling to use DEplot with a system of 4 differ...

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

## DEplot - Error, (in DEtools/DEplot) vars must be d...

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

## plot a phaseplane with detools...

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.

## Asterisk tickmarks in DEplot...

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^`&ast;`]]

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

## Error, extra unknowns found: x ...

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)

## How to use generate_ic for this case?...

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]

## Error in DEtools/phaseportrait...

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

## Polarplot3d of ODE system solution...

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.

## How to produce dfieldplot?...

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]);

## Solving a pde system...

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 :-/

## Poincare Sections...

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

## DE problems with dsolve, numeric and a division b...

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

 1 2 Page 1 of 2
﻿