Ordinary differential equation (ode) Extra question & Matlab Apps /4/23 Example Solve the following problem to find for with
Download 0.62 Mb.
|
Class Day 9
ORDINARY DIFFERENTIAL EQUATION (ODE) Extra question & Matlab Apps1/4/23Example 1 Solve the following problem to find forwith
withDevelop your own MATLAB programming.% dy/dx=3sinx, y(0)=0% dy/dx=3sinx, y(0)=0%Step 1: Define x1, x2, x3,...delx=pi/10;x=0:delx: 2*pi;%Step 2: define f(x)=dydxf=@(x) 3*sin(x);%Step 3: define the initial condition y(0)=0y(1)=0;%Step 4: Implement the numerical scheme y_i+1=y_i+delx f_ifor i=1: length(x)-1y(i+1)=y(i)+delx*f(x(i))end%Step 5: plot the solutionplot(x,y)withUse the MATLAB built in function ode23clearclear% dy/dx=3sinx, y(0)=0%Step 1: Define x1, x2, x3,...delx=pi/10;x=0:delx: 2*pi;%Step 2: define f(x)=dydxf=@(x) 3*sin(x);%Step 3: define the initial condition y(0)=0y0=0;%Step 4: use ode23[x,y] = ode23(@(x,y) f(x), x, y0);%plot the solutionplot(x,y)Exercise Solve the following problem to find forwith
Example 2- Drug DosingConsider a patient who is being given morphine at a rate of 2.5 mg/hr. Their body metabolizes the drug at a rate of 30% per hour.Write a differential equation for the amount of morphine in the patient over time.Rate of morphine given to the patient: 2.5mg/hrMorphine inside patient’s body Rate of morphine being metabolizes (30/100)*M(t)/hr The Differential EquationWrite a differential equation for the amount of morphine in the patient over time.Rate of morphine given to the patient: 2.5mg/hrMorphine inside patient’s body Rate of morphine being metabolizes (30/100)*M(t)/hr The rate of morphine inside the body=rate in- rate out The analytical solutionSubstitute the Initial condition, Plot the numerical solutionDesign the MATLAB AppsShare your ideas!Exercise- AquariumAn aquarium holding 25 of water at a zoo is kept clean using a large pipe system equipped with filters. Water is pumped into and out of the aquarium at constant rate of per day. In the pipe flowing into the aquarium, a filter has broken down, so ammonia (toxic to fish) is flowing into the tank with the water, at a concentration of 150 g / . The water in the aquarium starts out at time t = 0 free of ammonia.Write a differential equation for the amount of ammonia in the aquarium over time.Rate of ammonia into the aquarium 150 g / per day=S Ammonia in Aquarium Rate of ammonia flow out per day Exercise- AquariumWrite a differential equation for the amount of ammonia in the aquarium over time.Rate of ammonia into the aquarium 150 g / per day=S Ammonia in Aquarium Rate of ammonia flow out per day Exercise- Aquarium
Final AssessmentDevelop a MATLAB Apps that related to the application of Ordinary Differential Equation in real life problem.You will need to 1. Submit a report (Individually) 60%2. Present about your MATLAB Apps (Work in group) 40%The Report
Part I: About this course What you have learned in this course? How do you feel about this course? How this course can benefit you in future?Part II: About your MATLAB Apps The background of the problem The objective of the Apps The programming and designSummaryThe Presentation
SummaryRAHMAT Download 0.62 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling