Numerical Methods for Ordinary Differential Equations
暂无分享,去创建一个
and in each case one should label the axes and curves via xlabel, ylabel and legend. One may now experiment with different time spans, initial conditions, and parameters (just a for now). As a second example we encode the molecular switch in equation 29 on page 290 via function dx = switch29(t, x) dx(1, 1) = x(1) − x(1)2− 2 ∗ x(1) ∗ x(2); dx(2, 1) = x(2) − x(2)2− 2 ∗ x(1) ∗ x(2); To better appreciate what ode23 is up to we now embark on our own approximation scheme. It is really just a step back to the early part of the course, for we will replace the differential equation, (1), with the difference equation x1(tn+1) − x1(tn) dt = x1(tn) − x 3 1(tn) − ax2(tn) x2(tn+1) − x2(tn) dt = x1(tn) − x2(tn) (2)