Solving a System of 2nd Order Linear ODE? "Explicit solutions cannot be found"
이전 댓글 표시
I've been trying to solve the linear 2nd order system below, but Matlab keeps saying there isn't a solution. Clearly, there's a solution because the solution will be the intersection of two sine and cosine waves of the same amplitude and phase shift. Because of this, I'm assuming the error is coming from syntax instead of from the math. Can someone take a look at it? Thanks in advanced.
This is the systems of equations I'm trying to solve:
x'' = G*M*sin(theta + 2*pi*t)/(x^2 + y^2)
y'' = G*M*cos(theta + 2*pi*t)/(x^2 + y^2)
Here's the code:
% variables
G = 6.674 * (10.^(-11));
M = 1.9886 * (10.^30);
t = 0:.005:.7;
xi = .44503 * 149.598 * 10.^9; % Initial x dist (AU --> m)
yi = .88106 * 149.598 * 10.^9; % Initial y dist (AU --> m)
thetai = atan((yi/xi)); % Initial angle from x-axis
% Calculations
syms x(t) y(t)
odex = diff(x) == diff(((G*M)./(x.^2 + y.^2)) .* cos(thetai + (2*pi).*t));
odey = diff(y) == diff(((G*M)./(x.^2 + y.^2)) .* sin(thetai + (2*pi).*t));
odes = [odex; odey]
S = dsolve(odes) % Returns not solvable here
댓글 수: 1
John D'Errico
2017년 4월 29일
You misunderstand what MATLAB is telling you. That dsolve says there is no solution merely means there is no analytical solution. There may well be a solution. But an analytical solution, in terms of radicals, etc., no. There are many problems for which this is true, and they are easy to find.
So just use a numerical ODE solver, like ode45.
답변 (1개)
Karan Gill
2017년 4월 29일
0 개 추천
Since you're starting with floating point numbers, you should try a numerical simulation using ode45 or other numeric ODE solver. If you start numeric, stay numeric. Further, since a closed form symbolic solution couldn't be found, numeric is your remaining option.
Also, you declared "t" as a vector of numbers. But when "x(t)" and "y(t)" are defined then "t" gets overwritten by the symbolic variable "t".
카테고리
도움말 센터 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!