Solving a boundary value problem (bvp) using ode45

조회 수: 5 (최근 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 CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by