B(v) =
How to Graph integrals?
Afficher commentaires plus anciens
Hello everybody,
I'm trying to get this graph:

Using this code:
function res = fun(bs,gamma)
fun_ode = @(b,z)[(1-gamma)*z(1)/(z(2)-b);z(2)/(z(1)-b);z(1)];
z0=[1 1 0];
[B,Z] = ode45(fun_ode,[bs,0],z0);
res = bs - 0.5*(1+gamma*Z(end,3));
end
gamma = 0.3;
bs = 0.542
fun_ode = @(b,z)[(1-gamma)*z(1)/(z(2)-b);z(2)/(z(1)-b);z(1)];
z0=[1 1 0];
[B,Z] = ode45(fun_ode,[bs,0],z0);
hold on
plot(B,Z(:,1),'r')
plot(B,Z(:,2),'b')
hold off
grid on
But I didn't get it. I would appreciate it if I could get the graph.
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 27 Juil 2024
0 votes
b is not defined.
This is the same problem as you had for your previous iteration of this question (which you have deleted.) I pointed out the problem there.
3 commentaires
Researcher DSGE
le 29 Juil 2024
syms v a
gamma=0.3;
b_hat=0.542;
fun = v/2;
B(v) = int(fun, v, 0, a)
fplot(B,[0 1])
You are defining B to be a function of v. But you are integrating over v with definite integral bounds that are independent of v, so the result will be independent of v. As a result, B(v) is independent of v, and is instead dependent on the constant a
I don't understand the relation between your graphs and Proposition 4. What is v ? Why is b plotted as y-axis and not as x-axis for it seems to be the independent variable ?
Catégories
En savoir plus sur Mathematics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



