Initial Value Problems

Similar documents
Simulation-Solving Dynamic Models ABE 5646 Week 2, Spring 2010

Ordinary Differential Equations

CHEMICAL KINETICS: 1. Rate Order Rate law Rate constant Half-life Temperature Dependence

Solutions to Assignment 1

MA Study Guide #1

Unsteady Mass- Transfer Models

Ordinary dierential equations

1.6. Slopes of Tangents and Instantaneous Rate of Change

Comparison between the Discrete and Continuous Time Models

Math 333 Problem Set #2 Solution 14 February 2003

2) Of the following questions, which ones are thermodynamic, rather than kinetic concepts?

Chapter 2. First Order Scalar Equations

KINEMATICS IN ONE DIMENSION

2.1: What is physics? Ch02: Motion along a straight line. 2.2: Motion. 2.3: Position, Displacement, Distance

Chapter 3 Boundary Value Problem

A First Course on Kinetics and Reaction Engineering. Class 19 on Unit 18

Lecture 13 RC/RL Circuits, Time Dependent Op Amp Circuits

Parametrics and Vectors (BC Only)

Mathcad Lecture #8 In-class Worksheet Curve Fitting and Interpolation

dt = C exp (3 ln t 4 ). t 4 W = C exp ( ln(4 t) 3) = C(4 t) 3.

MA 214 Calculus IV (Spring 2016) Section 2. Homework Assignment 1 Solutions

Some Basic Information about M-S-D Systems

04. Kinetics of a second order reaction

3.6 Derivatives as Rates of Change

Math 116 Second Midterm March 21, 2016

Finite Element Analysis of Structures

APPM 2360 Homework Solutions, Due June 10

Q.1 Define work and its unit?

Sub Module 2.6. Measurement of transient temperature

MOMENTUM CONSERVATION LAW

dy dx = xey (a) y(0) = 2 (b) y(1) = 2.5 SOLUTION: See next page

Elementary Differential Equations and Boundary Value Problems

Math 334 Test 1 KEY Spring 2010 Section: 001. Instructor: Scott Glasgow Dates: May 10 and 11.

Chapter 13 Homework Answers

Morning Time: 1 hour 30 minutes Additional materials (enclosed):

Unit 1 Test Review Physics Basics, Movement, and Vectors Chapters 1-3

PHYS 1401 General Physics I Test 3 Review Questions

F.LE.A.4: Exponential Growth

Chapter 15: Phenomena. Chapter 15 Chemical Kinetics. Reaction Rates. Reaction Rates R P. Reaction Rates. Rate Laws

Math 105 Second Midterm March 16, 2017

EXERCISES FOR SECTION 1.5

PROBLEMS FOR MATH 162 If a problem is starred, all subproblems are due. If only subproblems are starred, only those are due. SLOPES OF TANGENT LINES

LAPLACE TRANSFORM AND TRANSFER FUNCTION

1. VELOCITY AND ACCELERATION

Announcements: Warm-up Exercise:

Problem Set #1. i z. the complex propagation constant. For the characteristic impedance:

Mathcad Lecture #7 In-class Worksheet "Smart" Solve Block Techniques Handout

Physics 180A Fall 2008 Test points. Provide the best answer to the following questions and problems. Watch your sig figs.

Physics 235 Chapter 2. Chapter 2 Newtonian Mechanics Single Particle

6.003 Homework 1. Problems. Due at the beginning of recitation on Wednesday, February 10, 2010.

EXPLICIT TIME INTEGRATORS FOR NONLINEAR DYNAMICS DERIVED FROM THE MIDPOINT RULE

MATH 128A, SUMMER 2009, FINAL EXAM SOLUTION

LabQuest 24. Capacitors

ODEs II, Lecture 1: Homogeneous Linear Systems - I. Mike Raugh 1. March 8, 2004

AP CALCULUS AB 2003 SCORING GUIDELINES (Form B)

Math Final Exam Solutions

y = (y 1)*(y 3) t

EE 301 Lab 2 Convolution

