4

In order to illustrate a Cauchy problem for first order ode with infinite family of solutions, I would plot the parametrized solution and having the possility of control the value the parameter through a slider.

To be complete the Cauchy problem is y'=sqrt(|y|), y(0)=0, and the parametric solution is y_c(x):={0, if c=>x; (x-c)^2/4, if x=>c}.
So I would get a plotting of y=y_c(x) with a slider to control the value of c.

Thank you.

agt
  • 179
  • 1
  • 6

2 Answers2

5

You can use with_slider_draw in wxMaxima to do this.

   Y(c,x) := if c>x then 0 else (x-c)^2/4;
   with_slider_draw(
       c, /* the name of the variable to attach to the slider */
       makelist(i,i,0,1,0.1), /* a list of values that the variable can have */
       explicit(Y(c,x), x, 0, 2) /* plot the function */
   )$

In wxMaxima, click on the graph and then click on the Play button on the toolbar to play the animation, or use the slider on the tool bar to change the value of c.

Fred Senese
  • 660
  • 5
  • 9
  • Dear Fred Senese, really, not having obtained any answer, at the end I forgot at all to have posted this question. Now, following your proposal, I will try to resume the problem which motivated this post. Thank you. Bye. – agt Dec 22 '14 at 15:27
  • You're welcome. I edited my answer because with_slider_draw is part of wxMaxima, not the draw package. – Fred Senese Dec 22 '14 at 17:36
  • ok thank you a lot. But what confuses me here at the moment is, with_slider_draw is not any of the draw functions I used earlier, and what does the explicit do? – Arne Oct 09 '15 at 23:10
  • @FredSenese is it possible to draw multiple graphs using with_slider_draw? Like, if I want to draw `cx^2` and `2cx` for same slider variable `c`? – sarker306 Aug 27 '19 at 11:40
3

You could use Maxima from within the Sage notebook and resort to the interact command. See also Sage's interface to Maxima.

jmbr
  • 3,298
  • 23
  • 23