I want to plot an implicit equation
显示 更早的评论

I have attached the equations and its all variable I don't know how to plot.
4 个评论
Sam Chak
2022-4-21
You should press the "Insert MATLAB code" button and then copy/paste the code here, for example, like this:
eqn = sqrt(Va + Vb - Vc)
Else, this makes people lose the drive to type out the super long equation. Moreover, super long equation with lots of brackets is prone to human error. This makes people have to triple check it.
David Goodmanson
2022-4-21
HI mohd,
is Qm intended to be negative? If it's positive, the log term is going to give problems unless the square root of all that stuff in the argument of the log term is taken to be negative.
mohd ayaz
2022-4-21
mohd ayaz
2022-4-21
回答(2 个)
David Goodmanson
2022-4-21
编辑:David Goodmanson
2022-4-21
1 个投票
Hi mohd,
This is not really an implicit equation since Vgs appears only once, by itself, on the lhs. So you can take all the other stuff to the rhs and use Qm as the independent variable and Vgs as the dependent variable. You can experiment around for the range of Qm that gives the correct range for Vgs, assuming there is one. When you fine the right range, don't be reluctant to use lots of points in the Qm array. Ater you find the corresponding Vgs array you can plot(Vgs,Qm). One catch is if Qm+qNdtsi goes negative, in which case you will run into problems with the log term.
Sam Chak
2022-4-21
Hi @mohd ayaz
I tried to plot this way to first visualize how the curve looks like for the positive part of
.
.Qm = linspace(-1, 0, 1001);
Vgs = (1 + 1)*(Qm + 1)/2 + 1*((Qm + 1)/2).^3 + 1*((Qm + 1)/2).^5 + 1 + 1 - 1*(Qm + 1) + 1*log(- Qm.*sqrt((Qm + 1)/(1)));
plot(Qm, Vgs, 'linewidth', 1.5)
grid on
xlabel('Q_{m}')
ylabel('V_{gs}')

So, you want to invert the axes to plot(Vgs, Qm). You can check this documentation:
f = @(Vgs, Qm) Vgs - ((1 + 1)*(Qm + 1)/2 + 1*((Qm + 1)/2).^3 + 1*((Qm + 1)/2).^5 + 1 + 1 - 1*(Qm + 1) + 1*log(- Qm.*sqrt((Qm + 1)/(1))));
fimplicit(f, [-5 2 -1 0])
grid on
xlabel('V_{gs}')
ylabel('Q_{m}')

Now, make the substitution of the original constants.
类别
在 帮助中心 和 File Exchange 中查找有关 Mathematics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!