使用MATLAB求解ODE
-
02-10-2019 - |
题
我有以下颂歌:
b'(t) + k16*b(t) = k15*a(t)
其中K15和K16是常数。
关于如何解决的想法吗?
谢谢!阿米特
解决方案
那是一阶颂歌。有一个分析解决方案(只需使用集成因素)即可。无需集成。http://www.math.hmc.edu/calculus/tutorials/odes/
但是,如果您想在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.
不隶属于 StackOverflow