Solving 2 differential equations simultaneously
4 次查看(过去 30 天)
显示 更早的评论
I am trying to solve 2 equations with 2 variables.
Eq 1: w''(t)=-0.03.w'(t)/r(t)
Eq 2: w'(t)=-0.005.w(t)/r(t)
w(0)=0.6, w'(0) = 0.001, r(0)=12
I could not find a way to solve the 2 equations using ode45.
tspan=[0 500];
w0=0.6;
r0=12;
[t,w,r] = ode45(@angvel, tspan, w0,r0);
function dwdt = angvel(t,w,r)
dwdt = -0.005*w/(0.01*r);
end
The error when I try to solve Eq1 is insufficient inputs. Where am I going wrong? Please advise. Thanks!
2 个评论
Aquatris
2018-8-8
I might be wrong but the initial conditions do not seem to satisfy the equation 2. Are you sure these are the equations?
回答(1 个)
Diwakar Ravichandran
2018-8-8
Hi Bhagyashree,
As I was going through your equations, I noticed that when you substitute equation 2 in equation 1 we get,
w"(t) = (1.5*10^-4)*[w(t)/r^2(t)];
which is a single equation with 2 unknown variables and hence it cannot be solved using conventional methods. You would need to gather more information about the unknowns and their behavior to solve this equation.
Hope this helps,
Cheers!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!