0 Up votes0 Down votes

31 views6 pagesMar 09, 2012

© Attribution Non-Commercial (BY-NC)

PDF, TXT or read online from Scribd

Attribution Non-Commercial (BY-NC)

31 views

Attribution Non-Commercial (BY-NC)

- The Law of Explosive Growth: Lesson 20 from The 21 Irrefutable Laws of Leadership
- Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
- Hidden Figures Young Readers' Edition
- The E-Myth Revisited: Why Most Small Businesses Don't Work and
- Micro: A Novel
- The Wright Brothers
- The Other Einstein: A Novel
- State of Fear
- State of Fear
- The Power of Discipline: 7 Ways it Can Change Your Life
- The Kiss Quotient: A Novel
- The 10X Rule: The Only Difference Between Success and Failure
- Being Wrong: Adventures in the Margin of Error
- Algorithms to Live By: The Computer Science of Human Decisions
- The 6th Extinction
- The Black Swan
- The Art of Thinking Clearly
- The Last Battle
- Prince Caspian
- A Mind for Numbers: How to Excel at Math and Science Even If You Flunked Algebra

You are on page 1of 6

A differential equation is an equation that involves derivatives of one or more unknown functions. Solving the differential equation means nding a function (or every such function) that satises the differential equation. Many of the fundamental laws of physics, chemistry, biology and economics can be formulated as differential equations. Differential equations are often classied with respect to order. The order of a differential equation is the order of the highest derivative present in the equation. An ordinary differential equation(ODE) is a differential equation in which the unknown function in question is a function of a single independent variable. We shall only look at rst and second order ODEs in this chapter.

We will solve the following rst order ODE, dy = 2xy, dx y(0) = 2. (1)

This is a rather straight forward ODE but will allow us to demonstrate the approach to solving ODEs using Maple. Note that equation (1) is an initial value problem. This means that we are attempting to nd an exact solution depending on a particular initial condition, in this case y(0) = 2: the value of y, when x is 0, is 2. We will rst solve the problem ignoring the initial condition and obtain a general solution to the problem. Before attempting to solve an ODE in Maple it is necessary to load particular commands and functions that will be needed. The commands for dealing with ODEs in Maple are stored in the package DEtools. Additional commands for plotting ODE solution curves can be found in the package plots. Therefore our rst step is to load these two packages using the with command:

> >

with(plots): with(DEtools):

Maple: Solving Ordinary Differential Equations The next step is to input the ODE that we are attempting to solve. Remember that the function y depends on x and so it is necessary to input it as y(x) so that Maple is able to recognise the dependency. We shall label equation (1) as ODE1 using the assignment operator:

>

ODE1:=diff(y(x),x)=2*x*y(x); ODE1 :=

d dx

y(x) = 2 x y(x)

The command for solving an ODE is dsolve. Remember that if you are unfamiliar with any command you can look up the help le associated with it by simply placing a question mark (?) in front of the command and pressing enter. We shall now solve equation (1) and attempt to obtain the general solution.

>

2)

This is the general solution of equation (1). Note the C1 is Maples way of representing an arbitrary constant. In more complicated solutions this arbitrary constant might appear after the term that it is associated with. It is also possible to plot the solution curves of the general solution. To see a direction eld plot of the solution curves of equation (1) use the following command.

> >

dfieldplot(ODE1,y(x),x=-2..2,y=-2..2,color=blue,scaling=constrained, dirgrid=[40,40]);

The rst entry in parentheses is the differential equation ODE1. The second entry names the dependent variable y(x). The third and fourth entries give ranges for the independent and 2

Maple: Solving Ordinary Differential Equations dependent variables: x = 2 . . 2, y = 2 . . 2. The remaining entries are options and can be omitted if desired. It is common practice that whenever you are plotting direction elds you use the scaling = constrained option as otherwise the graph will appear misleading because the direction lines will be distorted.

We can take an initial condition into account using Maple and determine an exact solution that depends on the initial condition. Solving an ODE that has an initial condition is again done using the dsolve command. Using the initial condition presented in equation (1) we shall now determine an exact solution to the ODE.

