Solução de EDOs no softwre Maple

© All Rights Reserved

14 views

Solução de EDOs no softwre Maple

© All Rights Reserved

- A First Principles Derivation of Functional Derivatives
- Teaching Elementary Calculus With Cas Calculators Fullpaper
- Biotech 2013
- 17
- DifferentiationofExponentialFunctions(Proven)
- hw1 PDE
- Mathematics Used in Managerial Economics
- Bridge Course
- Euler Eqns
- Accuracy Analysis of Numerical solutions of initial value problems (IVP) for ordinary differential equations (ODE)
- Auto Tutorial
- Partial Derivatives
- CHE344_HW5_2019
- ap08_calculus_ab_q6.pdf
- Differentiation Revision
- Assignment 1
- 1ex
- NS Solution
- Test 3 BC
- str02

You are on page 1of 6

The purpose of this worksheet is to introduce Maple's dsolve/numeric command. There are many

examples of differential equations that Maple cannot solve analytically, it these cases a default call to

dsolve returns a null (blank) result:

> ode := diff(y(x),x,x) + y(x)^2 = x^2;

dsolve(ode);

d2

ode :=

y x C y x 2 = x2

(1)

2

dx

If this happens, one can obtain a solution numerically by specifying initial conditions and providing the

option "numeric":

> ICs := y(0) = 0, D(y)(0)= 1/2;

sol := dsolve({ode,ICs},numeric);

1

ICs := y 0 = 0, D y 0 =

2

sol := proc x_rkf45 ... end proc

(2)

The output of dsolve is by default a Maple procedure of a single argument. If we call this procedure with

argument x, we obtain information about the solution at that value of the independent variable:

> sol(1);

d

x = 1., y x = 0.560986197489666,

y x = 0.739332218315567

(3)

dx

That is, we get a list giving us a numeric approximation to the value of the unknown and its first

derivative at our choice of x. If the equation we wanted to solve was higher order (say nth order), we

would have more elements in the list corresponding to all the derivatives of y up to n K 1 th order. The

default behaviour of dsolve/numeric is to return a procedure which itself returns a list; however, we can

instead have it return a list of procedures but using the optional command "output = listprocedure".

> sol := dsolve({ode,ICs},numeric,output=listprocedure);

d

sol := x = proc x ... end proc, y x = proc x ... end proc,

y x = proc x

(4)

dx

...

end proc

Here, we get a list of three equations. The RHS of each equation is a procedure that calculates what is

represented on the LHS. For example, the RHS of the second element is a procedure that calculates

y x . We can isolate this particular procedure as follows:

> y_sol := sol[2];

y_sol := rhs(y_sol);

y_sol := y x = proc x ... end proc

y_sol := proc x ... end proc

(5)

Now, y_sol is a procedure that just returns the numeric solution for y as a function of x:

> y_sol(2);

1.79279104009982

This procedure can readily be used to obtain a plot of the numeric solution of the ODE:

(6)

> plot(y_sol(x),x=-10..10,axes=boxed);

10

0

K10

K5

0

x

10

This is not the only way to obtain a plot of the numeric solution of an ODE, look at ?plots/odeplot

for an alternate method (I recommend the one given here, howeever). The dsolve/numeric command

can also be used to solve systems of ODEs such as the following [this is a predator-prey model from

mathematical biology where X T and Y T represent the populations of humans and fish, respectively]

:

> ODE1 := diff(X(T), T) = -X(T)*(-1+Y(T));

ODE2 := diff(Y(T), T) = Y(T)*(-1+X(T))*alpha;

d

X T = KX T K1 C Y T

dT

d

ODE2 :=

Y T = Y T K1 C X T a

dT

ODE1 :=

Here is the code to generate procedures X_sol and Y_sol giving the numeric solution for the two

unknowns for a particular choice of initial data and .

> alpha := 1;

X0 := 2;

Y0 := 1;

ans := dsolve([ODE1,ODE2,X(0)=X0,Y(0)=Y0],numeric,output=

listprocedure);

(7)

>

X_sol := rhs(ans[2]);

Y_sol := rhs(ans[3]);

ans := T = proc T

...

end proc

a := 1

X0 := 2

Y0 := 1

... end proc, X T = proc T

X_sol := proc T

Y_sol := proc T

... end proc

(8)

> plot([X_sol(T),Y_sol(T)],T=0..10);

1.5

0.5

0

10

A phase portrait of the system is an implicitly defined curve where the horizontal coordinate is X T and

the vertical coordinate is Y T :

> plot([X_sol(T),Y_sol(T),T=0..10]);

1.5

0.5

0.5

1.5

The above numeric solution was for a particular choice of initial data. Lets generate a series of ten

