Solving a first order ODE with dsolve
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
GuoZheng Lee
am 25 Mär. 2021
Bearbeitet: John D'Errico
am 25 Mär. 2021
Hi I wanted to use matlab to solve a bernoulli equation: using dsolve
This is the answer from matlab:
>> syms y(x)
>> ODE = diff(y, x) - 5*y == -5/2*y^3
ODE(x) =
diff(y(x), x) - 5*y(x) == -(5*y(x)^3)/2
>> y = dsolve(ODE)
y =
2^(1/2)*(-1/(exp(C1 - 10*x) - 1))^(1/2)
0
2^(1/2)
-2^(1/2)
The answer from matlab is different from the hand calculated solution: .
May I know how to get matlab to show the above answer? Also, what is the 3 numbers below the answer (0, 2^(1/2), -2^(1/2)) for? Thank you
0 Kommentare
Akzeptierte Antwort
John D'Errico
am 25 Mär. 2021
Bearbeitet: John D'Errico
am 25 Mär. 2021
While you may THINK that is the only answer, is it true that y==0 is also a solution?
How about the constant value of sqrt(2)? -sqrt(2)?
So is it vaguely possible that your hand calculated solution is not a complete one?
Next, consider that any expression can be writtten in different, but valid ways. Consider the expression:
exp(C + x)
where C is some unknown constant. Can that also be written as
D*exp(x)
where D is some equally unknown constant?
Since you did not provide initial values of any sort to dsolve, it produces a valid solution. The solution may not look exactly like yours, but it is still a valid solution, and in fact, a more complete solution than what you found.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!