reemeaaaah

90 Reputation

7 Badges

14 years, 293 days

MaplePrimes Activity


These are questions asked by reemeaaaah

Hello,

I am solving eq1 and then plot it using odeplot. Then I am extracting data from odeplot using op[1,1]. From that I only care about  one point so I am using pt[1] := dt[1]([1, 2]); then I ploted it using pointplot. I run a do loop and at the end I am ploting all the points.

My code works fine but I am trying to have a line contacting each points. I tried  style=line but it did not work.

How can I have a line contacting each points on my final plot (which is display([pl[1], seq(allpl[k], k = 1 .. 3)])) ?

This is my code:

> restart; with(DEtools); with(plots);
> with(DEtools); with(plots);
> A := 0.2e-1; B := 10^(-5); k := 0;
> eq1 := diff(X(t), t) = -(A+B*X(t))*X(t);

> ic[1] := X(365*k) = 1000;
> s[1] := dsolve({eq1, ic[1]}, X(t), range = 0 .. .365, numeric);
> p[1] := odeplot(s[1], [[t, X(t)]], t = 0 .. .365);
> dt[1] := op([1, 1], p[1]);
> pt[1] := dt[1]([1, 2]);
> pl[1] := pointplot(pt[1], axes = boxed);
> for k to 3 do
tk := 365*k;
A := rhs(s[k](tk)[2]);
ic[k+1] := X(tk) = 500.*A;
s[k+1] := dsolve({eq1, ic[k+1]}, X(t), range = tk .. 2*tk, numeric);
p[k+1] := odeplot(s[k+1], [[t, X(t)]], t = tk .. 2*tk);
dt[k+1] := op([1, 1], p[k+1]);
pt[k+1] := dt[k+1]([1, 2]);
pl[k+1] := pointplot(pt[k+1], axes = boxed);
allpl[k] := display([pl[k+1]])
end do;
> display([pl[1], seq(allpl[k], k = 1 .. 3)]);

 

Thank you

 

Hello,

I am trying to modify Maple code so I have a vertical spring with a mass starting at (0,0). The spring with the mass should move right and left along x. My vertical spring move up instead of down while the mass move to the right .

Any Idea about how I can get the right movement of the spring?

 

Please ignore the equation eq since I am only trying to have an animation spring with a mass.

 Thank you

Hello

I am solving an equation that has two piecewise functions on it. It seems that Maple ignore the second piecewise. If I include it or remove it  I will get the same solution. I tried to fix the problem but still cannot figure out why Maple ignores it.

 

This is Maple code:

restart;

with(plots);

with(DEtools);

eq := diff(x(t), t) = -piecewise(abs(x(t))-.5 > 0, abs(x(t))-.5, 0)-piecewise(0 > x(t) and x(t) > 1, 0, x(t) > 1, 1);

Hello,

After we solved two equations we want to plot them with two sliders. I am trying to have two sliders for k and mu. I followed what this link suggested:

http://www.mapleprimes.com/questions/119732-How-To-Code-Sliders-To-Make-It-Easy

But I get this warning:

Warning, `p1` is implicitly declared local to procedure `myplot`
 

Hello

I am trying to plot solution of ode0 together with the maximum and minimum values but I am having difficulty since the first plot is a solution and second is values. I should have a plot with two line one represent the solution of ode0 and second (the max an min). Any advise or suggestion?

This is the code:

> restart;
with(DEtools); with(plots); Nsols := 5; Ntstep := 10;
 k := 0; A := 0.37e-1; B := 0.2e-6;
ode0 := diff(U(t), t) = -(A+B*U(t))*U(t);

1 2 3 4 Page 2 of 4