coupled differential equation with constant coefficients

here 'kappa' and 'sigma' are constants. The boundary conditions are;
R(-1)=1
S(1)=0
kappa=1.
I tried it using dsolve but the graph obtained werenot correct. If anyone can solve it using bvp4c in the region (0,2) , it would be of great help.

 Accepted Answer

This code solves the given BV problem. See the documentation for details.
x = linspace(-1, 1, 100);
init = bvpinit(x, [0; 0]);
sol = bvp4c(@odeFun, @bvFun, init);
subplot(2,1,1);
plot(sol.x, real(sol.y));
title('real(sol)');
legend({'R', 'S'})
subplot(2,1,2);
plot(sol.x, imag(sol.y));
title('imaginary(sol)');
legend({'R', 'S'})
function dRSdz = odeFun(z, RS)
sigma = 1;
kappa = 2;
dRdz = 1i*sigma*RS(1) + 1i*kappa*RS(2);
dSdz = -1i*sigma*RS(2) - 1i*kappa*RS(1);
dRSdz = [dRdz; dSdz];
end
function res = bvFun(RSa, RSb)
res = [RSa(1)-1;
RSb(2)-0];
end

3 Comments

@Ameer hamza,
Please have a look at the following picture.
Here kappa and L can be chosen but i have to generate a plot between normalised wavelength and the reflectivity.
The norm wavelegth is also a function of sigma given by,
norm wave=1/(1+L*sigma/pi*10000).
What i did earlier was create an array for sigma.
Calculated values of norm wave at these discrete sigma values.
By the solution of above diff eqn, calculated discrete values of reflectivity.
And plotted them. For kappa*L=2,8.
I am not sure what is the question here?

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!