CHBE320 LECTURE IV MATHEMATICAL MODELING OF CHEMICAL PROCESS. Professor Dae Ryook Yang

ENGI 9420 Engineering Analysis Assignment 2 Solutions

Math 1b. Calculus, Series, and Differential Equations. Final Exam Solutions

2002 November 14 Exam III Physics 191

Sterilization D Values

Energy Transport. Chapter 3 Energy Balance and Temperature. Temperature. Topics to be covered. Blackbody - Introduction

UCLA: Math 3B Problem set 3 (solutions) Fall, 2018

AP CALCULUS AB/CALCULUS BC 2016 SCORING GUIDELINES. Question 1. 1 : estimate = = 120 liters/hr

4.6 One Dimensional Kinematics and Integration

Math 115 Final Exam December 14, 2017

Lecture 2-1 Kinematics in One Dimension Displacement, Velocity and Acceleration Everything in the world is moving. Nothing stays still.

Embedded Systems and Software. A Simple Introduction to Embedded Control Systems (PID Control)

Polymerization Technology Laboratory

MA 366 Review - Test # 1

Single and Double Pendulum Models

2001 November 15 Exam III Physics 191

ME425/525: Advanced Topics in Building Science

Basic Circuit Elements Professor J R Lucas November 2001

CSE 3802 / ECE Numerical Methods in Scientific Computation. Jinbo Bi. Department of Computer Science & Engineering

Structural Dynamics and Earthquake Engineering

Suggested Problem Solutions Associated with Homework #5

CHE302 LECTURE IV MATHEMATICAL MODELING OF CHEMICAL PROCESS. Professor Dae Ryook Yang

AP Chemistry--Chapter 12: Chemical Kinetics

6.003 Homework #8 Solutions

Module 2 F c i k c s la l w a s o s f dif di fusi s o i n

University Physics with Modern Physics 14th Edition Young TEST BANK

Differential Geometry: Numerical Integration and Surface Flow

System of Linear Differential Equations

v x + v 0 x v y + a y + v 0 y + 2a y + v y Today: Projectile motion Soccer problem Firefighter example

Equations of motion for constant acceleration

ACCUMULATION. Section 7.5 Calculus AP/Dual, Revised /26/2018 7:27 PM 7.5A: Accumulation 1

ln 2 1 ln y x c y C x

Solutions Problem Set 3 Macro II (14.452)

IB Physics Kinematics Worksheet

Physics 101: Lecture 03 Kinematics Today s lecture will cover Textbook Sections (and some Ch. 4)

Guest Lecturer Friday! Symbolic reasoning. Symbolic reasoning. Practice Problem day A. 2 B. 3 C. 4 D. 8 E. 16 Q25. Will Armentrout.

04. Kinetics of a second order reaction

Ordinary differential equations. Phys 750 Lecture 7

Oscillations. Periodic Motion. Sinusoidal Motion. PHY oscillations - J. Hedberg

Predator - Prey Model Trajectories and the nonlinear conservation law

Name: Teacher: DO NOT OPEN THE EXAMINATION PAPER UNTIL YOU ARE TOLD BY THE SUPERVISOR TO BEGIN PHYSICS FINAL EXAMINATION June 2010.