solution curves for a number of choices of initial data (N.B. now we choose a = 10):

> alpha := 10;

for i from 1 to 10 do:

X0 := 1+i/10;

Y0 := 1;

ans := dsolve([ODE1,ODE2,X(0)=X0,Y(0)=Y0],numeric,output=

listprocedure);

X_sol[i] := rhs(ans[2]);

Y_sol[i] := rhs(ans[3]);

print(i);

od:

a := 10

1

2

3

4

5

6

7

(9)

8

9

10

(9)

> plot([seq(X_sol[i](T),i=1..10)],T=0..10);

1.5

0.5

0

> plot([seq([X_sol[i](T),Y_sol[i](T),T=0..10],i=1..10)]);

10

0.5

1.5

- A First Principles Derivation of Functional DerivativesUploaded byNicholas Fisk
- Teaching Elementary Calculus With Cas Calculators FullpaperUploaded bytalent@warrior
- Biotech 2013Uploaded byVigneshwaran Ravishankar
- 17Uploaded byAboo Sidhique
- DifferentiationofExponentialFunctions(Proven)Uploaded byNurIzzati
- hw1 PDEUploaded byMatt Cosentino
- Mathematics Used in Managerial EconomicsUploaded byAjay Abraham Anathanam
- Bridge CourseUploaded byDavidMaighl
- Euler EqnsUploaded byMunir Aslam
- Accuracy Analysis of Numerical solutions of initial value problems (IVP) for ordinary differential equations (ODE)Uploaded byIOSRjournal
- Auto TutorialUploaded byBartOrtiz
- Partial DerivativesUploaded byHelena Francis
- CHE344_HW5_2019Uploaded byLynn
- ap08_calculus_ab_q6.pdfUploaded byWilliam Patterson
- Differentiation RevisionUploaded byMyureshwaran
- Assignment 1Uploaded bySaf Wan
- 1exUploaded byTrung Phan
- NS SolutionUploaded bykgupta27
- Test 3 BCUploaded byJason Tysl
- str02Uploaded byRoney Wu
- Math 151 Homework 04.pdfUploaded byNafiur Rahman
- 200_2012WT1Uploaded byJoshua Kai
- Quadratic Functions MSUploaded byABC123
- 05Uploaded byalbi.
- Hypergeom LecturesUploaded byrgkelly62
- Paper 10Uploaded byRakeshconclave
- Doing Math With Python_dTOCUploaded byDuberly González Molinari
- 06887356Uploaded bydebasishmee5808
- Process and Product Layout TechniquesUploaded byTrisha Tabangin
- Session 7-Technique for Order Performance by Similarity to IdealUploaded byVikram Santhanam

- Chapter 5 Flexural MembersUploaded byAriel Dela Cruz
- Acetic Acid GlacialUploaded byElfrida Margaretha Situmeang
- PUploaded byoscar
- Fleischhauer EIT Review RmpUploaded bywoody636
- 217 - 1988Uploaded byravichandra
- Design by analysisUploaded byburakcell
- Dimensionality ReductionUploaded byManu Mathew
- Practica Temple 2Uploaded bySebastian Camilo Hidalgo
- ME251 CH10 SolutionsUploaded byAngela Black
- Pesticide Photocatalysis Reaction MechanismUploaded bychaerul.anwar554
- Olympus SZ-61TR ManualUploaded byRonnie Ocampo
- Insulation ContraThermUploaded bymarcins85
- QPROPUploaded byYe Win Thant
- Solution Manual 3rd Ed Metal FormingUploaded bymehrce
- Shadbala SlidesUploaded byGuilherme Alves Pereira
- ESE_CE_CON_1_QUEUploaded byAashish Patidaar
- Monin a. S. & Ozmidov R. v. - Turbulence in the Ocean (1985)Uploaded bymarco
- LabServices_DWTest_IndetailUploaded byRobert Britt
- Bickmore_p411-423_01Uploaded bymauricio rojas alvarez
- Materials 2D03 Course Notes- Part I (2011)Uploaded bySyafiq Azhari
- Surface Energy and Surface TensionUploaded byBehera Kishore
- BUSOUTUploaded byDaniel Tuncar
- 00115.00197_ Pt Singlurus Pratama (Preliminary)Uploaded byyulis_fitrianto
- GovernorsUploaded byMuhammad Iqbal Samudera A
- www.myengg.com / JEE Main Physics Model Paper 5Uploaded byPremKumarKalikiri
- Power vs. ForceUploaded bySnezana_Cupurd_9073
- D527e0712 Vario RayUploaded byMichaelBozickovic
- PotentiometerUploaded byAbdallah Nah D
- Lab Example 1Uploaded byAyunie Roslan
- dietsch.pdfUploaded byAnonymous IwqK1Nl