Cannot Plot Multiple Functions on Same Graph
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Tom Keaton
le 14 Août 2019
Modifié(e) : KALYAN ACHARJYA
le 14 Août 2019
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 commentaires
Réponse acceptée
KALYAN ACHARJYA
le 14 Août 2019
Modifié(e) : KALYAN ACHARJYA
le 14 Août 2019
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 commentaire
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Lighting, Transparency, and Shading dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!