Second order, nonlinear differential equation help

Click For Summary
SUMMARY

The discussion focuses on solving the second-order nonlinear differential equation y'' + t*y + y*y' = sin(t). A power series solution is proposed, along with Mathematica code to implement the solution. The code includes the use of summations to derive coefficients and plots the results using NDSolve for numerical solutions. The provided Mathematica code effectively demonstrates how to approach this complex differential equation.

PREREQUISITES
  • Understanding of second-order nonlinear differential equations
  • Familiarity with power series solutions
  • Proficiency in Mathematica programming
  • Knowledge of numerical methods for differential equations
NEXT STEPS
  • Explore advanced techniques in solving nonlinear differential equations
  • Learn about Mathematica's NDSolve function for numerical solutions
  • Research power series methods in differential equations
  • Investigate the stability of solutions for nonlinear systems
USEFUL FOR

Mathematics students, researchers in applied mathematics, and anyone interested in solving complex differential equations using computational tools like Mathematica.

cpyles1
Messages
1
Reaction score
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
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:

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K