### Create a StudySoup account

#### Be part of our community, it's free to join!

Already have a StudySoup account? Login here

# Numerical Applications to Differential Equations MA 302

NCS

GPA 3.93

### View Full Document

## 12

## 0

## Popular in Course

## Popular in Mathematics (M)

This 7 page Class Notes was uploaded by Braeden Lind on Thursday October 15, 2015. The Class Notes belongs to MA 302 at North Carolina State University taught by Michael Stuebner in Fall. Since its upload, it has received 12 views. For similar materials see /class/223689/ma-302-north-carolina-state-university in Mathematics (M) at North Carolina State University.

## Reviews for Numerical Applications to Differential Equations

### What is Karma?

#### Karma is the currency of StudySoup.

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/15/15

wysiwyg1 leFlHELP1quotECHDOCREFODE45HTML MATLAB Functions Search I Help Desk ode45 od623 odel 13 odelSs Od623S Purpose Solve differential equations Syntax TY solver39F39tspanyO TY solver39F39tspany0options TY solver39F39tspany0optionsplp2 TYTEYEIE solver39F39tspany0options TXY solver39model39tspany0optionsutplp2 Arguments Name of the ODE le a MATLAB function of t and y returning a column vector All solvers can solve systems of equations in the form 32 Fa y ode 155 and ode23s can both solve equations of the form F My FG y Only ode 155 can solve equations in the form Mg FR 3 For information about ODE file syntax see the odefile reference page tspan A vector specifying the interval of integration to tfinal To obtain solutions at speci c times all increasing or all decreasing use tspan to t1 tfinal y0 A vector of initial conditions Optional integration argument created using the odeset function See odeset for options details 131132 Optional parameters to be passed to F T Y Solution matrix Y where each row corresponds to a time returned in column vector T Descr1pt1 on T Y solver 39F39 tspany0 with tspan to tfinal integrates the system ofdifferential equations y39 F Ly from time t0 t0 tfinal with initial conditions yO 39F39 is a string containing the 10f7 123198 636 AM wysiwyg1 leFlHELPTECHDOCREFODE45HTML name of an ODE le Function E t y must retum a column vector Each row in solution array y corresponds to a time returned in column vector t To obtain solutions at the speci c times t0 t1 tfinal all increasing or all decreasing use tspan t0 t1 tfinal T Y solver 39E39 tspan yO options solves as above with default integration parameters replaced by property values speci ed in options an argument created with the odeset function see odes et for details Commonly used properties include a scalar relative error tolerance Rel Toi le 3 by default and a vector of absolute error tolerances AbsToi all components 19 6 by default T Y solver 39E39 tspany0 optionspip2 solves as above passing the additional parameters pip2 to the M le E whenever it is called Use options as a place holder if no options are set T Y TE YE IE solver 39 E 39 tspan yO options With the Events property in options set to 39 on 39 solves as above while also locating zero crossings of an event function de ned in the ODE le The ODE le must be coded so that E t y 39events 39 returns appropriate information See odefile for details Output TE is a column vector of times at which events occur rows of YE are the corresponding solutions and indices in vector IE specify which event occurred When called with no output arguments the solvers call the default output function odepiot to plot the solution as it is computed An alternate method is to set the OutputEcn property to 39 odepiot 39 Set the OutputEcn property to 39odephasZ 39 or 39Odephas339 for two orthreedimensional phase plane plotting See ode file for details For the stilT solvers odeiSs and ode23s the Jacobian matrix BF 3y is critical to reliability and ef ciency so there are special options Set JConstant to 39on39 ifaFay is constant Set Vectori zed to 39on39 if the ODE le is coded so that E t yl y2 returns E tyl Ety2 Set Jattern to 39on39 1391 an 33 is a sparse matrix and the ODE le is coded so that E 39jpattern39 returns a sparsity pattern matrix of 1 s and 0 s showing the nonzeros ofaF 3y Set Jacobian to 39on39 ifthe ODE le is coded so that E ty 39 jacobian39 returns Both odeiSs and odeZ3s can solve problems My 2 FG y with a constant mass matrixM that is nonsingular and usually sparse Set Mass to 39on39 ifthe ODE le is coded so that E 39mass 39 retumsM see femZode Only odeiSs can solve problems Mam F0 3 with a timedependent mass matrix M t that is nonsingular and usually sparse Set Mass to 39on39 ifthe ODE le is coded so that E t H 39mass39 returns Mm see femlode For odeiSs set MassConstant to 39on39 ifM is constant 20f7 123198 636 AM wysiwyg1 leFHELPTECHDOCREFODE45HTML Solver Problem Type Crcierracgf When to Use ode 45 Nonsti Medium Most of the time ThlS should be the rst solver you try ode 23 Nonsti LOW If us1ng crude error tolerances or solv1ng moderately st1ff problems If using stringent error tolerances or solving a d 113 0 e Nonsn LOW to hlgh computationally 1ntens1ve ODE le odelss Stiff LOW to medium If Dd 45 is slow stiff systems or there is a mass matrix 19235 Stiff LOW If us1ng crude error tolerances to solve stiff systems or there is a constant mass matrix The algorithms used in the ODE solvers vary according to order of accuracy 5 and the type of systems stiff or nonstiff they are designed to solve See Algorithms on page 2473 for more details It is possible to specify tspan yO and options in the ODE le see odefile If tspan or yO is empty then the solver calls the ODE le tspany0options F 39init39 to obtain any values not supplied in the solver s argument list Empty arguments at the end of the call list may be omitted This permits you to call the solvers with other syntaxes such as TY solver39F39 TY solver39F39ly0 TY solver39F39tspan options TY solver39F39options Integration parameters options can be speci ed both in the ODE le and on the command line If an option is speci ed in both places the command line speci cation takes precedence For information about constructing an ODE le see the odefile reference page Options Different solvers accept different parameters in the options list For more information see odeset and Using MA TLAB 3 of7 123198 636 AM wymwygll lz mmmx mocwmw HTML Examples 17 u 1 body wnhout Emma forces y l ya ya man 0 y z iylyg 3120 1 y a 7051mm yam 1 ry mhw tum m aw ugldltyw dv zezuswm a column vector uvm vm vm uvtzw 41m vm dvm ms vm wzy y mm of012wnhmma1 comm vector01 11mm u upcluns Ddesecl REJTul ler4y AhsTul y1amp4 1274 1275 y udedSL gd rD 12u 1 1Dpuns Plotting the columns othe rammed array Yversus T shows the solution pluclT UJIyquot TYL21yquot yTley31y 1 mum 35 AM wymwygll lz mmmx mocwmw HTML I 7 w oselllau e su oh ff altematlng wnh reglohs ofvery sharp change where it ls not suff y yo y10 0 2 y 2 10001 3 1D 2 y1 yaw 1 r V Fun u quotMill vdpl funcclun dy vdPJEIEIEILErW dy 7 msle r e mum dvlll VLZI39 aylzl e leee M e vlwzl vlzl r ym For th5 problem we wlll us e default relauve and absolute tolerances 1e and lees respeeuvely and solve oh aume mterval of 0 3000Wlthlmtla1 eohdluoh vector 2 0 amme u my udEJSS l vdplEIEIEI u auuul 2 u l Plomng lhe rst eolumh oflhe rammed mamx y versus T shows lhe soluuoh plurlT Ilth m l mum 35 AM wymwygll lz mmmx mocwmw HTML Algorithms nly e b rwrl In general edges 15 the bestfuncuo n to apply as a first try formost problems 1 n w F n m be L T k udedS udeza 15 a onerstep solver 2 shf quotheM uh quotw F r DE been 15 a solution 3 appear to be u PF try usmg one ome 5m solvers been and eeezae instead lenumencal N39DF Optionally BDF ef uent kae b u faded orwas very inef cient try been 7 xtmay be been 15 not effective 7 See Also Ddeset euegee Ddeille mum 35 AM 7of7 wysiwyg1 leFHELP1quotECHDOCREFODE45HTML References 1 Dormand J R and P J Prince quotA family of embedded RungeKutta formulaequot J Comp Appl Math Vol 6 1980 pp 1926 2 Bogacki P and L F Shampine quotA 32 pair of RungeKutta formulas Appl Math Letters Vol 2 1989 pp 19 3 Shampine L F and M K Gordon Computer Solution of Ordinary Di erential Equations the Initial Value Problem W H Freeman San Francisco 1975 4 Forsythe G M Malcolm and C Moler ComputerMethoals for Mathematical Computations PrenticeHall New Jersey 1977 5 Shampine L F Numerical Solution of Ordinary Di erential Equations Chapman amp Hall New York 1994 6 Kahaner D C Moler and S Nash Numerical Methods anal Software PrenticeHall New Jersey 1989 7 Shampine L F and M W Reichelt quotThe MATLAB ODE Suitequot to appear in SIAM Journal on Scientific Computing Vol 181 1997 Previous 1 Help Desk 1 Next 123198 636 AM

### BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

#### "I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

#### "I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over $600 per month. I LOVE StudySoup!"

#### "I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

#### "It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.