= ( ) ) or a system of differential equations with continuous parametrization (T = R

Transcription:

Iniial Value Problems ChEn 2450 d d f(, ) (0) 0 6 ODE.key - November 26, 2014

Example - Cooking a Lobser Assumpions: The lobser remains a a uniform emperaure. This implies ha he hermal conduciviy of he lobser is large. This is likely a poor assumpion! The lobser is a cylinder wih lengh L and radius r. The lobser s mass remains consan wih ime (reasonable assumpion) The hea capaciy of he lobser is approximaely ha of waer (quesionable, bu reasonable assumpion). Wha is he emperaure of he lobser afer 3 minues? A 2 rl + 2 r2 L 0.3 m r 0.1 m m 1 kg cp 4200 J kg K Boiling i in waer Baking i in he oven (convecive hea ransfer) (radiaive hea ransfer) dt d ha (T mcp h 500 dt d T ) J m2 1 s Exac soluion: ha T T1 + (T0 T1 ) exp mcp A 4 (T mcp 5.6704 10 T4 ) 8 J m2 K s Exac soluion: (requires soluion of a nonlinear equaion) an 1 T T1 7 + an 1 T T1 an 1 T0 T1 + anh 1 T0 T1 3 + 2 T1 ODE.key - November 26, 2014

Explici Time Inegraion Forward Euler Single ODE: Iniial condiion: d d f(, ) (0) 0 Firs order forward-difference approximaion: d d n n+1 n+1 n n + + O( ) d d n In words: ϕn+1 is approximaed using he slope of he funcion a he previous ime sep. Forward Euler Δ +Δ n + f( n, Forward Euler n ) Why explici? Because all informaion is explicily known o move soluion forward. Wha happens as we decrease? Forward Euler Algorihm: Given ϕn, n, end,, f(,ϕ): 1. Se n+1+. 2. Calculae ϕn+1. (requires calcluaion of f(n,ϕn) ) 3. Se nn+1, ϕn ϕn+1 4. If n<end, reurn o sep 1. 5. Reurn ϕn. 8 ODE.key - November 26, 2014

Example - Lobsers Again... In waer (convecive hea ransfer) dt d ha mc p (T T ) funcion rhs lobser_convecion(, T ) % The ime-change of emperaure of a lobser pu in % boiling waer, assuming ha he emperaure of he % lobser is spaially uniform. In hea ransfer, you % will learn ha his is called a "lumped" analysis. Twaer 373.15; % emperaure of boiling waer (K) m 1.0; % lobser's mass (kg) cp 4200; % lobser's hea capaciy. h 500; % hea ransfer coefficien (W/(m2 K)) L 0.3; % lengh (m) r 0.1; % radius (m) % area, assuming ha he lobser is a cylinder. A 2*pi*r*L + 2*pi*r^2; rhs -h*a/(m*cp) * (T-Twaer); In he oven (radiaive hea ransfer) dt d A mc p (T 4 T 4 ) funcion rhs lobser_radiaion(, T ) % The ime-change of emperaure of a lobser pu in an oven, % assuming ha he emperaure of he lobser is spaially % uniform. In hea ransfer, you will learn ha his is % called a "lumped" analysis. Tinf 400; % oven emperaure, K sigma 5.6704e-8; % Sefan-Bolzmann consan, (J/(m2 K s)) emiss 1.0; % emissiviy (no unis) m 1.0; % lobser's mass (kg) cp 4200; % lobser's hea capaciy. L 0.3; % lengh (m) r 0.1; % radius (m) % area, assuming ha he lobser is a cylinder. A 2*pi*r*L + 2*pi*r^2; rhs -sigma*emiss*a/(m*cp) * (T^4-Tinf^4); 9 ODE.key - November 26, 2014

Sysems of ODEs Examples in Chemical Engineering: Kineics (muliple reacing species). Coupled processes (e.g. variable energy and composiion, ec). Ofen arise from discreizaion of PDEs Approach: use vecor of soluion variables, and a funcion which reurns he rhs as a vecor. d 1 d f 1 (, 1, 2,..., n), d 2 d f 2 (, 1, 2,..., n),. d n d f n (, 1, 2,..., n), d d F (, ) ( 0) 0 10 ODE.key - November 26, 2014

Example: A Falling Objec A 0, we release an objec a x0 and i sars falling o earh. Find x() and v(). A low Reynolds number, (ball in molasses) he drag force is proporional o v. A high Reynolds number (skydiver), he drag force is proporional o v 2. d 2 x d 2 g v d 2 x d 2 g v2 x(0) 0, x() g 2 dx d 0 0 Order reducion: wrie a second-order ODE as a sysem of firs-order ODEs! dx d v dv d g v [ 1 + exp ( )] v() g (1 exp( )) x(0) 0, dx d 0 0 analyic soluion sill possible, bu messy... Order reducion: dx d v dv d g v2 11 ODE.key - November 26, 2014

Implici Time Inegraion Backward Euler d d f(, ) d d n+1 Forward difference in ime Forward Euler (explici) Backward difference in ime Backward Euler (implici) n+1 n + O( ) Backward Euler n+1 n + d d n+1 n + f( n+1, n+1 ) Backward Euler Forward Euler Δ +Δ Problem: we don know f(ϕn+1,n+1) Implici If f(ϕn+1,n+1) is nonlinear in ϕ hen we mus solve a nonlinear equaion a each imesep. g( n+1 ) n+1 n f n+1, Repea he lobser example using backward Euler... n+1 Backward Euler Algorihm: Given ϕn, n, end,, f(,ϕ): 1. Guess ϕn+1. 2. Se n+1n+. 3. Solve g(ϕn+1)0 for ϕn+1 (nonlinear equaion) 4. Se nn+1, ϕn ϕn+1. 5. If n<end, reurn o sep 1. 6. Reurn ϕn. 12 ODE.key - November 26, 2014

Example dc d kc2 wih c(0) given Backward Euler c n+1 c n k(c n+1 ) 2 residual form g(c n+1 )(k )(c n+1 ) 2 + c n+1 c n analyic soluion c n+1 1 ± p 1+4k c n 2k numeric soluion g 0 2(k )c n+1 )+1 Newon updae c n+1 k+1 cn+1 k c n+1 k g(c n+1 k ) g 0 (c n+1 k ) k (c n+1 k ) 2 + c n+1 k 2k c n+1 k +1 k - ieraion couner n - ime level couner c n Ierae unil convergence - hen move on o nex ime level. 13 ODE.key - November 26, 2014

