Second order, nonlinear differential equation help

In summary, the conversation discusses trying to solve the differential equation y''+t*y+y*y'=sin(t) using a power series solution and a Mathematica code. The Mathematica code generates a plot that closely matches the solution obtained through using NDSolve.
  • #1
cpyles1
1
0
I've been trying to solve this one for a while. My professor wasn't even sure how to do it. Any suggestions?
y''+t*y+y*y'=sin(t)
 
Physics news on Phys.org
  • #2
cpyles1 said:
I've been trying to solve this one for a while. My professor wasn't even sure how to do it. Any suggestions?
y''+t*y+y*y'=sin(t)

Yeah. How about a power series solution? Huh? What do you mean that yy' thing? No? How about the Mathematica code below then. Looks pretty close to me.

Code:
Remove[a];

nmax = 25; 

myleftside = Sum[n*(n - 1)*Subscript[a, n]*t^(n - 2), {n, 0, nmax}] + 
    Sum[Subscript[a, n - 3]*t^(n - 2), {n, 3, nmax + 2}] + 
    Sum[Subscript[a, k]*Subscript[a, n - k]*(n - k)*t^(n - 1), {n, 0, nmax + 1}, {k, 0, n}]; 

myrightside = Sum[((-1)^n*t^(2*n + 1))/(2*n + 1)!, {n, 0, nmax}]; 

myclist = Flatten[Table[Solve[Coefficient[myleftside, t, n] == Coefficient[myrightside, t, n], 
      Subscript[a, n + 2]], {n, 0, nmax}]]; 

Subscript[a, 0] = 0; 
Subscript[a, 1] = 1; 

mysec = Table[Subscript[a, n] = Subscript[a, n] /. myclist, {n, 2, nmax}]; 

thef[t_] := Sum[Subscript[a, n]*t^n, {n, 0, nmax}];

p1 = Plot[thef[t], {t, 0, 2}, PlotStyle -> Red];

mysol = NDSolve[{Derivative[2][y][t] + t*y[t] + y[t]*Derivative[1][y][t] == Sin[t], y[0] == 0, 
    Derivative[1][y][0] == 1}, y, {t, 0, 2}];

p2 = Plot[y[t] /. mysol, {t, 0, 2}, PlotStyle -> Blue];

Show[{p1, p2}]
 
Last edited:

FAQ: Second order, nonlinear differential equation help

What is a second order, nonlinear differential equation?

A second order, nonlinear differential equation is a mathematical equation that involves the second derivative of a function, as well as the function itself, and possibly other terms. Nonlinear refers to the fact that the equation is not a linear function, meaning the variables are not directly proportional to each other.

How do you solve a second order, nonlinear differential equation?

Solving a second order, nonlinear differential equation typically involves using techniques such as substitution, separation of variables, or transforming the equation into a linear one. Depending on the complexity of the equation, it may also require numerical methods or computer software to find a solution.

What is the importance of second order, nonlinear differential equations in science?

Second order, nonlinear differential equations are commonly used in science to model complex systems and phenomena, such as chemical reactions, population growth, and fluid dynamics. They allow for a more accurate representation of real-world situations and can help predict future behavior.

Can you provide an example of a second order, nonlinear differential equation?

One example of a second order, nonlinear differential equation is the Lotka-Volterra model, which describes the predator-prey relationship in a biological ecosystem. It involves the second derivative of both the predator and prey populations, as well as other nonlinear terms such as the interaction between the two populations.

What are some common applications of second order, nonlinear differential equations?

Second order, nonlinear differential equations are used in a wide range of fields, including physics, biology, chemistry, engineering, and economics. They can be used to model systems and phenomena such as oscillations, growth and decay, vibrations, and electrical circuits.

Similar threads

Replies
3
Views
2K
Replies
4
Views
2K
Replies
2
Views
2K
Replies
12
Views
2K
Replies
11
Views
2K
Replies
6
Views
2K
Replies
1
Views
2K
Replies
7
Views
2K
Back
Top