New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

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

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here


by: Danielle Moore


Danielle Moore
GPA 3.61


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in University Studies

This 67 page Class Notes was uploaded by Danielle Moore on Saturday September 12, 2015. The Class Notes belongs to Uni Stu 4 at University of California - Irvine taught by Staff in Fall. Since its upload, it has received 58 views. For similar materials see /class/201929/uni-stu-4-university-of-california-irvine in University Studies at University of California - Irvine.




Report this Material


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: 09/12/15
Stem Cells Ethical Issues V Sidney Goluib PhD 1 TIE i jisziiiisi a fug mm mm 1 rhou 0 autumn mull hum00M J Stem Cells Make Copies of Themselves Through Cell Division or 6090 U Irvine Cells Adapt far Many Parts of the Body Bone marrow Pancreas Blastocysts Contain Embryonic Stem Cells d 39 Blmlocysl 12 cells rmnm ran About 4 days in culture W Embryonic Stem fc s inner Eel 1 1 7 3quot V a t quotIquot 9r 2f g 3 39739 3 r Dominic Doyl39e39 7 V haltm Pluripotent Stem Cell Sources Embryonic Obtained from excess blastocysts from lVF procedures Fetal Obtained from early miscarriages or abortions Some success in treating Parkinson s Disease Nuclear transfer to generate blastocysts Same technology for reproductive cloning Induced pluripotent stem cells iPS created by transferring 48 genes into adult cells UCllee hESC Ethical Issues Blastocysts as a potential human life Respect for fetalembryonic materials Nuclear transfer technology raises the possibility of human reproductive cloning Research use of humananimal chimeras might alter our definition of human Defining the rights of the donors of the genetic material Moral Status of the Embryo ESCs are obtained from products of fertilization When does life begin At conception Roman Catholic view since Pope Pius IX reinforced in 2008 by Vatican document quotDignitas Personae quot Along with abortion ESCs are a moral and political issue of importance to many FundamentalistEvangelical Protestants Many other religious views place beginning of personhood later Islam and Judaism traditional 40 days respect for healing Buddhism and Hinduism reincarnation karmic implications sacrificial traditions centrality of com passion UCiirVine sommc NUCLEUS CELL NUCLEUS If inner cell mass is placed in culture the stem cells will divide Develops into a blastocyst PANCREATIC NERVE CELLS CELLS Human Reproductive Cloning Opposed by the National Research Council as dangerous and likely to fail Opposed by all reputable scientific organizations Already regulated by the FDA Bills twice passed House to ban research criminal penalties but died in Senate U IrVine Chimeras Myth or Mad Science Etruscan chimerastatue Photo National Geographic Chimeras are organisms composed of stable combinations of cells derived from different species Experimental example Human embryonic stem cells differentiated into brain cells and inserted into mouse brain Most controversial lf human stem cells were inserted into developing nonhuman embryo UCJIWJEHQ Current Federal Policy 1997 NIH appropriation amendment DickeyWicker prohibits federal funding to create or destroy human embryos for research President 6 W Bush limitations on funding lifted by President Obama Draft guidelines open for input Several laws promote alternatives to embryonic cells such as cord blood Fetal cells allowed for transplants Commercialization prohibited Current Federal Policy Does NOT Affect Legality of embryonic stem cell research Legality of research using somatic cell nuclear transfer Authority of states to expand fund limit or prohibit stem cell research Anything to do with lVF Stem Cell Professional Regulation Guidelines from National Academy of Sciences ISSCR other scientific groups California and other state standards Consensus on key points Local oversight SCROs Altruistic and consented donations of genetic materials Provenance of cells and tissues No reproductive cloning no reproducing chimeras n A war 1 V I o n v u v a w States with permissive stem cell Legislation or States igniting research criminal on embryonic or fetal materials California reposition 71 Stem Cell arch and Cures Initiatives Authorizes 3 i l l ign lgward si cell research an annual spending Iiniit mi 359 million l Creates quotCalifo gig msuwie liar generative Medlcmequot 1 39 1 h 7 x Establishes ct mstitutl genduct stem cell research Prohibits statevfu Passed Nov 2004 UCI Human Stem Cell Research Oversight hSCRO Committee Appointed October 2005 10 members stem cell science clinical investigation fertility medicine ethics science policy community reps Policy and scientific review Coordinates with IRB IACUC and other oversight bodies Disasters to avoid Chapter 4 Solving Differential Equations 41 Introduction In this chapter we explore the use of both Matlab and Maple for solving what are besides linear systems among the most fundamental problems in applied mathematics differential equations We will see that in many cases differential equations may be solved analytically ie a formula for the solution can be obtained in which case Maple is an ideal tool More often though an analytical solution is not possible in which case we must solve the equation numerically and in this scenario both Matlab and Maple offer a suite of tools Before we begin we review some basic concepts regarding differential equations and state the types of problems we will solve using Matlab and Maple in this chapter 411 Ordinary Differential Equations An ordinary di erential equation or ODE is an equation relating its solu tion yt which is unknown function of one variable to its derivatives or other functions The quantity yt is known as the dependent variable as it depends on the quantity t known as the independent variable In most cases the independent variable represents time or spatial position in one dimension The most common ODE is a rstorder equation which can be written 143 in the form d 3 7 t t 41 d lt ylt gtgt lt gt where f is some function of both the independent and dependent variable In general the order of a differential equation is equal to the order of the highest derivative appearing in the equation For example the equation dzy 7 42 dtz 3 l is a secondorder equation The solution to 41 if it exists is not unique but rather depends on an arbitrary constant Example The ODE 7gt 43 d 3 l where A is a constant is yt Ce V where C is an arbitrary constant A unique solution may be obtained by prescribing an initial condition on the solution 3t which typically takes the form 3ND 30 44 The problem described by the ODE 41 and initial condition 44 is known as the initial value problem Example The initial value problem dy 7 A 0 1 45 dt 37 3 l gt has the unique solution yt e V For a higher order ODE additional initial conditions must be speci ed to ensure the existence of a unique solution In general the number of initial conditions is equal to the order of the ODE As we will see however ODE s of higher order may be rewritten as a system of rst order ODE s where the solution is a vector valued function of the independent variable 412 Partial Differential Equations A partial di erential equation or PDE is an equation that relates its solu tion it a function of several variables to its partial derivatives with respect to these variables it is the dependent variable a function of several inde pendent variables which typically represent both spatial position and time 144 42 Solving Differential Equations in Matlab Matlab provides several methods for solving the general rst order differen tial equation 30 WWW 310 307 46 Where f is a given function and 30 is a given vector of initial data This differential equation is known as the initial value problem Partial differential equations that involve only rst derivatives in time can be solved numerically by solving an initial value problem 421 Runge Kutta methods Runge Kutta methods are used to compute ytn1 from 3tn as accurately as possible by evaluating fty at select points in the interval tm twirl The more points that are used the greater the accuracy but also the greater the computational effort required Matlab provides functions for Runge Kutta methods of varying order of accuracy Runge Kutta Method of order 2 Let h be our time step tn1 7 tn and let yn 3tn We try to construct an approximation of the form 31n1 3m ah bkzy 47 Where k1 hfamynl k2 hftn04hyyn8k1gt Where a b 04 and 8 are constants to be determined so that our approxima tion will be as accurate as possible Using a Taylor series for 3t centered at t tn we obtain using the original differential equation 122 123 31n1 3m NJtn 33071 KyHtnl ylttngthflttmyngt ltfiffygtolth3gt 410 145 Furthermore again using a Taylor series centered at t tn we have fan 041173171 lm 1607173172 ahft klfy 0012 411 Substituting the previous expression for ftn ahyn k1 into the Taylor series for 31 yields gm 2m a 2w Weft ffy 0023 412 so by setting a 1 413 we obtain h yn1 371 ifamyn m mm hflttmyngtgtl 0013 414 Runge Kutta method of order 4 Using a similar process we can derive the 4th order method whose error is 0025 1 yn1 yn 60 27 2k3k4 415 where k1 hftmyngt h 1 k2 hf tn yn k1gt 416 h 1 k3 k4 hftn hyyn k3 Matlab provides the function ode23 to use a combination of second and third order Runge Kutta methods to solve 3t fty Given the function fty an initial time to initial data yo 3t0 and a nal time tf ode23 will compute the solution 3t at various times between to and tf and return a column vector of the values of t at which the solution is computed as well as an array containing the values of 3t at those times In the following example we wish to solve a scalar ODE 3t N410 7W 310 1 417 which has the exact solution 3t exp7t First we must create an M le in this case called an ODE le that de nes our function fty 146 elainel2quotgt cat gt simpleodem function f odefilety f y Now we can call ode23 Our arguments are the name of our ODE le in single quotes and without the m extension a row vector containing our initial and nal t values and our value of 30 gtgt TY ode23 simpleode 0 10 1 Since we know the exact solution in this case we will plot it against our approximate solution gtgt YexactexpT gtgt plotTY ro TYexact g gtgt xlabel t gtgt ylabel y gtgt legend Computed solution Exact solution gtgt title Solutions of y y y01 gtgt normYexactY 0 00 14 As the plot in Figure 41 shows our approximation is quite accurate Alternatively we can specify speci c times at which we wish 3t to be computed gtgt TYode23 simpleode 02101 T 0003JgtMO 147 Solutions of y yi y01 b O Computed solution 091 i Exact solution 08 iii 39 037 i 02 i 01 SK 0 i i i 8 8 QrQ Q m m V rx 0 1 2 3 4 5 6 7 8 9 1 0 i Figure 41 Plot of solution to 417 red Circles vs exact solution green solid curve 148 OOOOOb k Options to ODE solvers The odeset function can be used to further customize the solution process It accepts pairs of option names and option values Where option names are strings in single quotes It returns a structure containing the new options which may be passed back to odeset if options in an existing structure are to be modi ed The odeget function retrieves option values from an existing option structure It accepts the option structure and an option name as arguments Some commonly used options are RelTol is used to specify the relative error tolerance for each compo nent 31 of the solution 3 2 1 n where n lengthy For each step of Runge Kutta that is performed the error e in 3 satis es 62 maXRelToly AbsToli 418 The default value is 0001 AbsTol is used to specify the absolute error Set AbsTol to a scalar to impose an error bound that applies to all components of the solution or a vector to impose different bounds on different components The default value is 0001 Refine increases the number of output points to produce smoother output The number of output points is multipled by Refine lts default value is 1 Dutputhn refers to a function that should be called after every time step If an ODE solver is called with no output arguments the default function is odeplot Otherwise no output function is called by de fault Output functions are called with three arguments at the start of integration the tspan and y0 arguments passed to the solver and 149 the string init After Then it is called with two arguments t and y representing the time and solution value at that time after each time step 0 DutputSel can be set to a vector of indices indicating which compo nents of the solution should be passed to Dutputhn By default all components are passed 0 Stats can either be on or off default If on computational cost statistics are displayed Jacobian is set to on default is off if the ODE le is written so that Fty jacobian returns 8F8y o JConstant is used to indicate that the Jacobian matrix BFay is con stant lts default value is off if the Jacobian is constant it should be set to on o JPattern should be set to on default is off if the ODE le is coded so that F J J jpattern returns a sparse matrix with 1 s corre sponding to nonzero entries in 8F8y o Vectorized can be set to on default is off if the ODE le is coded so that a set of y values may be passed to F ie Ft y1 y2 returns Fty1 Fty2 MaxStep is used to impose an upper bound on the step size 0 InitialStep is used to suggest an initial step size NormControl can be turned on default is off to control the error in each time step by the relationship Hell S maXRelTolH3HAbsTol 419 rather than bounding the error component Wise gtgt optionsodeset RelTol 1 e6 Refine 2 Stats on JConstant on options AbsTol BDF Events 150 InitialStep Jacobian JConstant on JPattern Mass MassConstant MassSingular MaxDrder MaxStep NormControl Dutputhn DutputSel Refine RelTol 10000e06 Stats on Vectorized M In the following example7 we solve a system of ODE s A plot of the solution is given in Figure 42 function F odefilety Adiag12 FAy gtgt ode23 odesystem 0 1 ones41options 70 successful steps 0 failed attempts 211 function evaluations 0 partial derivatives 0 LU decompositions 0 solutions of linear systems The ode45 function can be used to obtain greater accuracy with fewer time steps7 employing a combination of fourth and fth order methods The tradeoff is that more computation effort is expended per time step lts usage is identical to that of ode23 422 Multistep Methods The Runge Kutta methods are known as mestep methods because they rely only the solution at one previous time to obtain the solution at the next time 151 0 0 01 02 03 04 05 06 07 08 09 1 Figure 42 Plot of a solution to a system of ODEs 152 Multistep methods compute the solution at a given time using values of the solution at multiple times in the past The AdamsBashforth methods are a class of such methods of varying orders of accuracy The following method is 5th order ie the error per time step h is Oh5 h yn1 3m lt55fn 59fn71 37fn72 anigl 420 The AdamsMoultoh methods are predictorcorrector methods which use a multistep method to predict the value of the solution at a future time based on current knowledge and then correct using another multistep scheme that takes the information from the predictor into account The ode113 solver uses various Adams Bashforth and Adams Moulton methods of orders 1 through 12 Its usage is identical to that of ode23 and ode45 423 Higherorder equations While so far we have only discussed rstorder ODE s these solvers can just as easily be applied to higher order equations A higher order ODE can be written as a system of rst order ODE s by introducing new variables to represent the higher order derivatives The number of equations in the system is equal to the order of the highest deriva tive For example for the second order equation 6123 dy 777 0 421 d dty 7 gt we introduce two dependent variables 31 3 32 3quot 422 Then we can rewrite this equation as 93 32 31 232 7 31 423 Some ODE s are more dif cult to solve because their solutions contain components with widely varying time scales Such equations are called stiff A simple example is the equation 6123 dy i 1001 dt d 1000y 0 424 153 which has the general solution 3t Ae t Be mOOt 425 The second component Be mOOt decays much more rapidly than the rst component Ae t As a result an extremely small time step must be used in order to obtain an accurate solution or even any solution at all Sys tems of ODEs derived from PDEs tend to be stiff so such equations are extremely common Matlab provides a family of ODE solvers for use with stiff equations All of these are used in the same way as other ODE solvers o odelBs uses backward difference formulas of orders 1 5 to solve stiff equations 0 ode235 uses second and third order methods ode23tb uses implicit Runge Kutta formulas of second and third order Partial differential equations are often rephrased as systems of ODE s for numerical solution To make this transition we view a function fwt as a vector valued function f t where the elements of f t are the values of fwt at selected w values called gridpomts The function f t is called a yridfunction Using gridfunctions An initialboundary value problem or IBVP of the form 8 8 Pltajmgt7u f we where uwt must satisfy given boundary conditions can be viewed as an initial value problem du gmmaun am where A is a matrix that approximates the dz erential operator P and also enforces the boundary conditions We now use this technique to solve the rstorder wave equation with periodic boundary conditions an an Ea 0ltwlt27r tgt0 428 uw0 0 lt w lt 27r 429 154 u0t u27rt tgt 0 430 We represent functions on the interval 07 2w using N equally spaced grid points7 with spacing h 27rN We then approximate the differentiation operator as follows 3f fwhfwh 7 431 830 2h gt Since we are working with periodic functions this approximation yields a circulant matrix A O 1 O O 71 71 O 1 O O a O 71 O 1 147 2 a a a 0 432 O O 71 O 1 1 O O 71 0 We would like to be able to create this matrix only once and then use it for every time step To that end7 we pass A as an additional argument the function de ned in to our ODE le Any options to the function odefile beyond the third argument are assumed to be such additional parameters passed to the solver We construct our ODE ls as follows elaine21quotgt cat gt waveeqnm function F odefiletyflagA FAy The following Matlab code then sets up and solves the PDE7 and plots the solution gtgt a1 gtgt N256 gtgt h2piN1 gtgt xh0N gtgt fsinx Aa2hdiagonesN11diagonesN11 AN1112h A1N112h TYode23s waveeqn 0 1foptionsA plotxY VVVVV VVVVV 155 uxt Figure 43 Solution to the rstorder wave equation gtgt xlabel x gtgt ylabel uxt gtgt title Solution to dudt dudx ux0 sinx Each row of the solution matrix Y represents the solution uwt for a given time t The solution is plotted in Figure 43 Visualizing Solutions in Higher Dimensions Matlab provides two functions odephas2 and odephasB that allow visual ization of solutions in two and three dimensions respectively To use one of these functions the Dutputhn option should be set to the name of the function you wish to use gtgt optionsodesetoptions Dutputhn odephas2 156 l l l l l l 02 0 02 04 06 08 1 12 Figure 44 Orbit of the solution of a system of two ODEs The above code will allow us to solve a system of two ODE s and View the orbit of the solution wtyt in the plane We de ne our ODE le as follows elaine21quotgt cat gt orbitm function f odefilety f exptsintexptcost exptsintexptcost and then solve gtgt ode23 orbit 0 10 1 0 options The orbit of the solution is plotted in Figure 44 157 43 Solving ODES in Maple Maple offers a package called DEtools that provides several functions for analyzing and solving ordinary differential equations ODEs To use the functions in this package it is recommended to use the with statement in your Maple session gt withDEtools 431 Specifying ODEs in Maple An ODE is described to Maple in the same way as any other equation in an expression of the form 5pr ewpr where either expression includes the unknown solution and some of its derivatives Derivatives are speci ed using Maple s diff function or its D notation The following two equations are equivalent and illustrate the use of the diff and D forms gt DDEl diffyxx2 diffyxx yx sinx Id I d DDEl yx yx yx sinx I 2 I dX dx gt DDE2 D2 y x Dyx yx sinx39 2 DDE2 D y x Dy x yx sinx The dsolve function uses a variety of methods to attempt to solve an ODE analytically If it is unable to construct a closed form or explicit solu tion it will instead try to return an implicit solution de ned by an equation Alternatively dsolve can be asked to solve an ODE numerically as in Mat lab gt odel diffyxxyxquot2yxsinxcosx d 2 odel yx yx yx sinx cosx dx 158 gt ansl dsolveodel C1 expcosx ansl yx sinx I C1 I expcosx dx 1 I In the previous example the solution contained an arbitrary constant Cl This is because the solution of the given ODE is only unique up to that constant Alternatively initial conditions can be supplied to dsolve similar to those given to Matlab s ODE solvers in order to obtain a unique solution Typically initial conditions are speci ed by passing a set as the rst argument to dsolve consisting of all ODEs and any initial conditions Sets in Maple are delimited by curly braces We use the same ODE as in the previous example but with an initial condition gt dsolveodel y01 exp cos x yx sinx cosh1 sinh1 I expcosu du gt dsolvediffxtt xtx02 xt 2 expt dsolve can use a number of methods to solve ODEs numerically as well as analytically To use numerical methods pass the argument typenumeric to dsolve 159 Optionally one can specify a numerical method to be used using the method argument which can have one of these values 0 rkf45 Fehlberg fourth fth order Runge Kutta method 0 dverk78 seventh eighth order continuous Runge Kutta method 0 classical by default the forward Euler method which is simple but has poor convergence properties One can specify methodclassical choice where choice can be 7 foreuler is forward Euler 7 heunform is the trapezoidal rule 7 impoly is the modi ed Euler method 7 rk2 rk3 and rk4 are second third and fourth order Runge Kutta methods 7 adambash is the Adams Bashforth method 7 abmoulton is the Adams Moulton method 0 gear is the Gear singlestep extrapolation method 0 mgear is the Gear multi step method 0 lsode uses the Livermore Stiff ODE solver o taylorseries uses a Taylor series method We will solve this simple ODE numerically using dsolve gt ode diffxttxt d ode xt Xt dt gt ic x02 1c x0 2 By default dsolve returns a procedure Whose arguments are values of the independent variables of the ODE and Whose output is the value of the solution at those values 160 gt g 1 d5 1V80deicXttypenumeric methodclassical rkf45 g 1 PIOCka45X end proc gt g0 6 0 xt 2 gt g1 t 1 xt 735758877735078864 Alternatively one can use the value argument to specify a list of values at which the solution should be evalutaed In this case7 Maple returns a 2 X 1 matrix identifying all relevant variables and values for the solution gt dsolveode icxt typenumeric valuearray 00102 6 Xt 0 2 J J 1 1809674836 J 2 1637461506 dsolve can also return a solution in series form gt ode diff yt ttdiff yt tquot20 2 Id I d 2 ode yt yt 0 2 dt dt When the initial conditions are not given7 the answer is expressed in terms of the solution and its derivatives evaluated at the origin gt ans dsolve ode yt typeseries 2 2 3 3 ans yt y0 Dy0 t 12 Dy0 t 13 Dy0 6 161 4 4 6 14 Dy0 t 15 Dy0 t Dt If initial conditions are given the series is centered at that the initial point gt ans dsolveodeyaYaDyaDYa yttypeseries 2 2 3 3 ans yt Ya DYa t a 12 DYa t a 13 DYa t a 4 4 5 5 6 14 DYa t a 15 DYa t a Dt a By default7 the rst six terms of the series are returned The global variable Drder can be used to obtain a different number of terms gt Order 3 Order 3 The odetest function can be used to verify that a solution returned by dsolve does in fact solve the ODE gt DDE diffyxxFyxxlnxx lnx d yx x lnx ODE yx F lnx d x gt sol dsolveDDEimplicit yx lnx x I 1 sol lnx I da C1 0 I a 1 Fa gt odetestsolDDE 0 162 The odeadvisor function can be used to obtain information about an ODE that may be helpful in solving it or simply understanding it lnter nally7 dsolve uses the analysis techniques of odeadvisor to determine which method it should use to solve an ODE gt DDE xdiffyxxayxquot2yxbxquot2 d 2 2 DDE x yx a yx yX b X dx gt odeadvisorDDE homogeneous class D rational Riccati 432 Other solution techniques Using the information obtained by odeadvisor one can use a number of other Maple functions to solve an ODE These methods are used by dsolve but are still desirable if one Wishes to have more control over which solution techniques are used Exact Equations An ODE is exact if it can be written in the form d1 du 07 433 since then we can apply the product rule for differentiation in reverse and obtain d7w dw Maple s exactsol determines whether an ODE is exact7 and if so7 solves it 0 434 gt ode 3tquot3ztquot2diffztt3tquot2ztquot3 0 gt exactsol ode zt 12 C1 12 C1 12 I 3 C1 2t Zt t t 163 12 12 C1 12 I 3 C1 zt t Homogeneous Equations Many ODEs are homogeneous meaning they can be written as functions of new variables often making them easier to solve For example an ODE is homogeneous of class A if it can be written as 31 f 7 435 doc 56 so that we can make the change of variable 2 Maple s genhomosol function can solve various types of homogeneous equations gt ode zt sqrttquot2 ztquot2 tDZ t 01 gt genhomosol ode zt zt arctan lnt C1 0 2 2 12 t Zt Linear Equations An differential equation is linear if the coef cients of the solution and of its derivatives do not depend on the solution itself For example the equation dy 1 0 436 d gt is linear whereas 013 2 7 0 437 dt4y gt is not Maple s linearsol function can solve rst order linear equations gt ode diffztt ptzt qtgt d ode zt pt zt qt 164 dt gt linearsol ode zt zt qt exp pt dt dt Cll exp pt dt Separable Equations An ODE is separable if the independent and dependent variables can be isolated on opposite sides of the equation For example dy 7 438 dw my gt is separable as we can rewrite it as 1 7 dy w dw 439 3 and solve by integrating both sides Maple s separablesol detects whether an equation is separable and if so solves it gt ode tquot2zt1 ztquot2t1diffztt 0 2 2 d ode t zt 1 zt t 1 Iquot Zt 0 dt gt separablesol ode zt 2 2 12 t t lnt 1 12 zt zt lnzt 1 C1 0 Equations with Constant Coe icients A differential equation has constant coefficients if the coe icents of the solution and its derivatives do not depend on either the dependent or inde 165 pendent variables For example7 the equation day dy 7 7 27 0 440 dt2 dt 31 gt has constant coe icients7 but dy dy W 7 ta 7 0 441 does not Maple s constcoeffsols function can solve equations that have con stant coe icients gt ode 3diffztt3 diffztt2 diffztt 3zt 0 gt constcoeffsolsode zt 12 12 expt exp 23 t sin13 5 1 exp 23 t cos13 5 t The solution of such equations arises from the roots of a polynomial derived from the coe icients If the roots of that polynomial cannot be found7 Maple returns an implicitly de ned solution gt ode diff zt t5diff zt t2diff zt t3zt gt constcoeffsolsode zt 5 expRooth3 Z Z Z index 5 t 2 5 expRooth3 Z Z Z index 4 t 2 5 expRooth3 Z Z Z index 3 t 2 5 expRooth3 Z Z Z index 2 t 2 5 expRooth3 Z Z Z index 1 t 166 Equations with Rational Coe icients A differential equation has rational coe icients if the coef cients can be written as the quotient of two polynomials of the independent variable For example the equation dzz 3 dz 3 7 7 if i t 0 442 dt2 tdtt22gt gt has rational coe icients Maple s Iatsols function can solve equations with rational coe icients gt ode D2 z t 3tDz t 3tquot2zt gt ratsolsode zt 3 tt Changing Variables In many cases a change of variable may simplify an equation so that it can be solved Maple s dchange function from its PDEtools package can be used to make such a change lts arguments are a set of equations de ning the change of variable the differential equation on which to perform the change and a list of the new variables The following ODE is invariant under rotation by an angle alpha gt DDE yxxdiff yxxxyxdiff yxxHsqrtxquot2yx quot2 d yx x yx dx 2 2 12 DDE Hx yx d x yx yx dx gt tr x ysxssinalpha xscosalpha gt yx cosalphaysxs sinalphaxs gt newDDE simplifydchangetrDDE xsysxs d xs ysxs ysxs 167 dxs 2 2 12 newDDE Hysxs xs d ysxs ysxs xs dxs 433 Solving Systems of ODEs In many applications a system of ODEs must be solved Frequently such a system has the form Y tgt Amit 30gt 443 Where Y is a vector of solutions y1tynt At is an n X 71 matrix Whose entries are functions of t and Bt is a vector of functions oft Such an equation can be solved using Maple s matrixDE function gt A matrix22 1tquot2t1 2 A 1 t l f l t 1 l gt sol matrixDEAt sol f I 32 52 32 52 I t BesselK35 25 t explttgt t BesselI35 25 t 9XPt 52 52 1 expt t BesselK25 25 t EXP t BesselI25 25 t J 0 0 Higher order ODEs can be converted to a system of rstorder ODEs The convertsys function can be used to aid in such a conversion gt deq2 D3 y x yxx gt init2 y0 3 Dy 0 2 D2 y 0 1 gt convertsysdeq2 init2 yx x YP1 Y2 YP2 Y3 YP3 Y1 x 168 2 d d Yfll yx Y2 yx Y3 yx 0 3 2 1 dx 2 dx 434 Displaying Solutions Maple offers a set of functions that can be used to visualize the solution of an ODE In particular the DEplot function can be used to solve an ODE numeri cally and plot solution curves given ranges for the dependent and indepen dent variables to guide in the solution and plotting processes gt DEplotcosxdiffyxx3diffyxx2 gt Pidiffyxxyxxyx gt x25 14 gt y01Dy02D2y01ll gt y45stepsize05 The solution to the above ODE is plotted in Figure 45 If the equation or system of equations is autonomous ie the coef cients of the dependent variable and its derivatives do not depend on the indepen dent variable then a direction eld is also plotted The following Maple statement produces a direction eld for the ODE dwdt 7290 which is shown in Figure 46 DEplotdiff xt t2xt xt t0 1x0 2 44 Simulink Simulink is one of Matlab s toolboxes It allows a user to describe to Matlab a dynamical system which is a sytem that can be modeled by a differential equation and whose solution is dependent on time Simulink provides an intuitive means of describing a model to Matlab that can be simulated A mathematical model of a physical phenomenon can be viewed as a combination of several simpler processes Using Simulink you can link several black boxes77 together in order to create the entire model and then have Matlab run simulate the model 169 7 2 7 4 Figure 45 Solution to ODE plotted using DEplot 170 1 Q222Q Q2c2Q Q2Q2Q Q2222 Q2Q2Q 7 3 xxxxxxx N ANNNNNNNNNNNNNNNNNNN ANNNNNNNNNNNNNNNNNNN 016 018 1 t 012 0 4 Figure 46 Solution and direction eld for autonomous ODE system 171 542 in W Emma Salute Smk Eammuau Dlacvete Math Functmm Nanhnea annals s Yams s syslems 5mm Black Llhva v 3 u EDPVHEM c SEEHESE bv me Mathwmks he Bgme 4 7 Main amulink wmdow 441 Invoking Simulink Smullnkcen be used el39thelchmugh its set oi commands Ol thiough its cm which isiecommended T u stazt the simulmlc cm simply type similinh at the piompt Matlalo Will then display ailguie wmdcrw With seyeial choices oi caiegoiies oi components that can be used to conmuct amodel This WmeWIE shown m mgme 4 Usng the We menu you may czeaie a new empty model and begin wnmucmon 442 Building Models in Simulink Ln the main simulinlc wmdow you may doublerdldi on any oi the icons iepiesenung caiegoiiesoi model components d obtain an wilguie wmdcrw that contams seyeial black boxes iiom that caiegoiy ou can mclude any oi these black boxes 01 Modcs in youi model by d g it into e il e wmdcrw czeaied fol youi own model You may then link blocks WlEhm youi model by cliclong on one oi the outputs oi one block and diaggmg the mouse pomtei to an mph oi anothei block 443 Block Properties Once ahlock isincluded in youi model you may doublerdldi on the block to edit its piopeiues An example oi these piopeity dialogs is shown m e 4 3 Am all oi yuul hlockshaye been linked and then piopeiueshaye been set appiopnaiely you may go to the simulation menu and choose Stazt to nm the simulation 17 mm 43 Fmpexhes am From Workspace block 444 A Simulink Model We will now use Simulink to simulate the motion of a pendulum If there is viscous friction in the pivot and there is an applied moment Mt around the pivot then a nonlinear differential equation describes the angle t that the pendulum makes with the vertical at time t 2 2 0 mgLsinO Mt 444 where l is the mass moment of inertia about the pivot m is the mass of the pendulum L is the length of the pendulum s rod and g is the gravity constant For this simulation we will assume that l 4 mgL 10 c 08 and Mt is a square wave with an amplitude of 3 and a frequency of 05HZ Furthermore since the differential equation is of second order we will need to specify initial conditions on t and 6 6 We prescribe 60 7r4 and 90 0 That is the pendulum starts from a resting position held at a 45 degree angle Before constructing the model in Simulink we rewrite the second order equation as a system of two rst order equations and then rewrite them as integral equations lntroducting a new dependent variable wt t we obtain ea wsds W 708w5710sin sMsds 445 with initial conditions 90 7r4 040 0 446 445 Integrator blocks An integrator block is used in a model to compute the integral of some quantity In this case we see that we will need two integrator blocks one to obtain wt and then a second block to integrate wt to obtain 6t The values of wt and t are then combined with the value of Mt to produce the input back into the rst integrator block to compute wt again We will add two integrator blocks to our model and link them together to re ect that the output of one integration wt is the input to the other that computes t We also edit the properties of both blocks to account for the initial conditions Finally we edit the labels of these blocks to indicate 174 Flo Edlt Vew Smu amn Form Tole amega theta mule 49 Model wlth two mtegatm hlooke that one pluducei m ae output and the other pluducei 9 The updated model l5 dlsplayed m mule 49 4 46 Gain blocks cam blocks ale used to zmlltlpb eome quahoty by a eoalaz n the model 5 hat m l5 multlplled by a s and aleo that the entlle mtegand fol m e 012 add two gem hlooke The fun hae a value or o s and twelve the output om he rst mtegatuz whxch leple enta o The Eecund a value crf 0 25 and xtg output yen25 a5 due mput to the Integrator mat yzelde o The updated model to dxsplayed m mule 4 10 4 47 Function blocks We ubyelve that the quanth 10 oh 9 he computed Smce 9 he the output of the second mteglatm hlook we add a fmtwn block that tomputee the quanth 10 smu Whale u to he mput cf the mctlun hlook We then eet xtg mput to be the output crf the Eeccmd mtegatoz black whlch lepteienti 9 he model wlth thze iuhttzoh hlook added he ehowh m mule 4 11 175 mule 410 Model thh two gam black added We Edw Vxew swam Fuvrra Tums mgme 4 11 amazon block added to pendulum mndel 448 Sources and Sinks A source block provides external input to the model and a sink block receives the model s output and stores it externally A commonly used source is from workspace which uses the value of an object in the Matlab workspace as input to the model Similarly the sink to workspace takes its input and stores it in the Matlab workspace The source and sink windows displaying the blocks available for each category are shown in Figures 412 and 413 respectively For our model we add a source block that represents the signal By editing its properties we can specify the shape of the wave its amplitude and its frequency The properties dialog for this block is shown in Figure 449 Sum blocks Now we have all of the terms in the expression that is integrated and then multiplied by 025 to produce w To add them together we add a sum block available from the Math category By editing its properties we can dictate how many inputs the blocks should have and whether the inputs should be added or subtracted In this case we will be adding one input Mt and subtracting two 08w and 10 sin 6 The properties dialog for the sum block is shown in Figure 415 and the updated model with the sum block added is shown in Figure 416 4410 The Scope Sink Finally we add a sink a scope block This block is used to plot its input in this case t with respect to time It provides toolbar buttons to zoom in or out among other functionality The completed model is shown in Figure 417 Once we have linked all of the blocks we can run the simulation and observe the output As expected the pendulum swings back and forth but to a lesser extent as time moves forward However because of the applied moment around the pivot it does not come to rest The plot of 6 is shown in Figure 418 45 Exercises 1 In this problem we examine a slight variation on banded matrices circulam matrices These are used to solve partial differential equa 177 le Edit ew Emmet Ramp Sine Wave Repeating Sequence mm Dieerete Pulee F39ulee Chirp Signal Generator Generator 39 1234 Clock Digital Clock untitled mat r gt From File From Workspaee Ha d m Uniform Random Band Limited Number Number White Noise Figure 412 Simulink source blocks 178 line gait EiEW Fn39rmag SCOPE W Graph Display untitledmat simaut TU File To Workspace Stop Simulation Figure 413 Simulink sink blocks 179 Figure 414 Properties of Signal Generator block 180 Figure 415 Properties of sum block 181 E Xgule 4 16 Model mm nun black Included We Edll vlew Slmu ahun Fuvrrat Tools aw Benevamv mule 417 Completed Sxmvlmk model Rgumd pmmmmmwmm mmwwh mum hmde mama mh arch I mmm W mm a a E a omega m we zm a lt1 m 0413 2gt0 Mg w w W m w my mm m a ma Maw 09 4 mm Mg and mm mm m wwm wt 34 g 412494 3mm 41mm 7m 32 k 31 2 no u mg w 4mm 4 k item 4 r m mlm we 9 mm 2I mm um mm 2 m own an WW mm aquot m computing uwt k uwhtk7uw7htk t k t k we gt we gta 2 451 This method is called implicit because in order to obtain the values of u at time t k from those at time t it is necesssary to solve a system of linear equations In this case we have ak ak 7453 7 ht k uwt k 7 ht k uwt 452 It follows that we must sovle a system Aw b where the right hand side 1 represents the values of the solution u at time t and the coe icient matrix A has diagonal elements equal to 1 sub diagonal elements equal to ak2h and super diagonal elements equal to 7ak2h Thus we have a banded matrix What about the case where w is 0 Then we need the values of u at points outside of the interval 01 Since u is periodic though we can wrap around77 and use points at the right end of the interval to obtain the equations for u0t Similarly when computing u1 7 ht we must use 210 in place of This requires us to add elements at the corners of our matrix A In particular if A is an n X 71 matrix we must set Am ak2h and Am 7ak2h The matrix is no longer banded but is called circulam because the super diagonal and sub diagonal both Wrap around77 and continue through the opposite corners of the matrix This is a special case of what is known as an antisymmetric or Toeplitz matrix In this case our matrix looks like this 1 7ak2h 0 m 0 ak2h ak2h 1 7ak2h 0 m 0 A 7 0 0 0 m 0 akQh 1 7ak2h l 7ak2h 0 m 0 ak2h 1 l 453 We will now step through the process of constructing and then solving such a system We will let a 1 our time step k 01 and choose N 2O gridpoints within the interval 01 They will be equally spaced with spacing h 1N 184 10 a Construct a banded matrix A of size N X N with the diagonal equal to all 1 s the super diagonal equal to iak2h and the sub diagonal equal to ak2h Fill in the corner elements A1N and AN1 as described above to make the matrix circulant A U v Compute the LU decomposition of A What can you say about the structure of L and U Does your discussion of using LU or QR for banded matrices apply here as well Discuss A O v Construct a vector b representing the initial data f In this case we will use fw sin27rw Hints rst construct a column vector x containing the gridpoints wj jh j 0 Ni 1 The sin function in Matlab applies sin to all elements of its argument A 1 v Solve the system Aul b Then use 111 as the right hand side and solve Aug 111 Repeat this to obtain 111 u5 Plot b versus x you should have computed both vectors in part Then use Matlab s hold command to hold that plot in place and plot 11 versus x for 2 1 5 Based on your plots can you describe the behavior of the solution uwt as time moves forward In this problem we will use sparse matrices and iterative methods for solving a convectiondi usion problem an an 8271 Eabw 0ltwlt27r tgt0 454 uw0 0 lt w lt 27r 455 u0t u27rt tgt 0 456 We can solve this problem using a method similar to the one discussed in Exercise 2 for the rst order wave equation As in that case we assume a time step of k and a grid of N equally spaced points with spacing h 27rN In this case we must build a circulant matrix A of size N X N with the following entries 0 The main diagonal has entries equal to 1 25122 0 The superdiagonal entries and the lower left entry A NJ are all equal to ak2h 7 Zak122 185 o The subdiagonal entries and the upper right entry ALN are all equal to iak2h 7 Zak122 In the case where a 0 A is symmetric positive de nite but otherwise it is not Once we have constructed A we can compute the solution u at times t k2k3k as follows 0 Let u0 f where f is a vector of values of the initial data fw above evaluated at the gridpoints wj jh for j 01 N o Solve Au71 uj for j 01 Then uj approximates the solution uwjk evaluated at each of the gridpoints We can continue this process until we have evaluated the solution at some nal time say t 1 A 99 V Write a Matlab function convecsolve that accepts three argu ments a b and f The rst two arguments refer to a and b above while f is a column vector of length N 1 with entries de ned as follows 2 fjgtfjh7 h 7r j0N 457 Your function must solve the convection di fusion problem with the given parameters and return a matrix U whose columns are de ned as follows The jth column of U U j must hold the computed values of the solution uwjk for j 12 until the time jk 1 For this problem use k 1100 Thus U should be a N X 100 matrix If the argument a is 0 you must solve the system An using the Conjugate Gradient method Otherwise you must use the Quasi Minimal Residual QMR method k1 uk Use your function to solve the convection di fusion problem for the case where a 0 b 1 and fw sinw where f is to be evaluated at N 256 equally spaced points Plot the matrix U that is returned How does the solution behave as time moves forward Repeat part b with a 71 b 2 fw cos4w and N 256 Again how does the solution behave A U v A O V d Modify your function as follows to produce a new function convecsolve2 186 3 r gt 0 Use preconditioning If using Conjugate Gradients use choline and use R and R as left and right preconditioners Where R is the Cholesky factor returned by choline If using QMR use luinc to produce factors L and U and use them as left and right preconditioners In both cases use a drop tolerance of 05 as the second argument to choline or luinc When using pcg or qmr get the flag output and if its value is nonzero ie the iteration failed display a warning message and continue as before Let uwt represent the temperature at any point along a thin Wire at a speci c time The variable x denotes a position on the wire with w O denoting the left endpoint and w 1 denoting the right endpoint The variable t denotes time elapsed since the initial time t O The temperature at point x at the initial time is given by the function gw O lt w lt 1 The temperature of the endpoints of the Wire are held at a xed value 04 a Describe a mathematical problem that can be used to model the temperature of the Wire for t gt O Solve the problem given the data gw sin 27m and 04 O to obtain a prediction of What the temperature in the Wire will be at t 01 Try to obtain an answer that is accurate to Within 1 relative error ie try to ensure that your computed solution 71t1 satis es quot 1 7 1 Mac gt we gt 1027 uw71 Describe your approach to achieving this accuracy and explain Why you believe that it is effective A U v O lt 3 lt1 458 Consider the initial boundary value problem with the periodic bound ary co nditio ns utum 0ltwlt 1 tgt0 459 uw0 sin 47 0 S x S 1 460 u0t u1t t 2 0 461 We will solve this problem using a grid of n 1 equally spaced points x Z Aw 2 0n where Aw 1n 1 187


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

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

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Allison Fischer University of Alabama

"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!"

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund 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


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:

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

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.