EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science

Similar documents
Math 128A Spring 2003 Week 12 Solutions

Outline. Calculus for the Life Sciences. What is a Differential Equation? Introduction. Lecture Notes Introduction to Differential Equa

2.4 Harmonic Oscillator Models

2.4 Models of Oscillation

2D-Volterra-Lotka Modeling For 2 Species

Homework #5 Solutions

Applications of Second-Order Differential Equations

Elementary Differential Equations

28. Pendulum phase portrait Draw the phase portrait for the pendulum (supported by an inextensible rod)

APPLICATIONS OF SECOND-ORDER DIFFERENTIAL EQUATIONS

Inductance, Inductors, RL Circuits & RC Circuits, LC, and RLC Circuits

MEM 255 Introduction to Control Systems: Modeling & analyzing systems

sections June 11, 2009

ECE2262 Electric Circuit

Math 266: Ordinary Differential Equations

1 Phasors and Alternating Currents

ENGI 3424 First Order ODEs Page 1-01

Definition of differential equations and their classification. Methods of solution of first-order differential equations

REACTANCE. By: Enzo Paterno Date: 03/2013

Systems of Differential Equations: General Introduction and Basics

Chapter 10: Sinusoidal Steady-State Analysis

To find the step response of an RC circuit

Physics: spring-mass system, planet motion, pendulum. Biology: ecology problem, neural conduction, epidemics

Handout 11: AC circuit. AC generator

Wave Phenomena Physics 15c

Electric Circuit Theory

Lesson 9: Predator-Prey and ode45

(competition between 2 species) (Laplace s equation, potential theory,electricity) dx4 (chemical reaction rates) (aerodynamics, stress analysis)

Introduction to AC Circuits (Capacitors and Inductors)

SCHOOL OF MATHEMATICS MATHEMATICS FOR PART I ENGINEERING. Self-paced Course

2.1 Exponential Growth

First-order transient

Graded Project #1. Part 1. Explicit Runge Kutta methods. Goals Differential Equations FMN130 Gustaf Söderlind and Carmen Arévalo

Motivation and Goals. Modelling with ODEs. Continuous Processes. Ordinary Differential Equations. dy = dt

SYSTEMS OF ODES. mg sin ( (x)) dx 2 =

Chapter 6. Second order differential equations

Inductance, RL and RLC Circuits

2 Growth, Decay, and Oscillation

Module 25: Outline Resonance & Resonance Driven & LRC Circuits Circuits 2

Wave Phenomena Physics 15c

Solution to Homework 2

Computers, Lies and the Fishing Season

Module 24: Outline. Expt. 8: Part 2:Undriven RLC Circuits

EE292: Fundamentals of ECE

4.2 Homogeneous Linear Equations

Inductance, RL Circuits, LC Circuits, RLC Circuits

EE292: Fundamentals of ECE

Physics 208, Spring 2016 Exam #3

11. AC Circuit Power Analysis

Chapter 33. Alternating Current Circuits

RLC Series Circuit. We can define effective resistances for capacitors and inductors: 1 = Capacitive reactance:

MATH 250 Homework 4: Due May 4, 2017

Chapter 4 Transients. Chapter 4 Transients

Chapter 2 PARAMETRIC OSCILLATOR

Ordinary Differential Equations (ODE)

Chapter 4. Systems of ODEs. Phase Plane. Qualitative Methods

Periodic motion Oscillations. Equilibrium position

Lecture 35: FRI 17 APR Electrical Oscillations, LC Circuits, Alternating Current I

1.Introduction: 2. The Model. Key words: Prey, Predator, Seasonality, Stability, Bifurcations, Chaos.

dx n a 1(x) dy

ECE2262 Electric Circuits. Chapter 6: Capacitance and Inductance

AC Circuits Homework Set

7.3 State Space Averaging!

Oscillations. Tacoma Narrow Bridge: Example of Torsional Oscillation

Lecture 6: Impedance (frequency dependent. resistance in the s- world), Admittance (frequency. dependent conductance in the s- world), and

Chapter 31 Electromagnetic Oscillations and Alternating Current LC Oscillations, Qualitatively

P441 Analytical Mechanics - I. RLC Circuits. c Alex R. Dzierba. In this note we discuss electrical oscillating circuits: undamped, damped and driven.

Coordinate Curves for Trajectories

Ordinary Differential Equations

Second order differential equations 4

Electric Circuit Theory

Differential Equations and Linear Algebra Supplementary Notes. Simon J.A. Malham. Department of Mathematics, Heriot-Watt University

Numerical Methods for ODEs. Lectures for PSU Summer Programs Xiantao Li

Chap. 20: Initial-Value Problems

PES 1120 Spring 2014, Spendier Lecture 35/Page 1

Announcements: Today: more AC circuits

XXIX Applications of Differential Equations

