%the function is for solving of the nonlinear kdv burger equation for the
%ion acoustic waves
% The kdv differential eqn converted to a second order differential eqn is:
% del^2 chi1/del rho^2 = [mu(1-BC)((mu^2/2 -1)chi1 -1)]AB/mu , where A,
% B,C are given by equations as given below in codes
% x denotes rho, y denotes chi1
function dy = kdvnonlin(x,y)
G=6.67*10^-11;
mi=1.67*10^-27;
sigma=0.1;
kappa=100;
gamma=3;
mu=1.0367*10^4;
chi_i=9*10^-1;
lambdaJ=2.1*10^28;
omegaJ=11.83*10^-13;
pi=3.1416;
X=(kappa-0.5)./(kappa-1.5);
A=(4.*pi.*G.*mi.*sigma.*(kappa-0.5))./(kappa-1.5);
B=((1-gamma).*sigma.*X)+(2.*sigma.*X)+1-(sigma.*X.*mu.*(mu+(chi_i./((lambdaJ).^2.*omegaJ)))).^-1;
C=((kappa-1.5)+ sigma.*(kappa-0.5).*(gamma-1))./(kappa-1.5);
y=[0;0];
dy=zeros(2,1);
dy(1)=y(2);
dy(2)= (mu.*(1-B.*C).*((mu.^2)-1).*y(1)-1).*((A.*B)./mu);
%Stability analysis of acoustic waves in nonlinear mode
% this is the main program to call the function
clear all
y0=[1e-2 1e-5];
xspan=0.001:0.1:10;
options=odeset('RelTol',1e-5);
[x,y]=ode45(@(x,y) kdvnonlin(x,y),xspan,y0,options);
%[x,y]=ode45('kdvnonlin',xspan,y0,options);
figure (1)
plot(x
,1),y
,1),'b--');
xlabel('X');
ylabel('Y');
hold on