What does it mean? (ODE solution)
2 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/312785/Screenshot_20200609-095604_MATLAB.jpg)
Can you explain to me, why was the output like that?
I mean, since the input is ODE, the output should contains C1 (constant). And mine looks like it's a matrix form. Can you help me to solve this ODE?
Or, does this ODE have no solution?
Thanks!
4 个评论
John D'Errico
2020-6-10
编辑:John D'Errico
2020-6-10
@ Umar farooq Mohammad:
You tried to solve the wrong differential equation. Read the question more carefully. Admittedly, you needed to scroll the page to see the entire problem.
回答(1 个)
John D'Errico
2020-6-10
编辑:John D'Errico
2020-6-10
It seems the people who tried to respond to your question did not read it carefully, trying to solve the wrong ODE, or thinking you were using the wrong ODE solver, or that you had written your own code.
syms y(x)
>> ode = diff(y,x)== (3*y - 7*x + 7)/(3*x - 7*y - 3)
ode(x) =
diff(y(x), x) == -(3*y(x) - 7*x + 7)/(7*y(x) - 3*x + 3)
Now what happens when we try to solve this problem uing dsolve? First, I would add that you did not provide any initial conditions, so we would expect to see a constant of integration in there. Typically we would expect a 1-dimensional family of infinitely many solutions, parameterized by an unknown constant of integration.
sol = dsolve(ode)
Warning: Unable to find explicit solution. Returning implicit solution instead.
> In dsolve (line 197)
sol =
x - 1
1 - x
MATLAB tells us it was unable to find an explicit solution. So it did what it could, then telling you it was unable to truly "solve" the problem. However, do the "solution"s as given:
y = x - 1
and
y = 1 - x
satisfy the differential equation? Yes.
subs(ode,y,x-1)
ans(x) =
1 == 1
subs(ode,y,1-x)
ans(x) =
-1 == -1
In both cases, the answer is yes. So the solutions provided are solutions in a sense, and while not a complete solution in the form you expected, at least they form a partial solution. It did warn you of exactly that.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!