Example: Cyclical Sysems Change of heigh of car as a funcion of ime: dy d r sin( ) r - radius of ferris wheel ω - roaion rae (radians/ime) θ 14 ODE.key - November 26, 2014

Crank-Nicholson f( n, n ) f( n+1, n+1 ) n+1 n n+1 n Firs-order accurae in ime. Add 1/2 forward Euler + 1/2 backward Euler (average slope) n+1 n 1 2 f(n+1, n+1 ) + f( n, Second-order accurae in ime. n ) g( n+1 ) n+1 n 1 2 f(n+1, n+1 ) + f( n, n ) Forward Euler Crank Nicholson Δ Backward Euler +Δ Crank-Nicholson Algorihm: Given ϕn, n, end,, f(,ϕ): 1. Guess ϕn+1 ϕn. 2. Se n+1n+. 3. Solve g(ϕn+1)0 for ϕn+1 (nonlinear equaion) 4. Se nn+1, ϕn ϕn+1 5. If n<end, reurn o sep 1. 6. Reurn ϕn. 15 ODE.key - November 26, 2014

Time Inegraion wih Malab s Inegraors 1. Creae he RHS funcion in he form f(,φ). RHS funcion should produce a column vecor. 2. Deermine he ime(s) ha you wan he soluion Eiher [sar,end] or a vecor of specific imes. 3. Use he appropriae inegraor (ode45, ode15s): Funcion ode45 ode15s Descripion Explici ime inegraor. Try his firs. Bes for non-siff problems Implici ime inegraor. Use his for siff problems (when ode45 sruggles) [,phi] ode45( rhsfun, [0,end], phi0 ); [,phi] ode45( rhsfun, ps, phi0 ); [,phi] ode15s( rhsfun, [0,end], phi0 ); [,phi] ode15s( rhsfun, ps, phi0 ); 16 ODE.key - November 26, 2014

Example: A Sysem of ODEs Hypoheical reacion mechanism: A k 1! B 2B k 2! B + C B + C k 3! A + C k1 0.04 k2 3 10 7 k3 10 4 da d k 1A + k 3 BC db d k 1A k 2 B 2 k 3 BC dc d k 2B 2 Solve his using: Forward Euler Backward Euler ODE45 ODE15s 17 ODE.key - November 26, 2014