Cannot Plot Multiple Functions on Same Graph
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!