solution2=ode45(vector2, [0 1], [.39 0]);
factor2=((1+b_2)/(F))*(solution2.y(2,:));
so factor2 will be set according to the output of the ode -- not according to the input of the ode.
loglog(factor2,1-observ_mod2)
and that factor2 will be used as the independent variable for the second plot, even though it is obviously a dependent variable. There is no solid reason ahead of time to expect that the output of the ode will have any particular range.
observ_mod2=(factor2*F)/(1+b_2);
In practice your factor2 appear to be in strictly increasing order. Your observe_mod2 is calculated from that with a simple transformation. You use your factor2 as the x axis for your loglog() plot. That means that as long as factor2 is finely-enough sampled that you do not get visual artifacts, that you might as well instead just substitute factor2 values that you make up with linspace() or logspace() without ever having done the ode45(). In context, the only purpose of the ode45 is to establish the range of values to plot over, and you do not even want to use that range, so you might as well not even call ode45() .
0 Comments
Sign in to comment.