Effacer les filtres
Effacer les filtres

issue with solving system of odes in matlab

1 vue (au cours des 30 derniers jours)
Wajahat
Wajahat le 5 Oct 2017
Commenté : Walter Roberson le 24 Jan 2018
syms l g t A omg k
syms f1(x) f2(x)
S = dsolve(diff(f1) == l*f1 + sqrt(g)*A*exp(i*omg*t-i*k*x)*f2, diff(f2) == -sqrt(g)*A*exp(-i*omg*t+i*k*x)*f1 -l*f2)
S.f1
S.f2
matlab shows error when i solve the above mentioned ode in matlab, is there anyone who can guide me to remove the error.

Réponse acceptée

Walter Roberson
Walter Roberson le 5 Oct 2017
Modifié(e) : Walter Roberson le 24 Jan 2018
MATLAB is not powerful enough to solve that analytically. Maple says that the solution is
f1(x) = -(1/2)*exp(1i*omg*t)*(C2*(1i*k-(-k^2-4*A^2*g+(4i)*k*l+4*l^2)^(1/2)+2*l)*exp((1/2)*(1i*k-(-k^2-4*A^2*g+(4i)*k*l+4*l^2)^(1/2))*x)+C1*exp((1/2)*(1i*k+(-k^2-4*A^2*g+(4i)*k*l+4*l^2)^(1/2))*x)*(1i*k+(-k^2-4*A^2*g+(4i)*k*l+4*l^2)^(1/2)+2*l))/(g^(1/2)*exp(i*k*x)*A)
f2(x) = C1*exp((1/2)*(1i*k+(-k^2-4*A^2*g+(4*1i)*k*l+4*l^2)^(1/2))*x)+C2*exp((1/2)*(1i*k-(-k^2-4*A^2*g+(4*1i)*k*l+4*l^2)^(1/2))*x)
Here, C1 and C2 are arbitrary constants of integration that depend upon the boundary conditions.
  2 commentaires
Wajahat
Wajahat le 23 Jan 2018
@Roberson, can you provide me the code of the above solution
Walter Roberson
Walter Roberson le 24 Jan 2018
simplify( dsolve([diff(f1(x), x) = l*f1(x)+A*g^(1/2)*exp(-I*k*x+I*omg*t)*f2(x), diff(f2(x), x) = -l*f2(x)-A*g^(1/2)*exp(I*k*x-I*omg*t)*f1(x)]), size)
This is Maple code, not MATLAB code.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by