필터 지우기
필터 지우기

issue with solving system of odes in matlab

조회 수: 3 (최근 30일)
Wajahat
Wajahat 2017년 10월 5일
댓글: Walter Roberson 2018년 1월 24일
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.

채택된 답변

Walter Roberson
Walter Roberson 2017년 10월 5일
편집: Walter Roberson 2018년 1월 24일
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
Wajahat
Wajahat 2018년 1월 23일
@Roberson, can you provide me the code of the above solution
Walter Roberson
Walter Roberson 2018년 1월 24일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by