How to plot this implicit function

3 Ansichten (letzte 30 Tage)
Atom
Atom am 8 Sep. 2019
Kommentiert: madhan ravi am 8 Sep. 2019
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 Kommentare
Atom
Atom am 8 Sep. 2019
Inserted dot. still warning exists.
Warning: Function failed to evaluate on array inputs; vectorizing the function may speed up its evaluation and avoid the
need to loop over array elements.
> In ezplotfeval (line 56)
In ezplot>ezimplicit (line 257)
In ezplot (line 153)
In untitled1 (line 10)
darova
darova am 8 Sep. 2019
Works for me
export_fig_out.png

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

darova
darova am 8 Sep. 2019
Try symbolic expression
clc,clear
alpha=1.5; A=0.0207; gamma=0.25;
syms beta eps
x = (beta-alpha*(beta-gamma)+sqrt((beta-alpha*(beta-gamma)).^2+4*alpha*beta*gamma*A))./(2*beta);
y = x.*(1-x).*beta/gamma;
t = -x+x.*y.*(alpha-eps*beta)./((A+x+y).^2);
d = eps*beta.*x.*y.*(x.^2+(A+x).*x+A*alpha)./((A+x+y).^3);
% convert symbolic expression to function handle
F = matlabFunction(t.^2 - d,'vars',[beta eps]);
ezplot(F,[0,1,0,1]);
  2 Kommentare
darova
darova am 8 Sep. 2019
Can be used without bit-wise ./ and .* (just / and *)
madhan ravi
madhan ravi am 8 Sep. 2019
There are in-built functions under the name alpha() , beta() , gamma() , eps().

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by