PH36010 Numerical Methods Solving Differential Equations using MATHCAD.

Slides:



Advertisements
Similar presentations
Lecture - 9 Second order circuits
Advertisements

Differential Equations
Storey: Electrical & Electronic Systems © Pearson Education Limited 2004 OHT 18.1 Transient Behaviour  Introduction  Charging Capacitors and Energising.
Chapter 4 Continuous Time Signals Time Response Continuous Time Signals Time Response.
Differential Equations Math Review with Matlab: Finding Solutions to Differential Equations S. Awad, Ph.D. M. Corless, M.S.E.E. D. Cinpinski E.C.E. Department.
RLC circuits - Part 2 Resonance/Notches/Bandpass Cartoon from Agilent,
PHY 301: MATH AND NUM TECH Chapter 6: Eigenvalue Problems 1.Motivation 2.Differential Equations 3.Other Equations.
Lecture 4 Ordinary Differential Equations Purpose of lecture: Solve the full 2 nd order homogeneous ODE Solve these 2 nd order inhomogeneous ODEs Introduction.
ECE 201 Circuit Theory I1 General Solution for Natural and Step Responses of RL and RC Circuits Final Value Initial Value Time Constant Determine the initial.
example: four masses on springs
Physics 121, April 8, Harmonic Motion.
ENGG2013 Unit 24 Linear DE and Applications Apr, 2011.
The simple pendulum Energy approach q T m mg PH421:Oscillations F09
ECE 201 Circuit Theory I1 Natural Response of an RC Circuit.
Capacitance in a quasi-steady current circuit Section 62.
Lecture 2 Differential equations
Fall 2008Physics 231Lecture 10-1 Chapter 30 Inductance.
EGR 1101 Unit 7 Systems of Linear Equations in Engineering (Chapter 7 of Rattan/Klingbeil text)
Chapter 36 Viewgraphs AC Circuits. Most currents and voltages vary in time. The presence of circuit elements like capacitors and inductors complicates.
ENGR-43_Lec-04b_2nd_Order_Ckts.pptx 1 Bruce Mayer, PE Engineering-43: Engineering Circuit Analysis Bruce Mayer, PE Registered.
RLC Circuits.
Chapter 32 Inductance. Introduction In this chapter we will look at applications of induced currents, including: – Self Inductance of a circuit – Inductors.
6. RLC CIRCUITS CIRCUITS by Ulaby & Maharbiz. Overview.
Chapter 28 Direct Current Circuits. Electromotive Force An electromotive force device, or emf device, is a source of constant potential. The emf describes.
Applications of Linear Equations
 By Sajid Hussain Qazi.  As we are familiar with the characteristics of sinusoidal function, we can investigate the response of the basic elements R,
Exponential Growth and Decay
Dr. Hatim Dirar Department of Physics, College of Science Imam Mohamad Ibn Saud Islamic University.
P Class 26: Outline Hour 1: Driven Harmonic Motion (RLC) Hour 2: Experiment 11: Driven RLC Circuit.
Differential Equations. Definition A differential equation is an equation involving derivatives of an unknown function and possibly the function itself.
Differential Equations MTH 242 Lecture # 13 Dr. Manshoor Ahmed.
1.4. The Source-Free Parallel RLC Circuits
An Introduction to MathCAD You can always find a solution !!
L C LC Circuits 0 0 t V V C L t t U B U E Today... Oscillating voltage and current Transformers Qualitative descriptions: LC circuits (ideal inductor)
© 2014 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 23.
Autar Kaw Humberto Isaza Transforming Numerical Methods Education for STEM Undergraduates.
Summary so far: Free, undamped, linear (harmonic) oscillator Free, undamped, non-linear oscillator Free, damped linear oscillator Starting today: Driven,
Chapter 2 Systems Defined by Differential or Difference Equations.
PH 421: Oscillations - do not distribute
Oscillatory motion (chapter twelve)
Apply KCL to the top node ,we have We normalize the highest derivative by dividing by C , we get Since the highest derivative in the equation is.
Lab 6: R-C Circuits Only 6 more labs to go!! A capacitor is a device used to store energy. In this lab we will measure how a capacitor “stores” up or discharges.
Lecture 18 Review: Forced response of first order circuits
1 Chapter 3 Linear Ordinary Differential Equations in The Time Domain.
Ch. 7 – Differential Equations and Mathematical Modeling 7.4 Solving Differential Equations.
6.4 Exponential Growth and Decay Objective: SWBAT solve problems involving exponential growth and decay in a variety of applications.
Ordinary Differential Equations
State Equations BIOE Processes A process transforms input to output States are variables internal to the process that determine how this transformation.
Thursday August 2, PHYS 1444 Ian Howley PHYS 1444 Lecture #15 Thursday August 2, 2012 Ian Howley Dr. B will assign final (?) HW today(?) It is due.
Simultaneous Equations Can use matrix maths to solve linear simultaneous equations Arise from: –Electric Circuits Kirchoff’s laws –Fluid Dynamics.
State Space Models The state space model represents a physical system as n first order differential equations. This form is better suited for computer.
1 Driven Oscillations Driven Oscillators –Equation of motion –Algebraic solution –Complex algebra solution Phase and amplitude of particular solution –Algebraic.
Introduction to Differential Equations
General Solution for Natural and Step Responses of RL and RC Circuits
Introduction to Differential Equations
Differential Equations
Network Analysis and Synthesis
We will be looking for a solution to the system of linear differential equations with constant coefficients.
Lecture 15 Review: Capacitors Related educational materials:
Plumber’s LCR Analogy Valve P1 P2 Rubber Diaphragm Flywheel
1.4. The Source-Free Parallel RLC Circuits
Driven SHM k m Last time added damping. Got this kind of solution that oscillates due to initial conditions, but then decays. This is an important concept.
PH421: Oscillations; do not distribute
LC Oscillations L C I Kirchoff’s loop rule 11/12/2018.
Systems of Linear Equations in Engineering
An alternate solution technique
Chapter 2 Systems Defined by Differential or Difference Equations
Introduction to Differential Equations
Natural Response of an RC Circuit
Driven SHM k m Last time added damping. Got this kind of solution that oscillates due to initial conditions, but then decays. This is an important concept.
Presentation transcript:

