Matlab ODE Solvers - Paramater Question
1 次查看(过去 30 天)
显示 更早的评论
Greetings,
I working with a system of differential equations that model amount of components as a reaction proceeds. I want to pass a variable parameter through one of matlab's ode solvers (probably 45/15). This is in addition to time bounds, so it would be like ode45(function, times, [X1(0),X2(0),...X5(0)],... ). I want to find λ given something like X1(final) = 0.35. How to include this information?
Thank you (:
0 个评论
回答(2 个)
Walter Roberson
2024-5-17
To pass an additional parameter, use http://www.mathworks.com/help/matlab/math/parameterizing-functions.html
However... for the task of finding X1(final) = 0.35 you should be using one of the Boundary Value Problems solvers; https://www.mathworks.com/help/matlab/boundary-value-problems.html
Torsten
2024-5-17
移动:Torsten
2024-5-17
You mean
ode45(@(t,y)fun(t,y,lambda),times,[X1(0),X2(0),...X5(0)])
function res = fun(t,y,lambda)
...
end
? But what do you mean by "variable parameter" ? This is a contradiction in itself: A parameter isn't variable.
2 个评论
Torsten
2024-5-17
If you have a final condition for one of the unknown functions, you should use "bvp4c" instead of "ode45".
另请参阅
类别
在 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!