How to plot a variable in MATLAB which can not be separated explicitly ?

4 views (last 30 days)
I am trying to plot this function using MATLAB:
ln(Iout./Iin)+(Iout-Iin)./Isat = 2*Alpha*L
Rest of the values are given as:
L=0:0.1:10
Iin=1
Alpha=0.1
Isat=100
But I can't separate "Iout" from rest of the equation analytically. Can someone help me plot "Iout" as a function of "L"?

Accepted Answer

John D'Errico
John D'Errico on 11 May 2019
Edited: John D'Errico on 11 May 2019
Is ln meant to denote the NATURAL logarithm? If so, then you use log in MATLAB.
At first, I thought you mean to write lin, which is a variable in your problem. Assuming you mean log, I would just use fimplicit...
Iin = 1;
alph = 0.1;
Isat = 100;
fimplicit(@(L,Iout) log(Iout./Iin) + (Iout-Iin)./Isat - 2*alph*L,[0,10])
xlabel L
ylabel Iout
grid on
Can you solve for Iout, as a function of L? Well, yes, but not in any way you might have expected.
syms L Iout
solve(log(Iout./Iin) + (Iout-Iin)./Isat - 2*alph*L,Iout)
ans =
100*wrightOmega(L/5 - log(100) + 1/100)
If you don't know what the wrightOmega function is, or have never seen it, you will have much company in the world.
I'm reminded of the story about the famous visiting professor, who was asked to give a talk on mathematics to a group of students, many of whom were in their first year. He stood in front of the auditorium, blithely covering blackboard after blackboard with mathematics, heavy in bessel functions and beyond. After a while, he realizes how quiet the audience has become, so he turns around, and asks "Is there anyone here who has never seen a Bessel function?" At that point, several students bravely raise their hands to admit that they indeed have not. He nods, turns around, then points to the blackboard, saying "that is one there". Then he proceeds with his lecture.
  1 Comment
Tanveer Ahmed
Tanveer Ahmed on 11 May 2019
Edited: Tanveer Ahmed on 11 May 2019
John D'Errico thanks a lot for answering the question in a very impressive way. Yes In is meant to be natural logarithm. I just forgot that log() in MATLAB is simply natural logarithm. I am attaching the pictures of problem and desired solution. You can have a look on them and guide me further in this regard.
I am a little bit unsure about the second portion of your answer because I really don't about wrightOmega function. As you said, I am quite sure I have many fellows in the world who have not seen this wrightOmega function before, exactly like me.
Thanks a lot for your time. Cheers!

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!