Substitution to solve Coupled differential equations
4 次查看(过去 30 天)
显示 更早的评论
Hi,
I have the following types of equations:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/203016/image.png)
Here F is known, so I will get p = g(x(i)) which gives me f(i) as a function of all x(i).
Now I need to solve the following coupled differential equations:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/203017/image.png)
How can I solve this problem in MATLAB? Please help.
2 个评论
Torsten
2019-2-7
Here F is known, so I will get p = g(x(i)) which gives me f(i) as a function of all x(i).
I don't understand this. Could you clarify ?
回答(1 个)
Bjorn Gustavsson
2019-2-7
Just look at the examples for ode45 - there should be some example explaining how to write a function
returning dxdt when called. It would be something like this:
function dxdt = myode(t,x)
dxdt = zeros(numel(x),1)
dxdt(1) = f1(x,possibly,other,input,arguments);
dxdt(2) = f2(x,possibly,other,input,arguments);
...
dxdt(numel(x)) = fn(x,possibly,other,input,arguments);
end
HTH
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!