How to plot this implicit function
古いコメントを表示
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 件のコメント
darova
2019 年 9 月 8 日
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
2019 年 9 月 8 日
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
2019 年 9 月 8 日
darova
2019 年 9 月 8 日
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
2019 年 9 月 8 日
Vectorizing
Forgot the dot

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

採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!