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.

 Respuesta aceptada

Ameer Hamza
Ameer Hamza el 22 de Abr. de 2020
Editada: Ameer Hamza el 22 de Abr. de 2020
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 comentarios

@Ameer hamza,
Please have a look at the following picture.
vipul kumar
vipul kumar el 23 de Abr. de 2020
Editada: vipul kumar el 23 de Abr. de 2020
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?

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 22 de Abr. de 2020

Comentada:

el 23 de Abr. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by