フィルターのクリア

Setting an ODE function solution to a value. In order to find the range of a variable inside the function?

1 回表示 (過去 30 日間)
I am looking to plot a graph of say a velocity,v, against another range, say U.
This v is inside a function - the solution of this function I would like to fix at a value in order to get the v range.
I have used a my ode function in a loop in order to get a range of the function outcomes - this time I want to fix this, and get a range of another variable that is inside of it.
How would I do this? Is there an option/odeset way of doing this, or shall i define it when I use the function itself? I am using ode23 or similar.
Thanks in advance.
  1 件のコメント
Physics
Physics 2017 年 3 月 24 日
I am asking about the capabilities of the ode function. The situation in which I would be using it is irrelevant in this case.

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

回答 (1 件)

Eeshan Mitra
Eeshan Mitra 2017 年 3 月 30 日
If I understand your question, you wish to calculate input 'U' corresponding to a given 'v', which is the solution to ‘ode23’, instead of iterating through different values of input 'U'. You could either:
  1.     Use the option 'OutputFcn' to step within the iterations and look at the output of ‘ode23’. This still requires you to iterate through a range of inputs. Read more on 'OutputFcn' here:  https://www.mathworks.com/help/matlab/ref/odeset.html#input_argument_d0e708834 .
  2.    Use 'fsolve' along with ode23, or other ode solvers to solve for 'U' for a given 'v'. Note that this may require an initial guess that is relatively close to the expected solution. Read more on 'fsolve' here:  https://www.mathworks.com/help/optim/ug/fsolve.html .

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by