How to solve ODEs using MATHEMATICA Plasma Application Modeling POSTECH Gan-Young Park and Jae-Koo Lee Department of Electronic and Electrical Engineering,

Slides:



Advertisements
Similar presentations
Solving Equations Numerically Figure 4.1a Rename the independent variable x if necessary. For Figure 4.1a, Set up the table. Set up the first column for.
Advertisements

 indicates dotted/dashed line  < indicates below or to the left of the line  > indicates above or to the right of the line  If equals is part of.
Solving Equations Numerically Figure 2.1a Rename the independent variable x if necessary. For Figure 2.1a, Set up the table. Set up the column for the.
Dr. Jie Zou PHY Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (I) 1 1 Besides the main textbook, also see Ref.: “Applied.
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Implicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Learning Objectives for Section 1.2 Graphs and Lines
Chapter 1 Linear Equations and Graphs Section 2 Graphs and Lines.
Table of Contents Solving Linear Systems of Equations - Substitution Method Recall that to solve the linear system of equations in two variables... we.
Numerical Solution of Ordinary Differential Equation
Solving Systems Using Elimination Objective: To solve systems of equations algebraically.
Chapter 1 Linear Equations and Graphs Section 2 Graphs and Lines.
Functions. A function is a relation that has exactly one output for each input.
Systems of Equations and Inequalities
Lesson 13 Graphing linear equations. Graphing equations in 2 variables 1) Construct a table of values. Choose a reasonable value for x and solve the.
Copyright © 2013 Pearson Education, Inc. All rights reserved Section 1.1 The Distance and Midpoint Formulas; Graphing Utilities; Introduction to Graphing.
Graphs of Functions Defined by Expressions in a Linear Equation On a standard screen, graph the following functions, determined from the given linear equation:
Do Now - Review Find the solution to the system of equations: x – y = 3 x + y = 5.
1 Learning Objectives for Section 1.2 Graphs and Lines The student will be able to identify and work with the Cartesian coordinate system. The student.
College Algebra Acosta/Karwowski. Chapter 2 Systems of equations.
Inverses and Systems Section Warm – up:
ECE 1304 Introduction to Electrical and Computer Engineering Section 1.1 Introduction to MATLAB.
Introduction to Engineering MATLAB – 6 Script Files - 1 Agenda Script files.
Open Sentences.
Getting Started with TI-Interactive. TI-Interactive TI-Interactive can be used to create a variety of graphs. Scatter Plots, Line Plots, Histograms, Modified.
Solving a System of Equations by SUBSTITUTION. GOAL: I want to find what x equals, and what y equals. Using substitution, I can say that x = __ and y.
Substitution Method: 1. Solve the following system of equations by substitution. Step 1 is already completed. Step 2:Substitute x+3 into 2 nd equation.
Differential Equations Copyright © Cengage Learning. All rights reserved.
The numerator must always be 1 degree less than the denominator
Chapter 1 – Matlab Overview EGR1302. Desktop Command window Current Directory window Command History window Tabs to toggle between Current Directory &
PRE-ALGEBRA. Lesson 8-2 Warm-Up PRE-ALGEBRA Equations with Two Variables (8-2) What is a “solution”? How do you find a solution when given one of the.
College Algebra Acosta/Karwoski. CHAPTER 1 linear equations/functions.
Copyright © 2013, 2009, 2005 Pearson Education, Inc. 1 4 Inverse, Exponential, and Logarithmic Functions Copyright © 2013, 2009, 2005 Pearson Education,
Day Problems Solve by graphing. Check your solution.
Algebra 3 Lesson 1.8 Objective: SSBAT solve a system of equation by graphing. Standards: M11.D
1.3 Open Sentences A mathematical statement with one or more variables is called an open sentence. An open sentence is neither true nor false until the.
What is a system of equations? A system of equations is when you have two or more equations using the same variables. The solution to the system is the.
Algebra 3 Warm – Up 1.8 Graph. y = 3x – 6.
Solving Linear Systems by Substitution
4.8 Using matrices to solve systems! 2 variable systems – by hand 3 or more variables – using calculator!
Solve the equation for y. SOLUTION EXAMPLE 2 Graph an equation Graph the equation –2x + y = –3. –2x + y = –3 y = 2x –3 STEP 1.
Unit 2: Systems Day 1: Solving Systems with tables and graphing.
Lecture 40 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
Warm Up Determine whether each system has zero, one or infinitely many solutions one infinitely many zero 3x + y = 15 3x – 2y = 6 x + 2y = 18.
ACSL, POSTECH1 MATLAB 입문 CHAPTER 8 Numerical Calculus and Differential Equations.
Determinants Every n  n matrix A is associated with a real number called the determinant of A, written  A . The determinant of a 2  2 matrix.
Functions Objective: To determine whether relations are functions.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapters 22 and 23.
Section 7.6 Functions Math in Our World. Learning Objectives  Identify functions.  Write functions in function notation.  Evaluate functions.  Find.
Functions and relations
Solving Linear Systems by Substitution
Graphing Linear Equations and Inequalities
Chapter 1 Linear Equations and Graphs
Chapter 1 Linear Equations and Graphs
Systems of Multivariable Equations
Solving Systems Using Substitution
Section 1.1 The Distance and Midpoint Formulas; Graphing Utilities; Introduction to Graphing Equations.
RELATIONS AND FUNCTIONS
Functions and relations
Break even or intersection
Solve a system of linear equation in two variables
C Graphing Functions.
Solving Systems of Equation by Substitution
Transparency 4a.
Chapter 1: Linear Equations in Linear Algebra
Section 4.1 Solving Systems of Equations
Solving systems using substitution
Chapter 1 Linear Equations and Graphs
Solving By Substitution
Presentation transcript:

