Effacer les filtres
Effacer les filtres

Matlab ODE Solvers - Paramater Question

37 vues (au cours des 30 derniers jours)
Joe le 17 Mai 2024 à 5:52
Commenté : Torsten le 17 Mai 2024 à 13:30
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 (:

Réponses (2)

Walter Roberson
Walter Roberson le 17 Mai 2024 à 5:56
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
  1 commentaire
Joe le 17 Mai 2024 à 6:37
Modifié(e) : Joe le 17 Mai 2024 à 7:19
--Thank you!

Connectez-vous pour commenter.

Torsten le 17 Mai 2024 à 7:08
Déplacé(e) : Torsten le 17 Mai 2024 à 7:08
You mean
function res = fun(t,y,lambda)
? But what do you mean by "variable parameter" ? This is a contradiction in itself: A parameter isn't variable.
  2 commentaires
Joe le 17 Mai 2024 à 7:22
Thanks! How I include the extra final condition? Would that go in ode45 line?
Torsten le 17 Mai 2024 à 13:30
If you have a final condition for one of the unknown functions, you should use "bvp4c" instead of "ode45".

Connectez-vous pour commenter.




Community Treasure Hunt

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

Start Hunting!

Translated by