Rouben Rostamian

MaplePrimes Activity


These are answers submitted by Rouben Rostamian

General advice: If you are having difficulty with a complex problem, see if you can do a simpler problem first.

So forget about your F_T for the moment.  Do you know how to work with your Esolve()?

For that, examine what Esolve() does, and what its parameters are.

We see that Esolve() is designed to solve a system of differential equations of the form dy/dx = f(y,x) for the unknown vector-valued function y(x).

The intial condition is y(x0) = y0.

The solution is produced by taking N steps of stepsize h.

You are interested in solving a problem of the type dv/dt = F(v,t).  Thus, your v and t correspond to Esolve()'s y and x, respectively.

Let's give it a try with a function f which takes a vector <v[1], v[2]> as argument and returns the vector <-v[2],v[1]>.  Thus, in Maple we set:

f := v -> <-v[2], v[1]>;

For the initial value pick v(0) = <1,0>.  Now solve with stepsize h = 0.1 and take 25 steps:

sol := Esolve(f, 0.1, 0, <1,0>, 25);

Plot the solution, that is, v(t) versus t:

plots:-pointplot([seq(sol[i], i=0..25)], scaling=constrained, color=red, connect=true);

See if you can take it up from there.

This solution is obtained by eyeballing the figure, not through any algorithm:

Replace 1 with 1.0001 in the square root:

plots:-shadebetween(2,1/sqrt(1.0001-x^2), x=0..sqrt(3)/2);

That looks like a bug to me.  I suggest that you report it.

In the meanwhile, you may get the desired plot by "cheating" as follows.  Exchange the x and y axes temporarilty, and plot whatever you want "sideways":

plot(
  [[2, x, x=0..sqrt(3)/2],
   [1/sqrt(1-x^2), x, x=0..sqrt(3)/2]
  ], color=[red,blue], thickness=3, filled=[color=yellow]);    p := %:

Then apply plottools:-transform() to restore the x and y axes to their standard positions:

plottools:-transform((x,y)->[y,x])(p);

Producing a plot of that motion is quite trivial in Maple, and it is quite likely that that several people will show you how.  However, since you are taking a course in advanced dynamics, I think you will benefit from figuring this out in your head.  I suggest that you begin with simpler problems.

  1. What does the motion

    r(t) = cos(ωt) i + sin(ωt) j

    look like?  If you don't see that, then I am afraid that this is not quite the right time for advanced dynamics.

  2. What does the motion

    r(t) = (a cos(ωt))i + (b sin(ωt))j

    look like?  This is only slightly different from the previous one.

  3. Now you should be ready to answer your original question.  None of these requires help from Maple.

The equation of motion given in Peter Stone's note is not correct.  The correct equation is

(1 + f'(x)^2)*a + f'(x)*f''(x)*v^2 + g*f'(x) = 0,

where a = diff(x(t),t,t),  v = diff(x(t),t), assuming zero friction. I haven't worked out the case with nonzero friction but that should make no difference to you since you are setting the friction to zero anyway.

This is not ideal, but may be of some use to your students.

Define

    f := (r,t) -> r*exp(t/180*Pi*I):
    F := proc(z) polar(z); evalf(op(1,%)), evalf(op(2,%)*180/Pi); end proc:

Then the equivalent of your 4 < 45 + 5 < 30 = 8.9240 < 36.332 would be

    F(f(4,45) + f(5,30));
                            8.923958373, 36.66193394

And in the same vein:

    F(f(4,45) + f(5,30) - f(3,60));

                            6.282837822, 25.75811853

    F(f(4,45) * f(5,30));
                            20., 74.99999999

de := diff(y(x),x,x) + y(x) = sin(x);

eval(de, y(x)=sin(x));

I see that you have posted an answer to your own question.  In the meantime I came up with my own solution which, in retrospect, is very similar to yours, but perhaps a little more organized.  Here it is  mw.mw for whatever it's worth.

with(LinearAlgebra):
A := Matrix(3,3, symbol=a);
B := Matrix(3,3, symbol=b);
M1 := DiagonalMatrix([A,0,0]);
M2 := DiagonalMatrix([0,0,B]);
M := M1 + M2;
 

You have posted an image of your expression.  It would have been helpful to post a real expression which I could copy and paste on my Maple worksheet.  Not having access to that expressions, I will attempt to sketch the idea of a solution.

  1. Generate a sequence of coefficients, such as u*u_xx, etc., which you are interested in:
        C := seq(seq(seq(u^k*diff(u(x,y), [x$i], [y$j]), i=0..2-j), j=0..2), k=0..2);
    Adjust as needed.
  2. Let's say your expression is called expr.  Do:
        coeffs(expr, [C], 'terms');
    This will return the the sequence of coefficients you are looking for.  The variable terms will contain the terms from which the coefficients were extracted.

 

For a similar question, see here.

Short answer:

f := x -> 9*surd(x, 3) + 9/2*x*surd(x,3);

pdsolve is for solving partial differential equations. Yours are ordinary differential equations, so use dsolve instead, as in:

de := diff(f1(t),t) = f2(t),  diff(f2(t),t) = -f2(t);

ic := f1(1)=0, f2(0)=1;

dsolve({de, ic});

plots:-polarplot(tan(t)/cos(t), t=-Pi/3..Pi/3);

with(plots):

x  := [0., .20, .40, .60, .80, 1.0]:
y1 := [0., .20, .40, .60, .80, 1.0]:
y2 := [0., .64, .96, .96, .64, 0.]:

display([
  pointplot(x,y1, connect=true),
  pointplot(x,y2, connect=true)
]);

First 50 51 52 53 54 55 56 Page 52 of 58