How to solve ODEs using MATHEMATICA Plasma Application Modeling POSTECH Gan-Young Park and Jae-Koo Lee Department of Electronic and Electrical Engineering, POSTECH EECE490O

Plasma Application Modeling POSTECH Contents Basic usages of MATHEMATICA Solving ODEs - Euler’s method - Predictor-Corrector method ( second-order ) - Forth-order Runge-Kutta method - Tridiagonal matrix method

Plasma Application Modeling POSTECH References Textbook - ‘Numerical and Analytical Methods for Scientists and Engineers Using Mathematica’, Daniel Dubin, Wiley, 2003 Web Lecture :

Plasma Application Modeling POSTECH Standard Screen Notebook : working window ( *.nb ) Palettes ( File – Palettes - ) : a collection of numerical expressions or characters

Plasma Application Modeling POSTECH Basic Usages (1) Shift + enter : Execution (shift + enter) In[1] indicates input contents in the line. Out[1] indicates the result of In[1] % : a symbol indicating the result obtained right before.

Plasma Application Modeling POSTECH Basic Usages (2) application of Palettes Font size : Format - Size -

Plasma Application Modeling POSTECH Basic Usages (3) The names of most of functions included start with a capital letter. included constants - π → Pi - ∞ → Infinite - e → E - i = → I ? (function) or ?? (function) : shows the usage of function or options

Plasma Application Modeling POSTECH Basic Usages (4) symbol calculation The symbol “ * ” for a product can be replaced by “ blank”.

Plasma Application Modeling POSTECH Basic Usages (5) == ( equality ), = ( substitution ), := ( definition ) Common feature Different feature

Plasma Application Modeling POSTECH Basic Usages (6) Common feature Different feature

Plasma Application Modeling POSTECH Basic Usages (7) Plot[ function, {variable, a, b}, options] : drawing 2-D graph between a and b

Plasma Application Modeling POSTECH Basic Usages (8) PlotStyle : a option for coloring Input - Color Selector

Basic Usages (9) PlotLabel : a option for labeling at top of graph AxesLabel : a option for labeling at axes AspectRatio : a option for adjusting the ratio of vertical to horizontal PlotRange : a option for restricting range to plot

Plasma Application Modeling POSTECH Basic Usages (10) DisplayFunction → Identity : a option for not showing a graph, just memorizing it. DisplayFunction -> $DisplayFunction : a option for showing a graph memorized. Show : a function to display graphs which have been shown or memorized

Plasma Application Modeling POSTECH Basic Usages (11) Package Since path is assigned up to StandardPackages, just sub-paths should be written. The symbol ` is used in Mathematica instead of \.

Plasma Application Modeling POSTECH Basic Usages (12) Table [contents, {range of loop}]

Plasma Application Modeling POSTECH Basic Usages (13) Do [exp, {i,min,max,d}] For [start, test, i++, body] While [test, body] Since Do, For, While don’t show results and save results, functions such as Print[] should be used for checking results. That’s a difference among Table and above functions.

Plasma Application Modeling POSTECH Basic Usages (14) Module [ {local variables}, contents ] : The variables written at {} in Module[ ] are used as local variables which doesn’t affect global variables with same characters and can’t be used out of Module[ ].

Plasma Application Modeling POSTECH Solving ODEs - Euler’s method - Predictor-Corrector method ( second-order ) - Forth-order Runge-Kutta method - Solving tridiagonal matrix

Plasma Application Modeling POSTECH Euler’s method (1)

Euler’s method (2) Plasma Application Modeling POSTECH

Predictor-Corrector method ( 2 nd -order )

Plasma Application Modeling POSTECH Forth-order Runge-Kutta method ( based on the Simpson’s 1/3 rule )

Example 9.1 ( Nakamura )

Program 9-1 ( Nakamura ), y(0)=1, y’(0)=0 Changing 2 nd order ODE to 1 st order ODE, (1) (2) y(0)=1 z(0)=0 Plasma Application Modeling POSTECH

Program 9-1 ( Nakamura ) Plasma Application Modeling POSTECH To solve 2 nd -order ODE using second-order Runge-Kutta method

Program 9-2 ( Nakamura ) Plasma Application Modeling POSTECH y(0)=0 y(0)=1 To solve ODE using fourth-order Runge-Kutta method

Solve difference equation, With the boundary conditions,   x = 012 i = Especially for i = 1, known y(0)=1 Plasma Application Modeling POSTECH Program 10-1 ( Nakamura )

For i = 10, Summarizing the difference equations obtained, we write Tridiagonal matrix Program 10-1 ( Nakamura )

Solution Algorithm for Tridiagonal Equations (1) R2R2 R3R3 Based on Gauss elimination Plasma Application Modeling POSTECH

Solution Algorithm for Tridiagonal Equations (2) Plasma Application Modeling POSTECH

Plasma Application Modeling POSTECH Program 10-1 ( Nakamura ) To solve boundary-value problem using tridiagonal method