Rouben Rostamian

MaplePrimes Activity


These are replies submitted by Rouben Rostamian

I copied and pasted your code to a Maple worksheet and it worked fine for me.  Add the missing semicolon at the end of the display(P) command and try again.

Aside: Your subject line says "plot using loop" but there is no loop in the code that you have shown.  Perhaps you meant to ask for something else.

@Carl Love Thank your very much for your thorough analysis of the issue.  I have a better understanding of the evaluation rules now after reading the rtable_eval help page.  As you have noted, it does not quite explain the reason for the different outputs of Maple 11 and Maple 2015, especially considering that the rtable_eval help page is virtually identical between the two versions.  I am content with regarding the different behaviors as not a bug but an incompatibility.

@Mac Dude I agree with you -- the 2D math is quite useful for documentation, and I use it that way quite often.  In my remarks on the uselessness of the 2D math I was thinking of 2D math for computation.

@nm You wrote: If Maplesoft is determined to make less and less people use Maple, they are really doing a very good job at it. 

I agree.  I have no idea whom the 2D input is targetted to.  It may appeal to high school students, but I doubt that high school students form a large subset of Maple users.

What is worse, the beginner is more confused than helped by the 2D input, as a plethora of questions in this forum demonstrates.  Hobbling the beginner with the arcane intricacies of the useless 2D input is a disservice.

It seems to me that the vast majority of regular Maple users prefer the 1D input.  I think it will be an improvement if Maplesoft makes the 1D input the default and focuses on 1D in help pages and presentations.  If someone at Maplesoft is overlyl enamored with the 2D input, he may consider keeping it on the side, and out of the way, as a weird curio.

@Kitonum You are right; my z was not as it was supposed to be.  I was careless.

It would help if you explain why are you interested in these equations.  The first one is partial differential equation in the unknown M(a,b).  (The c enters the equation as a parameter, so writing M(a,b,c) is somewhat misleading.)  You need to supply initial and/or boundary conditions to obtain a well-posed problem.

The second equation is an ordinary differential equation in the two unknowns a(t) and b(t).  You need to supply a second differential equation in the unknowns a(t) and b(t) in order to form a well-posed system of two equations in two unknowns.

The question is a bit muddy, especially in view of your comment at the end of the worksheet where you write:

In what way is that a "solution"?  The solution of you system of ODEs should be something like

     u(y) = some function of y

theta(y) = some function of y

What you have shown is nothing like that.  Perhaps you are looking for something else?

 

 

Posting a picture of your equations is not very productive.  I have a couple of ideas toward the solution but I am surely not going to retype your equations.

Consider uploading a maple worksheet so that people can work with it.  Look for the large green up-arrow in the screen where you post/edit your question.

In the mean time, you should also think about the following:

  1.  You say the derivatives of u are small.  What about u itself?  Is it small as well?  (I am writing u for your uu0 for simplicity.)
  2.  You say beta is small.  Are the derivatives of beta small as well?  Note that a function may be small but its derivative may be quite large;  think of y(x) = 1/k *  sin(k^2*x) when k is large.
  3. How does the smallness of beta compare to the smallness of u?  Suppose the smallness is measured by a small number, let's say h.  Compare the case when
        u = u0 + h*u1,   beta = beta0 + h*beta1,
    versus
        u = u0 + h*u1,   beta = beta0 + h^2*beta1.
    These will lead to two different linearizations in general.

@acer I did not know about Explore, I am sure it will come in handy for me in the future.  That's the sort of thing I had in mind when I referred to Maplets.

@Kitonum That's nice.  I should remember to say "uses" instead of with(...) in my procs.

@brian bovril Suppose that a point moves on the plane so that its polar coordinates are (r(t)),θ(t)).  Then its Cartesian coordinates are x = r cos θ, y = r sin θ, whence its velocity components are

  x' = r' cos θ - r θ' sin θ,
  y' = r' sin θ + r θ' cos θ.

were x' means dx/dt, etc.  Squaring and adding up we get x'^2 + y'^2 = r'^2 + r^2 θ'^2.

As to our pirate ship, we have x'^2 + y'^2 = V^2, and  r(t) = v t. therefore  V^2 = v^2 + v^2  t^2 θ'^2, as asserted.

Regarding animation, Kitonum and acer have posted nice responses although those do not quite parallel the mathematical details of the solution that I had posted.   Here is how I did my animation.  (I have added markers for the ships following Kitonum's idea.)  This one may be easier to follow if you want to match with my explanation.

restart;
with(plots):
pirate_pursuit := proc(V, v, L, a, nframes)
  local b, T, t_capture, P_r, P_a, M_r, M_a, frames;

  T := L/(V+v);
  b := t -> sqrt((V/v)^2-1) * ln((V+v)/L*t);
  t_capture := solve(b(t)=a, t);

  # pirate's polar radius and polar angle as functions of time
  P_r := unapply(piecewise(t < T, L - V*t, v*t), t);
  P_a := unapply(piecewise(t < T, 0, b(t)), t);

  # merchant's polar radius and polar angle as functions of time
  M_r := t -> v*t;
  M_a := t -> a;

  # animation frames
  frames := seq(
    display([
      plot([P_r(s), P_a(s), s=0..t], coords=polar, color=red, thickness=5),
      plot([M_r(s), M_a(s), s=0..t], coords=polar, color=blue, thickness=5),
      pointplot([[P_r(t), P_a(t)], [M_r(t), M_a(t)]],
        coords=polar, color=[red,blue ], symbol=solidcircle, symbolsize=30)
    ]) , t=0.. evalf(t_capture), evalf(t_capture/(nframes-1)));

  # animate the paths of the two ships:
  display([frames], insequence, scaling=constrained, axes=normal);

end proc:

# do a demo:
pirate_pursuit(3, 1, 1, 2*Pi-Pi/4, 50);

@gkokovidis The article you have cited is unrelated to the problem at hand.  That article assumes that the persuer can see the persued at all times.  In our problem the persued disappears in the fog.  A different strategy is required.

@wolverine Yes, that is a terrible mistake -- there are no t1 and t2 in your worksheet.

Since you haven't used any words to explain what it is that you want, I am attempting a guess here in total darknes.

restart;

de := diff(y(t),t,t) - e*(1-y(t)^2)*diff(y(t),t) + y(t) = 0;

de1 := subs(y(t) = eta[0](t) + e*eta[1](t), de);

de2 := collect(de1, e);

coeff(lhs(de2), e, 0) = 0;

coeff(lhs(de2), e, 1) = 0;

@Markiyan Hirnyk Acer's post shows much more than just Maple skills.  There is a darn good deal of mathematical inventiveness there.  Same goes for Axel's approach.

First 89 90 91 92 93 94 95 Last Page 91 of 99