How can i make a code to find y of y''=y*y' ?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
kyu hong lee
il 10 Giu 2016
Modificato: Roger Stafford
il 11 Giu 2016
(sorry about my english skill)
i want to know how can i make a ode code.
if i have y'=2y then i can make a code like
[T,Y] = ode45(@(t,y) 2*y,[0 1],1); plot(T,Y);
but if i have y''=y*y' , i can't make a code
help me (T_T)
0 Commenti
Risposta accettata
Roger Stafford
il 10 Giu 2016
Modificato: Roger Stafford
il 11 Giu 2016
To solve your equation numerically using one of the ode functions, you set it up as two simultaneous differential equations:
dy(1) = y(2)
dy(2) = y(1)*y(2)
See:
http://www.mathworks.com/help/matlab/ref/ode45.html
for some examples of this.
However, it should be noted that the ordinary methods of calculus can be used to solve this particular differential equation. Its solutions are:
y = 2*a*tan(a*t+b)
y = -2/(t+b)
y = -2*a*coth(a*t+b)
y = b
y = -2*a*tanh(a*t+b)
where a and b are arbitrary constants. (Corrected twice)
1 Commento
Roger Stafford
il 10 Giu 2016
Modificato: Roger Stafford
il 11 Giu 2016
I have added two more solution formulas involving the hyperbolic cotangent function and a reciprocal formula.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Ordinary Differential Equations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!