# Problem with plotting equation

20 views (last 30 days)
George Bashkatov on 25 Dec 2020
Answered: Mischa Kim on 26 Dec 2020
I have an implicit equation where x and y - variables. I want to make a graph, but ezplot function doesn't work. MATLAB writes: log(y/x)-STOI+(x/I_sat)*(y/x-1) cannot be plotted in the xy-plane. Also he offers to use fplot instead of ezplot, but it doesn't work correctly with fplot because, as far as I know, fplot doesn't work with implicit equations. So how can I solve this problem?
Also x should changes from 0 to 25. But I think it isn't a tough problem to solve.
George Bashkatov on 25 Dec 2020
I only want to plot the last equation. Other variables are only auxiliary.
"y" here is like a y=f(x). This is an inplicit equation, so I can't make equation like y=f(x) and I have to make and equation like f(x,y)=0.
I think x should cover the same range as I_0, but when I tryed to change x to I_0 it didn't work. The range of I_0 is 0..25.
Now I recognized that x and I_0 are the same variables. I substituted STOI with expression for this variable. After that in this formula I substituted b with expression for variable "b". And in expression for b I substituted the I_0 with x. So I had an expression with only two variables x and y without any vectors. But it also gives the same error.
syms x y;
ezplot('log(y/x)-(sigma_e/sigma_a)*(log(1+x*sigma_a*tau*lambda_0/(h*c))-log(1+(x*sigma_a*tau*lambda_0/(h*c))*exp(-alpha*L)))+(x/I_sat)*(y/x-1)');

Mischa Kim on 26 Dec 2020
Hi George, use fimplicit():
syms x y
f(x,y) = log(y/x)-(sigma_e/sigma_a)*(log(1+x*sigma_a*tau*lambda_0/(h*c))-log(1+(x*sigma_a*tau*lambda_0/(h*c))*exp(-alpha*L)))+(x/I_sat)*(y/x-1);
fimplicit(f)
Of course, you would have to assign values to the parameters.

R2020a

### Community Treasure Hunt

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

Start Hunting!