Solving a boundary value problem (bvp) using ode45

8 ビュー (過去 30 日間)
Nitin
Nitin 2012 年 1 月 21 日
Hi,
I am trying to solve a system of 3 bvp. I have written the code for ode45 for 6 equations to solve this and it runs well. Now, the problem lies in making the initial guess. I know my boundary value limits are 0.6 and 0, but I can't put the final limit, 0, in ode45. For that I need a dy/dt(0) value. Now for this I have to guess a value for dy/dt(0) and try to converge the final boundary value into 0. Can anybody suggest me a program to do this. Below is my code y0(1) = 0.6; y0(2) = 101325*0.6/(20e-6-1e-20); % guess value for dxdt(0) y0(3) = 0.3; y0(4) = 101325*0.3/(20e-06-1e-20); % guess value for dydt(0) y0(5) = 0.6; y0(6) = 101325*50e-06/(20e-06-1e-20); % guess value for dzdt(0) rspan = [1e-20 20e-06]; [r,y] = ode45(@myodesubfunc,rspan,y0)
Now with this code I see that y(1,end), y(3,end) and y(4,end) is not 0, so I need to guess another value for dxdt(0), dydt(0) and dzdt(0). Can anybody tell me what to do. I know fminsearch works for this but I keep getting errors and matlab help is not useful. If you can show me with just a small gist of code with your answer I will be greatful.
Thanks, Nitin
  1 件のコメント
Andrew Newell
Andrew Newell 2012 年 1 月 21 日
Please format your code: see http://www.mathworks.com/matlabcentral/answers/7885-tutorial-how-to-format-your-question.

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

回答 (0 件)

カテゴリ

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