How to plot this implicit function
Show older comments
I need a beta vs eps plot of the curve t^2-d. The expression of t and d depends on x, y where x, y depend on beta. Please help. Ranges of beta and eps are both equal to 0:.01:1,
alpha=1.5; A=0.0207; gamma=0.25;
x=@(beta) (beta-alpha*(beta-gamma)+sqrt((beta-alpha*(beta-gamma)).^2+4*alpha*beta*gamma*A))./(2*beta);
y=@(beta) x.*(1-x).*beta/gamma;
t=@(beta,eps) -x+x.*y.*(alpha-eps*beta)./((A+x+y).^2);
d=@(beta,eps) eps*beta.*x.*y.*(x.^2+(A+x).*x+A*alpha)./((A+x+y).^3);
F=@(beta,eps) (t.^2-d);
figure
ezplot(F,[0,1,0,1]);
9 Comments
darova
on 8 Sep 2019
I don't see here eps
x=@(beta,eps) (beta-alpha*(beta-gamma)+sqrt((beta-alpha*(beta-gamma)).^2+4*alpha*beta*gamma*A))./(2*beta);
What is x? Where is eps?
y=@(beta,eps) x.*(1-x).*beta/gamma;
darova
on 8 Sep 2019
Sorry didn't notice that. You should write input arguments for your function all the time
f1 = @(x,y) x + y;
f2 = @(x,y) f1 + 2*x;
% f2 = @(x,y) f1(x,y) + 2*x; % should be
f2(1,1)
Atom
on 8 Sep 2019
darova
on 8 Sep 2019
x=@(beta) (beta-alpha*(beta-gamma)+sqrt((beta-alpha*(beta-gamma)).^2+4*alpha*beta*gamma*A))./(2*beta);
y=@(beta) x.*(1-x).*beta/gamma;
has to be
x=@(beta) (beta-alpha*(beta-gamma)+sqrt((beta-alpha*(beta-gamma)).^2+4*alpha*beta*gamma*A))./(2*beta);
y=@(beta) x(beta).*(1-x(beta)).*beta/gamma;
darova
on 8 Sep 2019
Vectorizing
Forgot the dot

Why not use .^2?
fun2 = @(beta,eps) t(beta,eps).^2 - d(beta,eps);
Atom
on 8 Sep 2019
darova
on 8 Sep 2019
Works for me

Accepted Answer
More Answers (0)
Categories
Find more on Calculus 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!