class: center, middle, inverse, title-slide .title[ # ODEs and Modelling ] .subtitle[ ## Session 01 ] .author[ ### Alejandro Ucan ] .date[ ### 2023-09-17 ] ---
# Session's Goals * Defining Differential Equations (DE). <br/><br/> * Modelling with DE. <br/><br/> * Slope fields and qualitative understanting. <br/><br/> * Solutions of DE (family and IVP). <br/><br/> --- # What is a DE? > __Defintion:__ a _Differential Equation_ is an equation that contains derivatives or incognite functions with respect to one or more independent variables. <br/><br/><br/> We said that a DE is _ordinary_ if the derivative functions are considered of one variable, and _partial_ if the derivative functions are of several variables. #### Examples: * `\(\frac{dy}{dx}+5y=e^x,\)` `\(\frac{d^2y}{dx^2}-\frac{dy}{dx}+6y=0\)` รณ `\(\frac{dx}{dt}+\frac{dy}{dt}=2x+y.\)` <br/><br/> * `\(\frac{\partial^2 u}{\partial x^2}+\frac{\partial^2 u}{\partial y^2}=0\)` `\(\frac{\partial u}{\partial y}=-\frac{\partial u}{\partial x}.\)` --- ## Classification of ODEs. > ODEs are classified by: * The order of the derivative: <br/><br/> * First order: `\(y'=y,\)` or `\(y'sin(x)=y.\)` <br/> * Second, third, and so on involve derivatives of that order. <br/><br/> * Linearity: <br/><br/> * Linear: the function `\(y\)` and its derivatives are raised to the power of 1, and the coefficients only depend on `\(x.\)` `$$y''+y'+6=0.$$` * Non-linear: the function `\(y\)` or its derivatives are raised to a power greater than 1, or the coefficients depend on `\(x\)` and `\(y\)` or its derivatives. `$$(1-y)y'+2y=e^x,$$` `$$(y'')^3+sin(y)=0.$$`$ --- ## Solutions of an ODE. > __Definition:__ Let `\(f\)` be a function defined in an interval `\(I,\)` with continuous derivatives in `\(I\)` (as many derivatives as the order of the equation) is a solution of a differential equation if when we substitute the function we obtain an identity. -- #### Example: The function `\(f(x)=e^x\)` defined in `\(\mathbb{R}\)` is a solution of the DE `$$y'-y=0.$$` <br/><br/> Let's check it out: `$$f'(x)-f(x)=e^x-e^x=0.$$` --- ### Implicit solutions. > __Definition:__ Sometimes the solutions of a DE can be expressed as a relation `\(G(x,y)=0,\)` where `\(G\)` is a function of two variables, but always thinking that there is a function that satisfies this relation. <br/><br/> -- #### Example: The relation `\(x^2+y^2=1\)` is a solution of the DE `\(yy'+x=0.\)` <br/><br/> --- # Separable ODEs > __Definition:__ A DE is said to be __separable__ if it can be written in the form `$$\frac{dy}{dx}=g(x)h(y).$$` -- #### Example: Consider the DE `\(y'=x^2y.\)` <br/><br/> This DE is separable, since we can write it as `$$\frac{dy}{dx}=x^2y,$$` `$$\frac{dy}{y}=x^2dx.$$` But not all DEs are separable, for example `\(y'=x^2+y.\)` --- ## Method: Separation of Variables > If our equation is separable of the form `$$\frac{dy}{dx}=g(x)h(y).$$` Then we can solve it by the following steps: * We separate the variables `\(y\)` and `\(x\)` on one side of the equation `\(\frac{dy}{h(y)}=g(x)dx.\)` * We integrate both sides of the equation. `\(\int \frac{dy}{h(y)}=\int g(x)dx.\)` * We aggregate a constant to only one of the integration. `\(\int \frac{dy}{h(y)}=\int g(x)dx+C.\)` * Antiderivatives will form a _relation_ that will act as a solution. --- #### Example 1: > Solve `\((1+x)\frac{dy}{dx}-y=0.\)` -- It is separable since after manipulation we have: `$$\frac{dy}{dx}=\frac{y}{1+x}.$$` Then we have: `$$\frac{dy}{y}=\frac{dx}{1+x}.$$` Integrating both sides we have: `$$\int \frac{dy}{y}=\int \frac{dx}{1+x},$$` `$$ln|y|=ln|1+x|+C.$$` Then we have: `$$y=C(1+x).$$` --- #### Example 2: > Find the solution family of `\(\frac{dy}{dx}=e^{3x+2y}.\)` -- It is separable since after manipulation we have: `$$\frac{dy}{dx}=e^{3x}e^{2y}.$$` Then we have: `$$\frac{dy}{e^{2y}}=e^{3x}dx.$$` Integrating both sides we have: `$$\int \frac{dy}{e^{2y}}=\int e^{3x}dx \Rightarrow-\frac{1}{2}e^{-2y}=\frac{1}{3}e^{3x}+C.$$` Then we have: `$$e^{-2y}=-\frac{2}{3}e^{3x}+C.$$` Finally we have: `\(y=-\frac{1}{2}ln(-\frac{2}{3}e^{3x}+C).\)` --- # Modelling with ODEs > __Definition:__ A model is a mathematical representation of a real situation. Modelling with ODEs means that our real situation can be represented by a DE. ## Growth and Decay > __Hypothesis:__ The rate of change of a variable is proportional to the size of its ammount at all times . <br/><br/> `$$\frac{dx}{dt}=kx.$$` #### Example: An slice of bread has a bacteria population of 1000. If the rate of growth of the bacteria is 3/2 the size of the population. What function models the population of bacteria? --- ## Let's solve previous example. Note that previous equation is separable: `$$\frac{dx}{dt}=kx\Rightarrow\frac{dx}{x}=kdt.$$` Therefore we have: `$$\int \frac{dx}{x}=\int kdt\Rightarrow ln|x|=kt+C.$$` Then we have: `$$x=Ce^{kt}.$$` Therefore we have that `\(B(t)=Ce^{3t/2}.\)` But we know that at the start of observations, we had `\(B(0)=1000,\)` therefore `$$B(0)=Ce^{3(0)/2}=1000,$$` `$$C=1000.$$` Then we have that `\(B(t)=1000e^{3t/2}.\)` --- ## Initial Value Problems. > __Definition:__ An __Initial Value Problem__ is a DE plus a condition that the solution must satisfy. ##### Remark: The solution of an IVP is a function that satisfies the DE and the condition, therefore this one is unique in the case that exists such function. --- ### Temperature problems #### Newton's law for cooling/heating. > The rate of change of the temperature of a body is proportional to the difference between the temperature of the body and the temperature of the medium in which it is located. <br/><br/> $$ \frac{dT}{dt}=k(T-T_m).$$ #### Example: A cup of coffee is at `\(90^\circ C\)` and is placed in a room at `\(22^\circ C.\)` After 2 minutes the temperature of the coffee is `\(80^\circ C.\)` What function models the temperature of the coffee?