# 1.2 Discretizing ODEs

## 1.2.1 First-order ODEs

Many interesting physical phenomena can be modeled by a first-order ODE of the form

 $u_ t=f(u(t)), u(1)=u_0, 0 where $$u(t)$$ is the time-dependent state of the system, $$u_ t=du/dt$$ is the time-derivative of the state, $$f(u(t))$$ is the forcing function depending on the state, $$u_0$$ is the initial condition, and $$0<t<T$$ indicates that we want to solve the problem forward in time until time $$t=T$$. We will begin by considering scalar problems where $$u(t)\in \mathbb {R}$$ (a real number), but in 1.6 Systems of ODE's and Eigenvalue Stability we will extend to the vector-valued case where $$\mathbf{u}(t)\in \mathbb {R}$$ is a $$d$$-dimensional state vector. ## Example Consider transient heat transfer associated to convective heating or cooling (see 16. Unified notes on Thermodynamics and Propulsion, Section 18.3). The first law states that the heat into the object is given by the product $$\rho V c T_ t$$ where $$\rho$$ is the density, $$V$$ is the volume, and $$c$$ is the specific heat. Let $$h$$ be the heat transfer coefficient and $$A$$ be the surface area of the body, then the time evolution of temperature is given by  \[A h (T-T_\infty ) = - \rho V c T_ t. \label{eq:evtemp}$ (1.2)

Let $$u(t)$$ be the non-dimensional temperature difference $$(T-T_\infty )/(T_ i-T_\infty )$$ where $$T(t)$$ is the time-dependent temperature in the body (assumed constant throughout, i.e., small Biot number), $$T_\infty$$ is the surrounding ambient temperature, and $$T_ i$$ is the initial temperature of the body at time $$t=0$$. Then the governing equation is

 $u_ t = -\lambda u$ (1.3)

where $$\lambda = \frac{h A}{\rho V c}$$. The initial condition is $$u(0)=1$$.

Write down the analytical solution to the initial value problem and plot it in MATLAB® for values $$h=3$$, $$A=4$$, $$\rho =10$$, $$V=9$$, and $$c=1$$. What is the value of $$u(2)$$? Please answer with at least 3 significant digits.

Exercise 1