Inductive & Capacitive Circuits. Subhasish Chandra Assistant Professor Department of Physics Institute of Forensic Science, Nagpur

Math 128A Spring 2003 Week 11 Solutions Burden & Faires 5.6: 1b, 3b, 7, 9, 12 Burden & Faires 5.7: 1b, 3b, 5 Burden & Faires 5.

MAT01B1: Separable Differential Equations

CDS 101: Lecture 2.1 System Modeling


Module 4. Single-phase AC Circuits

Alternating Current Circuits

ELECTRONICS E # 1 FUNDAMENTALS 2/2/2011

ECEN 420 LINEAR CONTROL SYSTEMS. Lecture 6 Mathematical Representation of Physical Systems II 1/67

Modeling and Simulation Revision IV D R. T A R E K A. T U T U N J I P H I L A D E L P H I A U N I V E R S I T Y, J O R D A N

Chapter 10: Sinusoids and Phasors

EE292: Fundamentals of ECE

Lecture 20/Lab 21: Systems of Nonlinear ODEs

Dynamic Modeling. For the mechanical translational system shown in Figure 1, determine a set of first order

Getting Started With The Predator - Prey Model: Nullclines

HOMEWORK 4: MATH 265: SOLUTIONS. y p = cos(ω 0t) 9 ω 2 0

Modelling biological oscillations

Noise - irrelevant data; variability in a quantity that has no meaning or significance. In most cases this is modeled as a random variable.

Lecture - 11 Bendixson and Poincare Bendixson Criteria Van der Pol Oscillator

NOTICE TO CUSTOMER: The sale of this product is intended for use of the original purchaser only and for use only on a single computer system.

Physics for Scientists & Engineers 2

= D. 5. The displacement s (in cm) of a linkage joint of a robot is given by s = (4t-t 2 ) 213, where t is. Find the derivative.

second order Runge-Kutta time scheme is a good compromise for solving ODEs unstable for oscillators

Transcription:

EAD 115 Numerical Solution of Engineering and Scientific Problems David M. Rocke Department of Applied Science

Transient Response of a Chemical Reactor Concentration of a substance in a chemical reactor can change during transient periods after startup or change in conditions Accumulation = inputs outputs V = volume of the reactor, assumed constant c = concentration of the substance, which can change.

Accumulation dc V dt in 0 Qc in Qc 1 ( Q/ V) t ( Q/ V) t in 0 cc e c e c Q 50mg/m 3 5m / min V=100m c 3 10mg/m 3 3 0.05t 0.05t c50 1e 10e

100 50 20 80 40 dc 1 c1 c3 dt 0.12 0.02 1

dc1 V1 Q01c01Q31c3 Q12c1Q15c1 dt dc1 0.12c1 0.02c3 1 dt dc2 0.15c10.15c2 dt dc3 0.025c2 0.225c3 4 dt dc4 0.1c3 0.1375c4 0.025c5 dt dc5 0.3c10.01c2 0.04c5 dt c (0) c (0) c (0) c (0) c (0) 0 1 2 3 4 5

Solution using a fourth-order Runge-Kutta method. We can describe the response in terms of the time to 90% of the equilibrium concentration. This varies from about 12 for c 3 to over 70 for c 5

100 50 20 80 40 dc 1 c1 c3 dt 0.12 0.02 1

Predator-Prey Models Volterra-Lotka describe the reaction dynamics in an ecosystem In the simplest case, we let x represent the number of prey animals (rabbits) and y the number of predator animals (foxes). Rabbits naturally increase, and are assumed to have an adequate food supply, but are reduced by predation. Foxes increase only if there is adequate prey.

dx dt dy dt ax bxy cydxy Rabbits increase at a natural (birth death) rate a. Rabbits are reduced by a percentage by that depends on the number of foxes. Foxes reproduce at a rate dx dependent on the food supply. Foxes die at a rate c.

State-Space Representation The previous plot showed x and y against t. The state-space plot shows y against x This shows the stability, or lack of it, and the dynamics in a more concrete way

dx ax bxy 0 dt dy cydxy 0 dt x0 or aby y 0 or cdx (0,0) or (c/d, a/b)

Stochastic version dx dt dy dt ax bxy cydxy Critical point is not stable. Extinction can occur

Stochastic dynamics after 5 time periods

Stochastic dynamics after 10 time periods

Stochastic dynamics after 30 time periods

Simulating Transient Current in an Electric Circuit

