Help solving linear ordinary differential equation that involves matrix
4 次查看(过去 30 天)
显示 更早的评论
I need to find the general solution to a linear ordinary differential equation that involves a matrix. The problem is in the form x'(t) = [ matrix] x(t). When I try to solve, it gives me a solution for x and y but neither one is correct. It needs to be in the form c1(e^t)[matrix] + c2(e^t)[matrix]. thank you.
回答(1 个)
John D'Errico
2024-7-16
编辑:John D'Errico
2024-7-16
I would postulate that in fact, it DOES give the correct solution, at least to the problem you posed, but that it is not in the form you may want to see. This is a huge difference. Two expressions can be mathematically identical, yet appear different. That does not make one incorrect. Merely unexpected.
If you want help however, you need to show what you did, as your question is not clear. What for example, is y, since you defined the problem in terms of x, which as you wrote it, must be a vector of unknowns.
I conjecture you are doing something (at least equivalent) to this:
syms x1(t) x2(t)
x = [x1;x2];
syms a
A = [1 2;3 a];
xsol = dsolve(diff(x,t) == A*x,x1(0) == 1,x2(0) == 0)
Now, the fact is, you probably learned in a class somewhere, that we can write the solution in terms of a matrix exponential which is the general form you showed in your question. And in fact, after some algebra, it would reduce to the same thing as what dsolve produced, but as I said, it looks different from what dsolve returns. That does not make it incorrect however, merely unexpected. The solution is still entirely valid. We could even, with some minor algebra of our own, convert the result that dsolve returned into a matrix exponential form. And, yes, the matrix exponential you want to see probably seems a cleaner way to represent the solution. Such is life.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Equation Solving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!