Hi!
I'm trying to solve a differential equation of the form y'=cos(pi*t*y).
I wrote:
<
de:= diff(y(t),t)=cos(pi*t*y(t))
And that works fine.
Then I tried to use dsolve(de) but that shows nothing and just goes to the next line
So I figured maybe it couldn't solve it and decided to try the transform methods. For instance,
with(inttrans)
ics:=y(0)=0
dsolve({de,ics},y(t),method=laplace) <- with regards to this, I also tried Fourier
But it gives me an error message: Error, (in dsolve/inttrans/solveit) transform method can only be applied to linear ODE
I don't know what to do with it... Thanks in advance for any help :)
series solution
You may try a series solution like:
de:= diff(y(t),t)=cos(Pi*t*y(t)): ics:=y(0)=0: dsolve({de,ics},y(t),series); 2 Pi 5 6 y(t) = t - --- t + O(t ) 10Note: use Pi for 3.14...
de
In all likelihood there are no closed-form solutions. Besides series, you could try numerical solutions. Using Pi, as jakubi remarked:
> S:= dsolve({de, ics}, y(t), numeric);
> plots[odeplot](S,[t,y(t)],t=0..10);
It looks like y(t) ~ 1/(2 t) as t -> infinity. More precisely:
Oo thank you! That
<p>Oo thank you! That helped.</p>
<p>Now I'm trying to graphs a sequence of solutions with different initial conditions on one graph. So I wrote this:</p>
<p>display(seq(plots[odeplot](dsolve({de, y(0)=k}, y(t), numeric), [t,y(t)], t=0..10), k=0..4, 0.2), insequence=true)</p>
<p> </p>
<p>But the output from that is basically:</p>
<p>display(PLOT(...), PLOT(...).... etcetc)</p>
<p> </p>
<p>I checked the brackets and I think they're all okay. Is it the syntax? Or just the idea in general?</p>
display
The display command is in the plots package. So you could use plots[display] instead of just display.
The option insequence=true will give you an animation. Leave it out if you want the different solutions all on one graph.