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

조회 수: 4 (최근 30일)
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"?

채택된 답변

John D'Errico
John D'Errico 2019년 5월 11일
편집: John D'Errico 2019년 5월 11일
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
Tanveer Ahmed
Tanveer Ahmed 2019년 5월 11일
편집: Tanveer Ahmed 2019년 5월 11일
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!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Historical Contests에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by