Using ode15s as a function of parameters in order to solve them with fsolve
4 views (last 30 days)
Show older comments
Hello,
I am stuck with the following problem, if you could help it will be great.
I am trying to realise some kind of shooting method.
So I have a system of ode, whatever it is (contained in sysode), and I want to integrate it from left to right from t_0 to t_m and from right to left from t_end to t_m.
I know initial conditions at t_0, but not in t_end. Then i want to integrate first at left and then match the integration which starts from t_end, to obtain the initial condition at t_end.
So in my mind i would use a command like
F0=lambda_1
u0=lambda_2
A0=lambda_3
B0=lambda_4
A10=lambda_5
B10=lambda_6
tspan = [5 1.6];
y0 = [F0 u0 A0 A10 B0 B10];
H10 = 0;
opts = odeset('RelTol', 1e-5, 'AbsTol', 1e-8,'Stats','on')
[t,y] = ode15s(@(t,y) sysedo(t,y,b0,b1,b2,b3), tspan, y0, opts);
lambda=fsolve(y(end,:)-yts(:,1),lambda_0)
where yts is given by the first integration from t_0 to t_m, and lambda_0 will be a vector for the initial guess.
So i want to use ode15s inside fsolve as a function of the lambda_i, to obtain them in the end, but i don't know how to do it.
Can you help me with this problem ?
Thank you for help.
Have a good day.
0 Comments
Answers (0)
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!