Solving a boundary value problem (bvp) using ode45
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Andrew Newell
am 21 Jan. 2012
Please format your code: see http://www.mathworks.com/matlabcentral/answers/7885-tutorial-how-to-format-your-question.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!