Skip to main content

Second Harmonic Generation N=1:21



gnuplot> set xrange [-180:180]
gnuplot> set yrange [-180:180]


splot sin(cos(x*pi/180))*sin(cos(x*pi/180))/(cos(x*pi/180)*cos(x*pi/180))*sin(cos(y*pi/180))*sin(cos(y*pi/180))/(cos(y*pi/180)*cos(y*pi/180))+sin(cos((x+1)*pi/180))*sin(cos((x+1)*pi/180))/(cos((x+1)*pi/180)*cos((x+1)*pi/180))*sin(cos((y+1)*pi/180))*sin(cos((y+1)*pi/180))/(cos((y+1)*pi/180)*cos((y+1)*pi/180))+sin(cos((x+2)*pi/180))*sin(cos((x+2)*pi/180))/(cos((x+2)*pi/180)*cos((x+2)*pi/180))*sin(cos((y+2)*pi/180))*sin(cos((y+2)*pi/180))/(cos((y+2)*pi/180)*cos((y+2)*pi/180))+sin(cos((x+3)*pi/180))*sin(cos((x+3)*pi/180))/(cos((x+3)*pi/180)*cos((x+3)*pi/180))*sin(cos((y+3)*pi/180))*sin(cos((y+3)*pi/180))/(cos((y+3)*pi/180)*cos((y+3)*pi/180))+sin(cos((x+4)*pi/180))*sin(cos((x+4)*pi/180))/(cos((x+4)*pi/180)*cos((x+4)*pi/180))*sin(cos((y+4)*pi/180))*sin(cos((y+4)*pi/180))/(cos((y+4)*pi/180)*cos((y+4)*pi/180)) +sin(cos((x+5)*pi/180))*sin(cos((x+5)*pi/180))/(cos((x+5)*pi/180)*cos((x+5)*pi/180))*sin(cos((y+5)*pi/180))*sin(cos((y+5)*pi/180))/(cos((y+5)*pi/180)*cos((y+5)*pi/180))+sin(cos((x+6)*pi/180))*sin(cos((x+6)*pi/180))/(cos((x+6)*pi/180)*cos((x+6)*pi/180))*sin(cos((y+6)*pi/180))*sin(cos((y+6)*pi/180))/(cos((y+6)*pi/180)*cos((y+6)*pi/180))+sin(cos((x+7)*pi/180))*sin(cos((x+7)*pi/180))/(cos((x+7)*pi/180)*cos((x+7)*pi/180))*sin(cos((y+7)*pi/180))*sin(cos((y+7)*pi/180))/(cos((y+7)*pi/180)*cos((y+7)*pi/180))+sin(cos((x+8)*pi/180))*sin(cos((x+8)*pi/180))/(cos((x+8)*pi/180)*cos((x+8)*pi/180))*sin(cos((y+8)*pi/180))*sin(cos((y+8)*pi/180))/(cos((y+8)*pi/180)*cos((y+8)*pi/180)) +sin(cos((x+9)*pi/180))*sin(cos((x+9)*pi/180))/(cos((x+9)*pi/180)*cos((x+9)*pi/180))*sin(cos((y+9)*pi/180))*sin(cos((y+9)*pi/180))/(cos((y+9)*pi/180)*cos((y+9)*pi/180))+sin(cos((x+10)*pi/180))*sin(cos((x+10)*pi/180))/(cos((x+10)*pi/180)*cos((x+10)*pi/180))*sin(cos((y+10)*pi/180))*sin(cos((y+10)*pi/180))/(cos((y+10)*pi/180)*cos((y+10)*pi/180))+sin(cos((x+11)*pi/180))*sin(cos((x+11)*pi/180))/(cos((x+11)*pi/180)*cos((x+11)*pi/180))*sin(cos((y+11)*pi/180))*sin(cos((y+11)*pi/180))/(cos((y+11)*pi/180)*cos((y+11)*pi/180))+sin(cos((x+12)*pi/180))*sin(cos((x+12)*pi/180))/(cos((x+12)*pi/180)*cos((x+12)*pi/180))*sin(cos((y+12)*pi/180))*sin(cos((y+12)*pi/180))/(cos((y+12)*pi/180)*cos((y+12)*pi/180))+sin(cos((x+13)*pi/180))*sin(cos((x+13)*pi/180))/(cos((x+13)*pi/180)*cos((x+13)*pi/180))*sin(cos((y+13)*pi/180))*sin(cos((y+13)*pi/180))/(cos((y+13)*pi/180)*cos((y+13)*pi/180)) +sin(cos((x+14)*pi/180))*sin(cos((x+14)*pi/180))/(cos((x+14)*pi/180)*cos((x+14)*pi/180))*sin(cos((y+14)*pi/180))*sin(cos((y+14)*pi/180))/(cos((y+14)*pi/180)*cos((y+14)*pi/180))+sin(cos((x+15)*pi/180))*sin(cos((x+15)*pi/180))/(cos((x+15)*pi/180)*cos((x+15)*pi/180))*sin(cos((y+15)*pi/180))*sin(cos((y+15)*pi/180))/(cos((y+15)*pi/180)*cos((y+15)*pi/180))+sin(cos((x+16)*pi/180))*sin(cos((x+16)*pi/180))/(cos((x+16)*pi/180)*cos((x+16)*pi/180))*sin(cos((y+16)*pi/180))*sin(cos((y+16)*pi/180))/(cos((y+16)*pi/180)*cos((y+16)*pi/180))+sin(cos((x+17)*pi/180))*sin(cos((x+17)*pi/180))/(cos((x+17)*pi/180)*cos((x+17)*pi/180))*sin(cos((y+17)*pi/180))*sin(cos((y+17)*pi/180))/(cos((y+17)*pi/180)*cos((y+17)*pi/180))+sin(cos((x+18)*pi/180))*sin(cos((x+18)*pi/180))/(cos((x+18)*pi/180)*cos((x+18)*pi/180))*sin(cos((y+18)*pi/180))*sin(cos((y+18)*pi/180))/(cos((y+18)*pi/180)*cos((y+18)*pi/180))+sin(cos((x+19)*pi/180))*sin(cos((x+19)*pi/180))/(cos((x+19)*pi/180)*cos((x+19)*pi/180))*sin(cos((y+19)*pi/180))*sin(cos((y+19)*pi/180))/(cos((y+19)*pi/180)*cos((y+19)*pi/180)) title 'SHG for N=20'        
gnuplot> splot sin(cos(x*pi/180))*sin(cos(x*pi/180))/(cos(x*pi/180)*cos(x*pi/180))*sin(cos(y*pi/180))*sin(cos(y*pi/180))/(cos(y*pi/180)*cos(y*pi/180))+sin(cos((x+1)*pi/180))*sin(cos((x+1)*pi/180))/(cos((x+1)*pi/180)*cos((x+1)*pi/180))*sin(cos((y+1)*pi/180))*sin(cos((y+1)*pi/180))/(cos((y+1)*pi/180)*cos((y+1)*pi/180))+sin(cos((x+2)*pi/180))*sin(cos((x+2)*pi/180))/(cos((x+2)*pi/180)*cos((x+2)*pi/180))*sin(cos((y+2)*pi/180))*sin(cos((y+2)*pi/180))/(cos((y+2)*pi/180)*cos((y+2)*pi/180))+sin(cos((x+3)*pi/180))*sin(cos((x+3)*pi/180))/(cos((x+3)*pi/180)*cos((x+3)*pi/180))*sin(cos((y+3)*pi/180))*sin(cos((y+3)*pi/180))/(cos((y+3)*pi/180)*cos((y+3)*pi/180))+sin(cos((x+4)*pi/180))*sin(cos((x+4)*pi/180))/(cos((x+4)*pi/180)*cos((x+4)*pi/180))*sin(cos((y+4)*pi/180))*sin(cos((y+4)*pi/180))/(cos((y+4)*pi/180)*cos((y+4)*pi/180)) +sin(cos((x+5)*pi/180))*sin(cos((x+5)*pi/180))/(cos((x+5)*pi/180)*cos((x+5)*pi/180))*sin(cos((y+5)*pi/180))*sin(cos((y+5)*pi/180))/(cos((y+5)*pi/180)*cos((y+5)*pi/180))+sin(cos((x+6)*pi/180))*sin(cos((x+6)*pi/180))/(cos((x+6)*pi/180)*cos((x+6)*pi/180))*sin(cos((y+6)*pi/180))*sin(cos((y+6)*pi/180))/(cos((y+6)*pi/180)*cos((y+6)*pi/180))+sin(cos((x+7)*pi/180))*sin(cos((x+7)*pi/180))/(cos((x+7)*pi/180)*cos((x+7)*pi/180))*sin(cos((y+7)*pi/180))*sin(cos((y+7)*pi/180))/(cos((y+7)*pi/180)*cos((y+7)*pi/180))+sin(cos((x+8)*pi/180))*sin(cos((x+8)*pi/180))/(cos((x+8)*pi/180)*cos((x+8)*pi/180))*sin(cos((y+8)*pi/180))*sin(cos((y+8)*pi/180))/(cos((y+8)*pi/180)*cos((y+8)*pi/180)) +sin(cos((x+9)*pi/180))*sin(cos((x+9)*pi/180))/(cos((x+9)*pi/180)*cos((x+9)*pi/180))*sin(cos((y+9)*pi/180))*sin(cos((y+9)*pi/180))/(cos((y+9)*pi/180)*cos((y+9)*pi/180))+sin(cos((x+10)*pi/180))*sin(cos((x+10)*pi/180))/(cos((x+10)*pi/180)*cos((x+10)*pi/180))*sin(cos((y+10)*pi/180))*sin(cos((y+10)*pi/180))/(cos((y+10)*pi/180)*cos((y+10)*pi/180))+sin(cos((x+11)*pi/180))*sin(cos((x+11)*pi/180))/(cos((x+11)*pi/180)*cos((x+11)*pi/180))*sin(cos((y+11)*pi/180))*sin(cos((y+11)*pi/180))/(cos((y+11)*pi/180)*cos((y+11)*pi/180))+sin(cos((x+12)*pi/180))*sin(cos((x+12)*pi/180))/(cos((x+12)*pi/180)*cos((x+12)*pi/180))*sin(cos((y+12)*pi/180))*sin(cos((y+12)*pi/180))/(cos((y+12)*pi/180)*cos((y+12)*pi/180))+sin(cos((x+13)*pi/180))*sin(cos((x+13)*pi/180))/(cos((x+13)*pi/180)*cos((x+13)*pi/180))*sin(cos((y+13)*pi/180))*sin(cos((y+13)*pi/180))/(cos((y+13)*pi/180)*cos((y+13)*pi/180)) +sin(cos((x+14)*pi/180))*sin(cos((x+14)*pi/180))/(cos((x+14)*pi/180)*cos((x+14)*pi/180))*sin(cos((y+14)*pi/180))*sin(cos((y+14)*pi/180))/(cos((y+14)*pi/180)*cos((y+14)*pi/180))+sin(cos((x+15)*pi/180))*sin(cos((x+15)*pi/180))/(cos((x+15)*pi/180)*cos((x+15)*pi/180))*sin(cos((y+15)*pi/180))*sin(cos((y+15)*pi/180))/(cos((y+15)*pi/180)*cos((y+15)*pi/180))+sin(cos((x+16)*pi/180))*sin(cos((x+16)*pi/180))/(cos((x+16)*pi/180)*cos((x+16)*pi/180))*sin(cos((y+16)*pi/180))*sin(cos((y+16)*pi/180))/(cos((y+16)*pi/180)*cos((y+16)*pi/180))+sin(cos((x+17)*pi/180))*sin(cos((x+17)*pi/180))/(cos((x+17)*pi/180)*cos((x+17)*pi/180))*sin(cos((y+17)*pi/180))*sin(cos((y+17)*pi/180))/(cos((y+17)*pi/180)*cos((y+17)*pi/180))+sin(cos((x+18)*pi/180))*sin(cos((x+18)*pi/180))/(cos((x+18)*pi/180)*cos((x+18)*pi/180))*sin(cos((y+18)*pi/180))*sin(cos((y+18)*pi/180))/(cos((y+18)*pi/180)*cos((y+18)*pi/180))+sin(cos((x+19)*pi/180))*sin(cos((x+19)*pi/180))/(cos((x+19)*pi/180)*cos((x+19)*pi/180))*sin(cos((y+19)*pi/180))*sin(cos((y+19)*pi/180))/(cos((y+19)*pi/180)*cos((y+19)*pi/180))+sin(cos((x+20)*pi/180))*sin(cos((x+20)*pi/180))/(cos((x+20)*pi/180)*cos((x+20)*pi/180))*sin(cos((y+20)*pi/180))*sin(cos((y+20)*pi/180))/(cos((y+20)*pi/180)*cos((y+20)*pi/180)) title 'SHG for N=21' 

