How should I solve coupled differential non linear equations? Given below.

8 views (last 30 days)
I want to solve equations A and B to find beta. Please help. lambda = 1.550; zmax = 2290; zmin = 300; N = 50; z = zeros(0,N); phi = zeros(0,N); r2 = 5; phimax = 50; phimin = 1; mu0 = 4*pi*10^-1; epsilon0 = 8.85*10^-6; k = 2*pi/lambda; for n = 1:N z(n)= ((n-1)*(zmax-zmin))/(N-1)+zmin; phi(n)= ((n-1)*(phimax-phimin))/(N-1)+phimin;
end
n1 = z.*(1-0.015.*exp(-r2)/1.795); h(phi) = ((sqrt(epsilon0/mu0).*(1/k).*(beta(z).*e(z)+W)));
e(phi) = -((sqrt(mu0/epsilon0).*(1./k.*n(z).^2).*(beta(z).*h(z)+V))); e(z)=-1/1i.*((sqrt(mu0/epsilon0).*(1./k.*n(z).^2).*(T-Q))); h(z)= 1/1i.*((sqrt(epsilon0/mu0).*(1/k.*z).*(U-S)));
syms z f(z)=1i.*h(z); V=diff(f,z); syms z f(z)=1i.*e(z); W=diff(f,z);
syms z f(z)=z.*h(phi); T=diff(f,z); syms z f(z)=z.*e(phi); U=diff(f,z); syms z f(z) = ln(n1(z).^2); df = diff(f,z); syms z f(z)=e(z); P=diff(f,z); syms z f(z)=h(z); Q=diff(f,phi); syms z f(z)=h(z); R=diff(f,phi); syms z f(z)=e(z); S=diff(f,phi);
A= del2(e(z))+(n1(z)^2.*k^2-beta(z)).*e(z)-(df.*(beta(z)./((n1(z)^2.*k^2-beta(z)))).*(beta(z).*P+sqrt(mu0/epsilon0).*(k./z).*R)); B = del2(h(z))+(n1(z)^2.*k^2-beta(z)).*h(z)-(df.*(beta(z)./((n1(z)^2.*k^2-beta(z)))).*(Q-(beta(z)./k.*z).*sqrt(epsilon0/mu0).*S));
  2 Comments
Star Strider
Star Strider on 30 Jan 2017
If they are nonlinear, it is best to not use the Symbolic Math Toolbox, since very few nonlinear equations have analytic solutions.
Integrate them numerically with ode45 (or ode15s or whatever ODE solver is most appropriate to your functions).
chetna sharma
chetna sharma on 31 Jan 2017
Thanks Star. I was trying to use ode45- couplode = @(t,z) [ del2(e(z))+(n1(z)^2.*k^2-beta(z)).*e(z)-(df.*(beta(z)./((n1(z)^2.*k^2-beta(z)))).*(beta(z).*P+sqrt(mu0/epsilon0).*(k./z).*R));del2(h(z))+(n1(z)^2.*k^2-beta(z)).*h(z)-(df.*(beta(z)./((n1(z)^2.*k^2-beta(z)))).*(Q-(beta(z)./k.*z).*sqrt(epsilon0/mu0).*S))]; [t,y] = ode45(couplode, [0 0.49*pi], [1;1]*1E-8); figure(1) plot(t, y) grid str = {'$$ \dot{y} $$', '$$ y $$', '$$ \dot{x} $$', '$$ x $$'}; legend(str, 'Interpreter','latex', 'Location','NW') after taking help from one of the answers here posted by someone.
But its not working. I don't know how to use it correctly as I have never used ode before. Can you please help ?
Thanks Chetna.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!