Solving ODE's and linear algebraic equations simultaneously in matlab

Hello all,
I want to solve a system of ODE's along with a linear algebraic equation. I know the system of ODE's can be easily solved with dsolve and the linear equations can be solved with linsolve, but I want to be able to solve them simulataneously. For example my system will look like this
M=a*t + b
d(e)/d(t) = c*t+ t^2
d(f)/d(t) = k*t^2
where I will be solving for e and f.
Thanks in advance.

2 件のコメント

John D'Errico
John D'Errico 2022 年 10 月 28 日
Must I point out that the linear equation you show has no relationship to the ODEs you then show?
If, instead, your had written an equation that related the unknowns e(t) and f(t), then you could do something, and a DAE could be correct. But the equation:
M=a*t + b
is completely independent of e and f. You could change the values of a and b arbitrarily, for example, and it would have no impact on e(t) or f(t).
My guess is you were trying to just write down something for someone to see as an example, but your example is not what you seem to be asking to solve.
Venkatraman Nagarajan
Venkatraman Nagarajan 2022 年 10 月 28 日
Hello. Yes that is true. Sorry about that and Thank you, I think the way to do this would be to refer to DAE solving in matlab.

サインインしてコメントする。

回答 (1 件)

Steven Lord
Steven Lord 2022 年 10 月 28 日

1 投票

So you have a system of differential-algebraic equations (DAE)? Since you mentioned dsolve it sounds like you have Symbolic Math Toolbox available, so take a look at the daeFunction function.

カテゴリ

質問済み:

2022 年 10 月 28 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by