필터 지우기
필터 지우기

Cannot Plot Multiple Functions on Same Graph

조회 수: 3 (최근 30일)
Tom Keaton
Tom Keaton 2019년 8월 14일
편집: KALYAN ACHARJYA 2019년 8월 14일
Hello,
I am trying to plot two different Maxwellian functions on the same graph. The only difference between them is that one has a cosntant added to it. I know that the constant should move the first function to the right about 0.003E-19 so it is a very small difference, however it is still big enough to be visually noticeable wrt the scales on the graph. To see if this did not plot due to some issue with the functions being nearly the same, I also plotted another test function called "test" in the code below to see if that would work and that function is not being plotted either. My code is only plotting one Maxwellian function. Any ideas?
T = 1000;
k = 1.381E-23; %Boltzman's constant
cone = 2/((k*T)^(3/2)); %Constant infront of the Maxwellian distribution function
energyaddition = 2000; %E-field strength of experiment in (eV)
entrans = energyaddition*(1.6022E-19);
energyaddition2 = 0; %E-field strength of experiment in (eV)
entrans2 = energyaddition2*(1.6022E-19);
syms Ein
%Create Maxwellian distribution function (In terms of E)
maxd = entrans + cone*sqrt(Ein/pi)*exp(-Ein/(k*T)); %Define Maxwellian distribution function
maxd2 = entrans2 + cone*sqrt(Ein/pi)*exp(-Ein/(k*T)); %Define Maxwellian distribution function
test = (1.5E+19)*sin((1.5E-19)*Ein);
hold on
fplot(Ein,maxd,[0 1E-19])
fplot(Ein,maxd2,[0 1E-19])
fplot(Ein,test,[0 1E-19])
hold off

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 8월 14일
편집: KALYAN ACHARJYA 2019년 8월 14일
There are 3 plots, check it carefully
fplot(Ein,maxd,[0 1E-19],'r','linewidth',2)
hold on
fplot(Ein,maxd2,[0 1E-19],'--ob')
fplot(Ein,test,[0 1E-19],'g')
hold off
Change the scale range/differences, you will find it.
  댓글 수: 1
Tom Keaton
Tom Keaton 2019년 8월 14일
편집: Tom Keaton 2019년 8월 14일
So it actually was because the two Maxwellian plots are so similar that they are pretty much plotted ontop of each other. Thanks for pointing that out!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by