Why my graph not same as research paper?
Show older comments


Hello, I want to ask why I did not get the correct graph as above?
This is my code that i have try:
clc
%for t1=0.1%
x=0.0:0.5:2.0;
alpha=0.5;
t1=0.1;
D=15.2;
u=0.144;
b=sqrt(alpha/(4*pi*D*t1));
c= -(alpha/4*D*t1);
d=x-(u*(t1/alpha));
C1=b*exp(c*(d.^2));
plot(x,C1)
hold on
x=0.0:0.5:2.0;
alpha=0.7;
t1=0.1;
D=15.2;
u=0.144;
b=sqrt(alpha/(4*pi*D*t1));
c= -(alpha/4*D*t1);
d=x-(u*(t1/alpha));
C2=b*exp(c*(d.^2));
plot(x,C2)
ylabel('Concentration');
xlabel('t/tres');
Answers (1)
Sam Chak
on 11 Jun 2022
Hi @Nur
Sorry for the misidentity because the name, the title, and the topic look exactly the same.
Anyway, I have fixed some equations in the code. Please check. Is
true?
alpha1 = 0.5;
alpha2 = 0.7;
t1 = 0.1; % t_alpha
D = 15.2; % D_alpha
u = 0.144;
a1 = sqrt(alpha1/(4*pi*D*t1^alpha1)); % amplitude 1
b1 = alpha1/(4*D*t1^alpha1)
c1 = (u*t1^alpha1)/alpha1; % center 1
C1 = a1*exp(- b1*(x - c1).^2);
a2 = sqrt(alpha2/(4*pi*D*t1^alpha2)); % amplitude 2
b2 = alpha2/(4*D*t1^alpha2)
c2 = (u*t1^alpha2)/alpha2; % center 2
C2 = a2*exp(- b2*(x - c2).^2);
The Gaussian functions are computed as follows but the centers are very close to zero. Their amplitudes are also relatively large compated to the paper.



4 Comments
Torsten
on 12 Jun 2022
Five x-values are not enough to get a smooth curve.
Sam Chak
on 12 Jun 2022
Hi @Nur
No worries. Take it slowly. You have created the vector x from -10 to 10 with a uniform spaced interval of 5.
x = -10 : 5 : 10;
There are only 5 points: [-10, -5, 0, 5, 10], and this is very coarse when the C1 and C2 points are generated from the Gaussian function:

The plot will become smoother if a relatively small interval is set, for example:
x = -10 : 0.05 : 10;
(Previously, I didn't show this in my Answer).
Honestly, I don't know why your plotted graphs are different from the paper. Maybe there are misprints in the formulas or the values of the parameters. You will need to find out from various literature.
You can check the amplitude a that sets the height of the Gaussion function, as well as the center c, where the peak of the Gaussian function is.
Torsten
on 12 Jun 2022
My guess is that in the plots, x is fixed and t varies since the independent variable on the axis is called t/tres.
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