Comments

Popular posts from this blog

NEWTON-RAPSON METHOD FOR HEAT FLOW

##Constants and initializations
a=5.67E-8; ## Stefan-Boltzman constant[Watt/meter^2Kelvin^4]
e=0.8; ## Rod surface emissivity [Dimensionless]
h=20; ## Heat transfer coefficient of air flow [W/m^2-K]
Tinf=Ts=25; ## Temperature of air and the walls of the close[Celcius]
D=0.1; ## Diameter of the rod[meter]
I2R=100; ## Electric power dissipated in rod (Ohmic Heat)[W]
T=[]; ## Temperature of the rod[*C]
T(1)=25; ## Initial guess of the temperature of the rod[*C]
Q=[]; ## Heat function [W]
Qp=[]; ## First derivative of Q wrt T [W/C*].
for i=1:100
Q(i)=pi*D*(h*(T(i)-Tinf)+e*a*(T(i)^4-Ts^4))-I2R;
Qp(i)=pi*D*(h+4*e*a*T(i)^3);
T(i+1)=T(i)-Q(i)/Qp(i); ## Newton-Rapson Method
endfor
printf('The steady state temperature is %f\n',T(i+1))
save -text HeatFlowTemp.dat
## The plot
t=1:100; ##temperature
for n=1:100
H(n)=pi*D*(h*(t(n)-Tinf)+e*a*(t(n)^4-Ts^4))-I2R;
endfor
plot(t,H)
xlabel('T(Celcius)');
ylabel('Q(Watt)');
legend('Q(T)');
title('Heat flow vs Temperatu…