di q L Ri E( t) 0 (Kirkoff's Law) dt C di L voltage drop across the inductor dt L inductance R resistance (of the resistor) = 0 q charge on the capacitor C capacitance (of the capacitor) Et ( ) time-varying voltage source = E0 sint dq i dt E0 E0 qt () sinpt sin t where p1/ LC 2 2 2 2 L( p ) p L( p )

Assume L = 1H, E 0 = 1V, C = 0.25C, ω 2 = 3.5s 2, so that p = 2. q(t) = -1.8708 sin(2t) + 2 sin(1.8708t) Although an analytical solution exists, try integration with Euler and RK 4 methods Use h = 0.1s, evaluate accuracy at t = 10s. q(t) = -1.996C (exact) q(t) -6.638 (Euler) q(t) -1.9897 (RK4)

The Swinging Pendulum The usual analysis of a swinging pendulum is an approximation which is valid for small arcs. We compare the exact solution of the approximate problem with an approximate solution of a more realistic model We do still model this as a point mass on a weightless, inextensible rod, so it is not completely realistic.

The force on the weight in the direction x tangent to the path is W F Wsin a g The angular acceleration in terms of the length l of the rod is 2 d a/ l 2 dt 2 Wl Wl d W sin 2 g g dt 2 d g sin 0 2 dt l

Exact solution to an approximation when is small 3 5 7 sin 3! 5! 7! d 2 dt 2 g l () t cos 0 0 g t l The period of the pendulum is then T 2 l g

T 2 l g l 2ft 0 /4 (45) T 1.5659s

An approximate (numerical) solution to a more accurate physical model 2 d g sin 0 2 dt l d v dt dv g sin 16.1sin (for l 2ft) dt l Approximate with Euler method and standard order 4 Runge-Kutta method

k 1 Standard Fourth-Order Method f( x, y ) i k f( x h/2, y kh/2) 2 i i 1 k f( x h/2, y k h/2) 3 i i 2 k f( x h, y k h) 4 i i 3 i y y ( k 2k 2 k k ) h/6 i1 i 1 2 3 4

k f ( t, θ, v ) v 0 11 1 0 0 0 0 k f ( t, θ, v ) 16.1sinθ 16.1sin π/ 4 12 2 0 0 0 0 16.2sin 0.785398 11.38441918 θ θ 0.005k θ 0.005(0) π/ 4 0.785398163 * 1 0 11 0 v v 0.005k 0 0.005( 11.38441918) 0.056922096 k * 1 0 12 f ( t, θ, v * * * * 21 1 1 1 1 1 * * * * 22 2 1 1 1 1 * 2 0 21 * 2 0 22 ) v 0.056922096 k f ( t, θ, v ) 16.1sin θ 11.38441918 θ θ 0.005k 0.785113553 v v 0.005k 0.056922096

θ θ 0.005k 0.785113553 * 2 0 21 v v 0.005k 0.056922096 * 2 0 22 k f ( t, θ, v ) v 0.056922096 * * * * 31 1 2 2 2 2 k f ( t, θ, v ) 16.1sinθ 11.38117859 * * * * 32 2 2 2 2 2 θ θ 0.01k 0.784828942 * 3 0 31 v v 0.01k 0.113811786 k * 3 0 32 f ( t, θ * 41 1 3 * * * 3 3 3 * * * * 42 2 3 3 3 3 1 11 12 13 14 2 21 22 23 24 1 0 1 1 0 2, v ) v 0.113811786 k f ( t, θ, v ) 16.1sinθ 11.37793708 φ k 2k 2k 2k 0.056916695 φ k 2k 2k 2k 11.38225863 θ θ 0.01φ 0.784828996 v v 0.01φ 0.113822586

Time Linear Euler h=0.05 RK 4 h=0.05 RK 4 h=0.01 0.0 0.785398 0.785398 0.785398 0.785398 0.2 0.545784 0.615453 0.566582 0.566579 0.4 0.026852 0.050228 0.021895 0.021882 0.6 0.583104 0.639652 0.535802 0.535820 0.8 0.783562 1.050679 0.784236 0.784242 1.0 0.505912 0.940622 0.595598 0.595583 1.2 0.080431 0.299819 0.065611 0.065575 1.4 0.617698 0.621700 0.503352 0.503392 1.6 0.778062 1.316795 0.780762 0.780777

Analysis of Numerical Solutions The Euler method with h = 0.05 generates a impossible results at times t = 0.8, 1.0, and 1.6 The RK4 solutions with h = 0.05 and h = 0.01 are the same to 4 decimal places, suggesting the accuracy of the latter is at least that good. The RK4 h = 0.01 solution attains a max of 0.785385 at t = 1.63 compared to 0.785398 at the initial conditions Thus the difference between the linear approximation and the RK 4 solution can safely be interpreted.

Period Initial Displacement Linear Model Exact Nonlinear Model RK4 π/16 1.5659 1.57 π/4 1.5659 1.63 π/2 1.5659 1.85

An approximate solution to the exact problem is often better in a practical sense than the exact solution to an approximate problem. The art is in knowing how much to include in the model, and how accurate an approximate solution is required.