Solving non homogenous differential equations numerically using ode45 etc
Show older comments
How is a non homogenous differential equation solved in MATLAB using ode45 or ode23. I have a function like:- dmdt = a*exp(Asin(wt) + (2-m)^2);
Can I obtain the numerical solution for this?
Thanks in advance
Accepted Answer
More Answers (1)
Orion
on 29 Oct 2014
1 vote
you can rewrite your equation as :
dmdt + a*exp(Asin(wt)) * exp((2-m)^2) = 0
which is of the form of
y'(t) + f(t)y(t) = g(t)
with
y'(t) = dmdt
f(t) = a*exp(Asin(wt))
y(t) = exp((2-m)^2)
g(t) = 0
Look how it is resolved and just adapt it to your problem.
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!