PH36010 Numerical Methods Solving Differential Equations using MATHCAD

Solving ODEs numerically Produce numeric solution to system of ODEs.Produce numeric solution to system of ODEs. Must have initial conditionsMust have initial conditions Use one of several different solversUse one of several different solvers Produces matrix of solutionsProduces matrix of solutions

Steps to solving ODEs Scale equations, parameters & initial conditions to remove unitsScale equations, parameters & initial conditions to remove units Manipulate equations to give vector of derivativesManipulate equations to give vector of derivatives Give vector of initial conditionsGive vector of initial conditions Call solverCall solver Plot resultsPlot results

Radioactive decay, Newton’s law of cooling etcRadioactive decay, Newton’s law of cooling etc A is amount of material, temperature difference, etcA is amount of material, temperature difference, etc k is rate constantk is rate constant Solution of First Order ODE

Forming the derivative vector “The derivative of A with respect to t is –k times A”“The derivative of A with respect to t is –k times A”

Initial Conditions First order ODEFirst order ODE –1 member of D(t,A) vector –1 member of ic vector Although only 1 member, still needs to be a vector

Solution parameters TStart and TFinish timesTStart and TFinish times Number of points, NNumber of points, N

Create Solution Matrix Use rkfixed() functionUse rkfixed() function Return matrix with 1 column per DE + 1 for independent variableReturn matrix with 1 column per DE + 1 for independent variable Use column operator to strip off columnsUse column operator to strip off columns

Plot Results

What can go wrong Found number greater than 10^307Found number greater than 10^307 –Use more points –Reduce TFinish Can’t have anything with dimensions hereCan’t have anything with dimensions here –Strip units from system before solution

More complex first order system Double decayDouble decay A => B => CA => B => C K1 K2 K1 K2

Forming the derivative vector

Initial Conditions System of 2 DEsSystem of 2 DEs –2 members in D(t,F) vector –2 members in ic vector F 0 refers to A => ic 0F 0 refers to A => ic 0 F 1 refers to B => ic 1F 1 refers to B => ic 1 Initially 100% of A, 0% of B

Form Solution of Double Decay system Solution parameters as beforeSolution parameters as before Call rkfixed() as before to create matrixCall rkfixed() as before to create matrix

Plot results of double decay

Second Order System Damped SHM Rewrite as system of first order equationsRewrite as system of first order equations Solve as beforeSolve as before

Second Order system LCR Circuit Kirchoff’s Voltage Law =>

Second order System Forming the equations Use dq/dt=i and divide by L coil To get homogeneous equation in q

Second Order System Writing standard form #1 Rewrite again, getting rid of d/dt

Second Order System Writing standard form #2 Use symbolic solver to get q2

Second Order System Fill in D vector Have expressions for q1 & q2Have expressions for q1 & q2 Now fill in D(t,q) vectorNow fill in D(t,q) vector ReplaceReplace –q0  q 0,q1  q 1,q2  q 2

Second Order System Define Initial Conditions Start with 1V across capacitor & no current flowingStart with 1V across capacitor & no current flowing

Second Order System Create Solution Examine over 0.1sExamine over 0.1s Use 1000 pointsUse 1000 points

Second Order System Plot Solution

Driven Systems So far all systems have been ‘Relaxation to steady state’So far all systems have been ‘Relaxation to steady state’ Can also model systems driven by ‘Forcing Function’Can also model systems driven by ‘Forcing Function’

Forcing Function for LCR circuit Enables us to see resonanceEnables us to see resonance Put voltage source in loopPut voltage source in loop

Solution for Forced Oscillation Use symbolic solver to solve for q2 as beforeUse symbolic solver to solve for q2 as before Compare with undriven case…Compare with undriven case…

Forcing function Drive with sinusoidal waveformDrive with sinusoidal waveform Substitute to give…Substitute to give…

Derivative Vector for Forced SHM No initial charge or currentNo initial charge or current

Form solution Use rkfixed as before…Use rkfixed as before…

Extract values & plot

Phase Plot Plot Current (q1) vs Charge (q0)Plot Current (q1) vs Charge (q0)