Solving a non-linear differential equation

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 )
                                 10

Note: use Pi for 3.14...

Robert Israel's picture

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:

1/(2*t)+1/(2*Pi*t^3)+3/2/Pi^2/t^5+1/48*(Pi^2+360)/Pi^3/t^7+1/6*(2*Pi^2+315)/Pi^4/t^9+3/1280*(Pi^4+1920*Pi^2+201600)/Pi^5/t^11 + O(t^(-13))

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>&nbsp;</p>
<p>But the output from that is basically:</p>
<p>display(PLOT(...), PLOT(...).... etcetc)</p>
<p>&nbsp;</p>
<p>I checked the brackets and I think they're all okay. Is it the syntax? Or just the idea in general?</p>

Robert Israel's picture

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.

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}