>

2)

If we wish to plot a particular solution curve then we use the command DEplot. DEplot will plot the direction eld lines as well as the particular solution line depending on the initial condition.

> >

DEplot(ODE1,y(x),-2..2,[y(0)=2],linecolor=magenta,color=blue, arrows=LINE);

If you do not want the direction eld plotted with the particular solution, you use the option arrows=NONE in the DEplot command. 3

We will start by solving the following second order constant coefcient homogeneous equation. y + 2y + 10y = 0. This equation is homogeneous because all the terms that involve the unknown function y and its derivatives appear on the left hand side of the equation and the right hand side is zero. We will start by entering the above equation into Maple. Recall that the packages DEtools and plots will also be required to solve second order ODEs and so will have to be added at the start as we did in the First Order example.

>

d d eq1 := ( dt2 y(t)) + 2 ( dt y(t)) + 10 y(t) = 0

2

Recall that diff(y(t),t,t) will give you the second derivative of y(t). We will again use the dsolve command to solve the differential equation. The rst argument is the differential equation that we are solving (eq1) and the second is the function to be found (y(t)). Recall from the previous example that when we use the dsolve command it gives us a solution of the form unknown variable = solution. If we only wish to see the solution we can use the rhs command to display the right hand side only. We shall save the solution in the variable sol1.

>

The next step will be to solve a second order ODE that includes initial conditions. Every second order ODE will have two initial conditions. We shall now solve the original second order ODE based on the following initial conditions: y + 2y + 10y = 0, y(0) = 3, y (0) = 5.

Use the dsolve command to solve the ODE based on the initial conditions. Save the solution in the variable sol2. sol2 := rhs(dsolve({eq1,y(0)=3,D(y)(0)=-5},y(t))); 2 sol2 := e(t) sin(3 t) + 3 e(t) cos(3 t) 3 We now have the exact solution of the equation. Plotting the solution might make it easier

>

to understand what is going on. We simply use the plot command to plot sol2. 4

>

plot(sol2,t=-1..6,labels=["t","y"]);

We shall now look at how to solve an inhomogeneous second order ODE with initial conditions. Consider the following problem: y + y + y = t2 cos(2t), y(0) = 0, y (0) = 2.

As before our rst step is to enter the equation into Maple ignoring the initial conditions. We shall label our new ODE as eq2.

>

d d eq2 := ( dt2 y(t)) + ( dt y(t)) + y(t) = t2 cos(2 t)

2

We can again solve this second order ODE using the dsolve command. We shall call our solution sol3.

>

sol3 := rhs(dsolve(eq2,y(t)));

t ( 2 )

sol3 := e +

Maple: Solving Ordinary Differential Equations This solution is more complex than in the previous example due to the inhomogeneous terms on the right hand side of the problem. We now solve the initial value problem taking into account our initial conditions. Again this is done quite easily using the dsolve command. We label the solution of the initial value problem sol4.

>

sol4 := rhs(dsolve({eq2,y(0)=0,D(y)(0)=2},y(t))); 3688 ( t ) 3t 336 ( t ) 3t sol4 := e 2 sin( ) 3 e 2 cos( ) 2197 2 2197 2 1 1 + (338 t2 + 832 t 1212) sin(2 t) + cos(2 t) (336 507 t2 + 1118 t) 2197 2197

Even taking the initial conditions into account this answer is quite complicated and so a plot of the above function might make it easier to see the overall nature of the solution curve.

>

plot(sol4,t=0..18,labels=["t","y"]);

