I have the following ODE:
b'(t) + k16*b(开发者_如何学Pythont) = k15*a(t)
where k15 and k16 are constants.
Any idea on how to solve it?
Thanks! Amit
That's a first order ODE. There's an analytical solution for it (just use an integrating factor). No integration required. http://www.math.hmc.edu/calculus/tutorials/odes/
However, if you want to solve it in MATLAB:
>> k15 = 0.2; k16 = 0.3; % type your constants here
>> a = @(t) t^2; % type your expression for a here
>> dbdt = @(t,b) -k16*b + k15*a(t);
>> tf = 10; % final time of integration
>> b0 = 1; % initial value of b
>> [t,y] = ode45(@dbdt,[0 tf],b0)
>> plot(t,y) % display solution.
精彩评论