curve generation plot for given pdf
Ältere Kommentare anzeigen
I am not able to generate the curve of FIg.5 as per attached pdf or given link below
I am trying to replicate the same but having some problem. Please solve the same
Thank you
clear all
clc
for i=1:2
alpha(i)= (pi*22)/180;
beta(i)= atan(cos(alpha(i))*sin(gamma(i))./(1+sin(alpha(i))*sin(gamma(i))));
end
R=0.4;
t(1)= R*cos(alpha(1))./cot(alpha(1)+beta(1));
t(2)= R*cos(alpha(2))./cot(alpha(2)+beta(2));
n_1=1.49;
theta_1= asin(n_1.*sin(alpha(1)))-alpha(1);
T=0.2;
H_1=0.1;
t(3)= (H_1-t(1)*(tan(alpha(1))-cot(theta_1)))./(cot(theta_1)-tan(alpha(2)));
t(4)= (t(2)*(tan(alpha(2))-cot(theta_1))+.....
T*(tan(alpha(1))-tan(alpha(2)))-H_1)./(tan(alpha(1))-cot(theta_1));
h_1=(T-t(1)-t(4))*tan(alpha(1));
h_2=(T-t(3)-t(2))*tan(alpha(2));
n_2=1.49;
lamda_min=0.004;
lamda_max=0.007;
phase= h_1*(n_1 -1)./(lamda_min)+ h_2*(n_2-1)./(lamda_min);
e1= (sin(pi*((1-(phase/2*pi))))/(pi*((1-(phase/2*pi)))))^2;
e2= (sin(pi*(t(1)/T))/(pi*(t(1)/T)))^2;
e3= (sin(pi*(t(2)/T))/(pi*(t(2)/T)))^2;
e4= (sin(pi*(t(3)/T))/(pi*(t(3)/T)))^2;
e5= (sin(pi*(t(4)/T))/(pi*(t(4)/T)))^2;
x=0.001;
f=0.025;
syms x
b= int(R-sqrt(R.^2-x.^2),0, f);
c=sqrt((1/f)*b);
e6= exp(((-4*pi*c)/lamda_min).^8);
effic= e1*e2*e3*e4*e5*e6;
syms lamda
pide=int(e1*e2*e3*e4*e5, lamda_min,lamda_max);
fpide= (1/(lamda_max-lamda_min))*pide;
1 Kommentar
Kundan Prasad
am 15 Dez. 2021
Antworten (1)
Simran
am 27 Mär. 2025
1 Stimme
To generate the given curve, you can try these changes in the original code :
- The variable “gamma” is used but not defined in the original code. This is causing an error when trying to calculate “beta(i)”.
- The symbolic integration of “e1*e2*e3*e4*e5” with respect to “lamda” is not required, because these are constants with respect to “lamda”.
- The variable “effic” is calculated but not used further in the code.
- For plotting, instead of relying on symbolic integration, try using sample data points to simulate the plot, which is more straightforward and aligns with the intended visualization.
- I have added additional plot customization to better reflect the intended graph.
This is the curve that I got implementing these changes:
You can refer to the following documentation for more understanding:
MATLAB Integration Documentation: https://www.mathworks.com/help/releases/R2021a/matlab/ref/integral.html
Kategorien
Mehr zu Calculus finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