- Chapter 6 - Ordinary Differential EquationUploaded byjun005
- Lab Experiment 02Uploaded bySohail Afridi
- Session+24Uploaded byMehroze Elahi
- MATH219 Lecture 5Uploaded bySerdar Bilge
- Tutorial 3 - WavesUploaded bySiddharth Gangal
- Section 1 Point 2Uploaded bymasyuki1979
- ODE1(1)Uploaded byYonas D. Ebren
- Differential Equations - Introduction.pdfUploaded byRoberto Garcia Jr.
- TG1401CA20910-LinSDUploaded byLinShaodun
- rptInstructionPlan_8Uploaded byAbhinav Garg
- Second OrderUploaded byZohaib Shabir
- differentialUploaded byMoisés MartÍnez Gutiérrez
- POLYMATH TutorialChemical Reaction Engineering.pdfUploaded byAfifah Sabri
- 62-192-2-PBUploaded bysaran
- m 3Uploaded byVik Audacious
- NotesUploaded byJohn Hopkins
- Differential EquationsUploaded byAhmadMoaaz
- Potter - Goldberg_Advanced Engineering MathematicsUploaded byWichi
- Elementary Differential Equatio - Werner E. KohlerUploaded byNamNgo
- FDM-FVMUploaded byAjay Vasanth
- Chapter 2Uploaded byake_soil
- cblemass05Uploaded bySahil Kalra
- POLYMATH TutorialChemical Reaction Engineering(1)Uploaded byAnonymous ox8Tn9
- Anna university syllabus 2013 regulationsUploaded bySubalakshmi Ramraj
- PDC Quiz Group 4Uploaded byeverlette
- penerapanUploaded byJirayuLaongmanee
- MATH2010 Assignment 2 2019Uploaded byzaibtsu
- Methods Pages2011Uploaded byHaseeb Bhutta
- B. Tech (MAE)-2010Uploaded byurvish vashishtha
- PresentationUploaded bysatyajit nayak

- Bloomfield 1926 Set PostulatesUploaded bysdf
- Metacarpal Neck FracturesUploaded byProfesseur Christian Dumontier
- MBA Revised Syllabus.pdfUploaded byNimisha vk
- Service Learning Summary #2Uploaded byRozziJay
- CBLM FormatUploaded byGheenzo Moreno
- Syed Ibrahim ResumeUploaded bySYED IBRAHIM
- DM BPJSUploaded byNimas Ayu Suri Patriya
- A Mineral is a Naturally Occurring Substance That is Solid and Stable at Room TemperatureUploaded byErick Mahilum
- Compassionate Love as Cornerstone of Servant LeadershipUploaded byAnthony Perdue
- Agha Shahid Ali 2012 6Uploaded bySofija Živković
- The Daily Tar Heel for Nov. 3, 2015Uploaded byThe Daily Tar Heel
- Solar Powered SatellitesUploaded byAviation/Space History Library
- Finals Mock 1.pdfUploaded bysuremessy
- Achieving Operation Excellence and Customer Intimacy Enterprise ApplicationsUploaded bySinzihara Mazina Guy Octave
- Lsm Detail ReportUploaded byMamta Jain
- BUS346 Week 5 Homework QuestionsUploaded byHennrocks
- Makerere University Committee Investigating Sexual Harassment FINAL Report June 2018Uploaded byjadwongscribd
- Block 1 BLIS 03 Unit 2Uploaded byravinderreddyn
- personality development customer serviceUploaded byapi-242291589
- Epidemiology,History and Regional Diversities of UrolithiasisUploaded byRachmad Sanjaya
- Indonesia Consumer Buying Trend - Dr.jacky Mussry - 25102017 - Version 2Uploaded byAdityaP.Nugraha
- Parable of the Rainbow ColorsUploaded byCyrel Odtohan
- ZZQ S2 L3 What is QigongUploaded byAnonymous GWQnmWI7
- NO-Memo-No.-19-s.-2019-2019-Calendar-of-Scouting-Events-and-Activities.pdfUploaded byKarl Lyel Lim
- 2. the Basket, Or, The Journal of the Basket FraternityUploaded byabcdsef
- Numbers. Divisibility Tests, HCF and LCMUploaded byAjay Bhat
- lesson plan - primaryUploaded byapi-250567561
- Chess Informant 76Uploaded byCalvin Hunter
- Dheerga Gayathri MantraUploaded byAnonymous AMmNGgP
- Cardiopulmonary Rescucitation &Amp; ECC - Guidelines - Executive Summary - 2010 - ERCUploaded byShahbaz Ahmed

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.