the math as the language of the universethis curiosity for revealing the mysteries of the universe...

94
The Math as the language of the Universe http://euler.us.es/~renato/ R. ´ Alvarez-Nodarse Universidad de Sevilla R. ´ Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Upload: others

Post on 10-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The Math as the language of the Universehttp://euler.us.es/~renato/

R. Alvarez-NodarseUniversidad de Sevilla

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 2: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Is Math the language of the Universe?

The History started with Thales, when people started to use theScientific Thought, continued with Galileo and his ScientificMethod and arrived to Newton and his Principia.

But it’s far to being over.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 3: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

What is Modeling?

0 π/2 π 3π/2 2πφ

-1

-0.5

0

0.5

1

v (cm/s)

How to explain and predict Velocity of liquid dropsnatural phenomena? on a moving plate

red circles: experiment

line: theory and simulations

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 4: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

A very old discussion

VS

Fourier: The deep study of natureis the most fruitful source of mat-hematical discoveries. By offering toresearch a definite end, this studyhas the advantage of excluding va-gue questions and useless calcula-tions ... .Theorie analytique de la chaleur, 1822

Jacobi: It is true that Fourier hadthe opinion that the principal aimof mathematics was public utilityand explanation of natural pheno-mena; but a philosopher like himshould have known that the so-le end of science is the honor ofthe human mind, and a questionabout numbers is worth as muchas a question about the system ofthe world.Letter to Legendre, July 2, 1830.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 5: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

A very old discussion

VS

Hardy:I have never done anyt-hing ‘useful’. No discovery ofmine has made [...] the least dif-ference to the amenity of theworld.

Lobachevsky: There is nobranch of mathematics, ho-wever abstract, which maynot some day be applied tophenomena of the real world.

Curiosity: Results by Hardy are used today in Cryptography andGenetics.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 6: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

A very old discussion

VS

Hardy:I have never done anyt-hing ‘useful’. No discovery ofmine has made [...] the least dif-ference to the amenity of theworld.

Lobachevsky: There is nobranch of mathematics, ho-wever abstract, which maynot some day be applied tophenomena of the real world.

Curiosity: Results by Hardy are used today in Cryptography andGenetics.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 7: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The boom of mathematics: Galileo’s Theorem

Galileo (Il Saggiatore, 1623): Philosophy is writ-

ten in that great book which ever lies before our

eyes – I mean the universe – but we cannot un-

derstand it if we do not first learn the language

and grasp the symbols, in which it is written.

[...] without whose help it is impossible to com-

prehend a single word of it; without which one

wanders in vain through a dark labyrinth.

Einstein: The most beautiful experience we can

have is the mysterious. It is the fundamental

emotion which stands at the cradle of true art

and true science. Whoever does not know it and

can no longer wonder, no longer marvel, is as

good as dead, and his eyes are dimmed.

This curiosity for revealing the mysteries of the Universe and forunderstanding his language is the reason that many of us studiedPhysics and Mathematics.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 8: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The boom of mathematics: Galileo’s Theorem

Galileo (Il Saggiatore, 1623): Philosophy is writ-

ten in that great book which ever lies before our

eyes – I mean the universe – but we cannot un-

derstand it if we do not first learn the language

and grasp the symbols, in which it is written.

[...] without whose help it is impossible to com-

prehend a single word of it; without which one

wanders in vain through a dark labyrinth.

Einstein: The most beautiful experience we can

have is the mysterious. It is the fundamental

emotion which stands at the cradle of true art

and true science. Whoever does not know it and

can no longer wonder, no longer marvel, is as

good as dead, and his eyes are dimmed.

This curiosity for revealing the mysteries of the Universe and forunderstanding his language is the reason that many of us studiedPhysics and Mathematics.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 9: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The boom of mathematics: Galileo’s Theorem

Galileo (Il Saggiatore, 1623): Philosophy is writ-

ten in that great book which ever lies before our

eyes – I mean the universe – but we cannot un-

derstand it if we do not first learn the language

and grasp the symbols, in which it is written.

[...] without whose help it is impossible to com-

prehend a single word of it; without which one

wanders in vain through a dark labyrinth.

Einstein: The most beautiful experience we can

have is the mysterious. It is the fundamental

emotion which stands at the cradle of true art

and true science. Whoever does not know it and

can no longer wonder, no longer marvel, is as

good as dead, and his eyes are dimmed.

This curiosity for revealing the mysteries of the Universe and forunderstanding his language is the reason that many of us studiedPhysics and Mathematics.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 10: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The boom of mathematics: Galileo’s Theorem

Galileo (Il Saggiatore, 1623): Philosophy is writ-

ten in that great book which ever lies before our

eyes – I mean the universe – but we cannot un-

derstand it if we do not first learn the language

and grasp the symbols, in which it is written.

[...] without whose help it is impossible to com-

prehend a single word of it; without which one

wanders in vain through a dark labyrinth.

Einstein: The most beautiful experience we can

have is the mysterious. It is the fundamental

emotion which stands at the cradle of true art

and true science. Whoever does not know it and

can no longer wonder, no longer marvel, is as

good as dead, and his eyes are dimmed.

This curiosity for revealing the mysteries of the Universe and forunderstanding his language is the reason that many of us studiedPhysics and Mathematics.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 11: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The mystery

Einstein: How can it be that mathematics,being after all a product of human thoughtwhich is independent of experience, is so ad-mirably appropriate to the objects of reality?(Geometry and Experience, 1921)

.

Wigner: The miracle of the appropriatenessof the language of mathematics for the for-mulation of the laws of physics is a won-derful gift which we neither understand nordeserve. Unreasonable Effectiveness of Mat-hematics in the Natural Sciences, 1961.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 12: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The mystery

Einstein: How can it be that mathematics,being after all a product of human thoughtwhich is independent of experience, is so ad-mirably appropriate to the objects of reality?(Geometry and Experience, 1921)

.

Wigner: The miracle of the appropriatenessof the language of mathematics for the for-mulation of the laws of physics is a won-derful gift which we neither understand nordeserve. Unreasonable Effectiveness of Mat-hematics in the Natural Sciences, 1961.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 13: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The mystery

Einstein: How can it be that mathematics,being after all a product of human thoughtwhich is independent of experience, is so ad-mirably appropriate to the objects of reality?(Geometry and Experience, 1921)

.

Wigner: The miracle of the appropriatenessof the language of mathematics for the for-mulation of the laws of physics is a won-derful gift which we neither understand nordeserve. Unreasonable Effectiveness of Mat-hematics in the Natural Sciences, 1961.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 14: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Main tools of Modeling

In this workshop I will try to show how the modeling works.

For modeling we should have three important ingredients:

1 An interesting (challenging) no trivial problem.

2 The mathematical tools. In our case will be the Calculus.

3 Probably a computer for doing numerical simulations.

I will start from the end.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 15: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Main tools of Modeling

In this workshop I will try to show how the modeling works.

For modeling we should have three important ingredients:

1 An interesting (challenging) no trivial problem.

2 The mathematical tools. In our case will be the Calculus.

3 Probably a computer for doing numerical simulations.

I will start from the end.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 16: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The birth of the Computer Sciences

Untill the begining of the XXcentury to calculate somet-hing we used our hands, apencil and our brain ...

but at the end of the 2ndWorld War ...

the computers appear.

with their consequences

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 17: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The birth of the Computer Sciences

Untill the begining of the XXcentury to calculate somet-hing we used our hands, apencil and our brain ...

but at the end of the 2ndWorld War ...

the computers appear.

with their consequences

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 18: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The birth of the Computer Sciences

Untill the begining of the XXcentury to calculate somet-hing we used our hands, apencil and our brain ...

but at the end of the 2ndWorld War ...

the computers appear.

with their consequences

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 19: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The birth of the Computer Sciences

Untill the begining of the XXcentury to calculate somet-hing we used our hands, apencil and our brain ...

but at the end of the 2ndWorld War ...

the computers appear.

with their consequences

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 20: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The computers appear in the forties of the XX century

ENIAC – 1946

Toshiba z830 – 2012

Price 6 millions $

Price 2000 $

Area 167 m2, weigh 27 000 Kg

Area 0.07 m2, weigh 1.12 Kg

Processing Cycles / seg: 200

Processing Cycle / seg: > 106.

1PC= Input ⇒

Processing ⇒ Storage ⇒

Output

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 21: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The computers appear in the forties of the XX century

ENIAC – 1946 Toshiba z830 – 2012

Price 6 millions $ Price 2000 $Area 167 m2, weigh 27 000 Kg Area 0.07 m2, weigh 1.12 KgProcessing Cycles / seg: 200 Processing Cycle / seg: > 106.

1PC= Input ⇒

Processing ⇒ Storage ⇒

Output

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 22: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The computers appear in the forties of the XX century

ENIAC – 1946 Toshiba z830 – 2012

Price 6 millions $ Price 2000 $Area 167 m2, weigh 27 000 Kg Area 0.07 m2, weigh 1.12 KgProcessing Cycles / seg: 200 Processing Cycle / seg: > 106.

1PC= Input ⇒

Processing ⇒ Storage ⇒

Output

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 23: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The computers appear in the forties of the XX century

The modern computers (hardware + software) were conceived bythe mathematician John von Neumann at the beginning of 194X(military use)

Before von Neuman to change the programs meant the changingof the internal circuits of the machine.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 24: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

In 1953 experimental Math is born

In the summer 1953 Fermi, Pasta, andUlam used computer as an instrumentof mathematical experimentation:The idea was to simulate a specific phy-sical systems (certain couples non-linearoscillators). The programmer was MaryTsingou.

The computer name was MANIAC I (Mathematical Analyzer,Numerical Integrator, and Computer).

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 25: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

What do we use computers?

In addition to the recreational use ...

the computer are a very powerfull tool for solving mathematicaland related real problems in Science and Engineering.

In particular, to check the analytical predictions of themathematical (theoretical) models, by means of numericalexperiments.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 26: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

What do we use computers?

In addition to the recreational use ...

the computer are a very powerfull tool for solving mathematicaland related real problems in Science and Engineering.

In particular, to check the analytical predictions of themathematical (theoretical) models, by means of numericalexperiments.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 27: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Time to start working ...

The last, but not least, question is which software we will use.

I will use a very nice computer program named Maxima.

http://maxima.sourceforge.net

Why?

It is a symbolic and numerical program.

For downloading visit http://wxmaxima.sourceforge.net

Now find the icon in the Desktop and click it to start.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 28: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Time to start working ...

The last, but not least, question is which software we will use.

I will use a very nice computer program named Maxima.

http://maxima.sourceforge.net

Why? It is a symbolic and numerical program.

For downloading visit http://wxmaxima.sourceforge.net

Now find the icon in the Desktop and click it to start.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 29: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Time to start working ...

The last, but not least, question is which software we will use.

I will use a very nice computer program named Maxima.

http://maxima.sourceforge.net

Why? It is a symbolic and numerical program.

For downloading visit http://wxmaxima.sourceforge.net

Now find the icon in the Desktop and click it to start.R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 30: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Minimum Maxima

Maxima is program that works line a scientific calculator. Wehave the standard arithmetic operations: + sum, subtraction − , ∗multiplication, / division, ˆ powers:

(%i1) 2+2; 3-3; 2*3; 5/10; 3^3;

(%o1) 4

(%o2) 0

(%o3) 6

(%o4) 1/2

(%o5) 27

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 31: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The argument of the commands should be between parenthesis,i.e., log(3.0) gives us the value of log 3 (in the natural basis) lavariable x .

(%i6) sin(%pi/4);

(%o6) 1/sqrt(2)

What does mean symbolic program? It means that the programworks not numerically. Let see some examples:

(%i7) log(2);

(%o7) log(2)

(%i8) log(%e);

(%o8) 1

(%i9) float(%e);

(%o9) 2.718281828459045

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 32: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Graphical representation of functions:

(%i10) plot2d([sin(2*x),sin(x^2)],[x,-%pi,%pi]);

(%t10) (Graphics)

(%i11) plot2d([sin(2*x),sin(x^2)],[x,-%pi,%pi],

[y,-1.3,1.5],[legend,"sin(2x)","sin(x^2)"],

[style,[lines,3]]);

(%t11) (Graphics)

Defining functions

(%i12) define(f(x),sin(2*x));

(%o12) f(x):=sin(2*x)

We can define a function that is the output of a certain command.As an example we compute the derivative (whatever it means)

(%i13) define(derf(x),diff(f(x),x));

(%o13) derf(x):=2*cos(2*x)

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 33: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Graphical representation of functions:

(%i10) plot2d([sin(2*x),sin(x^2)],[x,-%pi,%pi]);

(%t10) (Graphics)

(%i11) plot2d([sin(2*x),sin(x^2)],[x,-%pi,%pi],

[y,-1.3,1.5],[legend,"sin(2x)","sin(x^2)"],

[style,[lines,3]]);

(%t11) (Graphics)

Defining functions

(%i12) define(f(x),sin(2*x));

(%o12) f(x):=sin(2*x)

We can define a function that is the output of a certain command.As an example we compute the derivative (whatever it means)

(%i13) define(derf(x),diff(f(x),x));

(%o13) derf(x):=2*cos(2*x)

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 34: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Finding and representing the tangent to a given function

(%i14) define(rtan(x,x0),f(x0)+derf(x0)*(x-x0));

(%o14) rtan(x,x0):=sin(2*x0)+2*(x-x0)*cos(2*x0)

(%i15) rtan(x,0);

(%o15) 2*x

(%i16) wxplot2d([f(x),rtan(x,0.75)],[x,-.5,1.5],

[y,-1,1.5],[style,[lines,3]],

[legend,"f(x)","recta tangente"])$

(%t16) (Graphics)

We can do even films!

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 35: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

In 1202 the Liber Abaci by Leonardo of Pi-sa, known as Fibonacci, wrote a book onarithmetic. This was probably the first bookwhere was used Hindu–Arabic numbers (theone we used today) instead of the Romanand previous numerical systems.In the book Fibonacci posed the followingquestion:

A certain man had one pair of rabbits to-gether in a certain enclosed place, and onewishes to know how many are created fromthe pair in one year when it is the nature ofthem in a single month to bear another pair,and in the second month those born to bearalso

Summarizing: How many rabbits are after nyears?

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 36: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

How the rabbits population grows?

IWe start with one pair of rabbits

IEach pair mature after some time T (a year)IEach mature pair produce only and only one pair of rabbits eachtimeIThe rabbits are immortals.

MODELIZATION: “REAL” PROBLEM + CERTAIN RULES⇒ MATH EQUATION

⇒ PREDICTION

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 37: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

How the rabbits population grows?

IWe start with one pair of rabbitsIEach pair mature after some time T (a year)

IEach mature pair produce only and only one pair of rabbits eachtimeIThe rabbits are immortals.

MODELIZATION: “REAL” PROBLEM + CERTAIN RULES⇒ MATH EQUATION

⇒ PREDICTION

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 38: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

How the rabbits population grows?

IWe start with one pair of rabbitsIEach pair mature after some time T (a year)IEach mature pair produce only and only one pair of rabbits eachtime

IThe rabbits are immortals.

MODELIZATION: “REAL” PROBLEM + CERTAIN RULES⇒ MATH EQUATION

⇒ PREDICTION

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 39: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

How the rabbits population grows?

IWe start with one pair of rabbitsIEach pair mature after some time T (a year)IEach mature pair produce only and only one pair of rabbits eachtime

IThe rabbits are immortals.

MODELIZATION: “REAL” PROBLEM + CERTAIN RULES⇒ MATH EQUATION

⇒ PREDICTION

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 40: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

How the rabbits population grows?

IWe start with one pair of rabbitsIEach pair mature after some time T (a year)IEach mature pair produce only and only one pair of rabbits eachtime

IThe rabbits are immortals.

MODELIZATION: “REAL” PROBLEM + CERTAIN RULES⇒ MATH EQUATION

⇒ PREDICTION

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 41: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

How the rabbits population grows?

IWe start with one pair of rabbitsIEach pair mature after some time T (a year)IEach mature pair produce only and only one pair of rabbits eachtimeIThe rabbits are immortals.

MODELIZATION: “REAL” PROBLEM + CERTAIN RULES⇒ MATH EQUATION

⇒ PREDICTION

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 42: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

How the rabbits population grows?

IWe start with one pair of rabbitsIEach pair mature after some time T (a year)IEach mature pair produce only and only one pair of rabbits eachtimeIThe rabbits are immortals.

MODELIZATION: “REAL” PROBLEM + CERTAIN RULES⇒ MATH EQUATION

⇒ PREDICTION

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 43: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

How the rabbits population grows?

IWe start with one pair of rabbitsIEach pair mature after some time T (a year)IEach mature pair produce only and only one pair of rabbits eachtimeIThe rabbits are immortals.

MODELIZATION: “REAL” PROBLEM + CERTAIN RULES

⇒ MATH EQUATION

⇒ PREDICTION

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 44: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

How the rabbits population grows?

IWe start with one pair of rabbitsIEach pair mature after some time T (a year)IEach mature pair produce only and only one pair of rabbits eachtimeIThe rabbits are immortals.

MODELIZATION: “REAL” PROBLEM + CERTAIN RULES⇒ MATH EQUATION

⇒ PREDICTION

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 45: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

How the rabbits population grows?

IWe start with one pair of rabbitsIEach pair mature after some time T (a year)IEach mature pair produce only and only one pair of rabbits eachtimeIThe rabbits are immortals.

MODELIZATION: “REAL” PROBLEM + CERTAIN RULES⇒ MATH EQUATION ⇒ PREDICTION

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 46: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

Let Nt denotes the number of rabbit’spairs in each year t: VNt+1 = Nt +Nt−1, t = 1, 2, 3, . . . .Starting with N1 = N2 = 1 the aboveformula generates the Fibonacci sequen-ce:

1, 1, 2, 3, 5, 8, 13, 21, . . . ¿ Nt ? V

Nt =1√5

[(1+√5

2

)t−(

1−√5

2

)t]≈[(2,12)t − (−0,12)t

]2,24

If t 1 V Nt ≈1√5

(1 +√

5

2

)t+1

Nt+1

Nt≈ 1 +

√5

2golden ratio

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 47: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

Let Nt denotes the number of rabbit’spairs in each year t: VNt+1 = Nt +Nt−1, t = 1, 2, 3, . . . .Starting with N1 = N2 = 1 the aboveformula generates the Fibonacci sequen-ce:

1, 1,

2, 3, 5, 8, 13, 21, . . . ¿ Nt ? V

Nt =1√5

[(1+√5

2

)t−(

1−√5

2

)t]≈[(2,12)t − (−0,12)t

]2,24

If t 1 V Nt ≈1√5

(1 +√

5

2

)t+1Nt+1

Nt≈ 1 +

√5

2golden ratio

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 48: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

Let Nt denotes the number of rabbit’spairs in each year t: VNt+1 = Nt +Nt−1, t = 1, 2, 3, . . . .Starting with N1 = N2 = 1 the aboveformula generates the Fibonacci sequen-ce:

1, 1, 2,

3, 5, 8, 13, 21, . . . ¿ Nt ? V

Nt =1√5

[(1+√5

2

)t−(

1−√5

2

)t]≈[(2,12)t − (−0,12)t

]2,24

If t 1 V Nt ≈1√5

(1 +√

5

2

)t+1Nt+1

Nt≈ 1 +

√5

2golden ratio

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 49: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

Let Nt denotes the number of rabbit’spairs in each year t: VNt+1 = Nt +Nt−1, t = 1, 2, 3, . . . .Starting with N1 = N2 = 1 the aboveformula generates the Fibonacci sequen-ce:

1, 1, 2, 3,

5, 8, 13, 21, . . . ¿ Nt ? V

Nt =1√5

[(1+√5

2

)t−(

1−√5

2

)t]≈[(2,12)t − (−0,12)t

]2,24

If t 1 V Nt ≈1√5

(1 +√

5

2

)t+1Nt+1

Nt≈ 1 +

√5

2golden ratio

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 50: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

Let Nt denotes the number of rabbit’spairs in each year t: VNt+1 = Nt +Nt−1, t = 1, 2, 3, . . . .Starting with N1 = N2 = 1 the aboveformula generates the Fibonacci sequen-ce:

1, 1, 2, 3, 5,

8, 13, 21, . . . ¿ Nt ? V

Nt =1√5

[(1+√5

2

)t−(

1−√5

2

)t]≈[(2,12)t − (−0,12)t

]2,24

If t 1 V Nt ≈1√5

(1 +√

5

2

)t+1Nt+1

Nt≈ 1 +

√5

2golden ratio

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 51: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

Let Nt denotes the number of rabbit’spairs in each year t: VNt+1 = Nt +Nt−1, t = 1, 2, 3, . . . .Starting with N1 = N2 = 1 the aboveformula generates the Fibonacci sequen-ce:

1, 1, 2, 3, 5, 8,

13, 21, . . . ¿ Nt ? V

Nt =1√5

[(1+√5

2

)t−(

1−√5

2

)t]≈[(2,12)t − (−0,12)t

]2,24

If t 1 V Nt ≈1√5

(1 +√

5

2

)t+1Nt+1

Nt≈ 1 +

√5

2golden ratio

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 52: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

Let Nt denotes the number of rabbit’spairs in each year t: VNt+1 = Nt +Nt−1, t = 1, 2, 3, . . . .Starting with N1 = N2 = 1 the aboveformula generates the Fibonacci sequen-ce:

1, 1, 2, 3, 5, 8, 13,

21, . . . ¿ Nt ? V

Nt =1√5

[(1+√5

2

)t−(

1−√5

2

)t]≈[(2,12)t − (−0,12)t

]2,24

If t 1 V Nt ≈1√5

(1 +√

5

2

)t+1Nt+1

Nt≈ 1 +

√5

2golden ratio

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 53: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

Let Nt denotes the number of rabbit’spairs in each year t: VNt+1 = Nt +Nt−1, t = 1, 2, 3, . . . .Starting with N1 = N2 = 1 the aboveformula generates the Fibonacci sequen-ce:

1, 1, 2, 3, 5, 8, 13, 21, . . . ¿ Nt ? V

Nt =1√5

[(1+√5

2

)t−(

1−√5

2

)t]≈[(2,12)t − (−0,12)t

]2,24

If t 1 V Nt ≈1√5

(1 +√

5

2

)t+1Nt+1

Nt≈ 1 +

√5

2golden ratio

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 54: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

Let Nt denotes the number of rabbit’spairs in each year t: VNt+1 = Nt +Nt−1, t = 1, 2, 3, . . . .Starting with N1 = N2 = 1 the aboveformula generates the Fibonacci sequen-ce:

1, 1, 2, 3, 5, 8, 13, 21, . . . ¿ Nt ? V

Nt =1√5

[(1+√5

2

)t−(

1−√5

2

)t]≈[(2,12)t − (−0,12)t

]2,24

If t 1 V Nt ≈1√5

(1 +√

5

2

)t+1Nt+1

Nt≈ 1 +

√5

2golden ratio

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 55: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Recurrent relations: Fibonacci and his rabbits

Let Nt denotes the number of rabbit’spairs in each year t: VNt+1 = Nt +Nt−1, t = 1, 2, 3, . . . .Starting with N1 = N2 = 1 the aboveformula generates the Fibonacci sequen-ce:

1, 1, 2, 3, 5, 8, 13, 21, . . . ¿ Nt ? V

Nt =1√5

[(1+√5

2

)t−(

1−√5

2

)t]≈[(2,12)t − (−0,12)t

]2,24

If t 1 V Nt ≈1√5

(1 +√

5

2

)t+1Nt+1

Nt≈ 1 +

√5

2golden ratio

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 56: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

How to define a recurrent relation with Maxima?

kill(all)

(%i1) fib[1]:1;fib[2]:1;

fib[n]:=fib[n-1]+fib[n-2];

(%o3) fib[n]:=fib[n−1]+fib[n−2]

Let define two lists n and fib(n)

(%i4) listat:makelist(n,n,1,15);

lista1:makelist(fib[n],n,1,15);

lista:makelist([n,fib[n]],n,1,15);

(%o4) [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]

(%o5) [1,1,2,3,5,8,13,21,34,55,89,144,233,377,610]

We can represent them in a graphic

(%i6) wxplot2d([discrete,listat,lista1] ,[style, points]);

Clearly fib(n) is a increasing and unbounded sequence (¿Why?)

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 57: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

We can solve the RR analytically with Maxima :

(%i7) load("solve_rec")$

(%i8) ec:fib1[n]=fib1[n-1]+fib1[n-2]$

(%i9) solve_rec(ec,fib1[n]);

(%o9) fib1[n]=((sqrt(5)−1)^n*%k[1]*(−1)^n)/2^n+((sqrt(5)+1)^n*%k[2])/2^n

(%i10) define(fiba[n],second(solve_rec(ec,fib1[n],

fib1[1]=1,fib1[2]=1)))$

(%i11) fiba[n];

(%o11) (sqrt(5)+1)^n/(sqrt(5)*2^n)−((sqrt(5)−1)^n*(−1)^n)/(sqrt(5)*2^n)

Comparing the numerical and analytical solutions

(%i12) fiba[3]; radcan(%);

(%o12)(sqrt(5)+1)^3/(8*sqrt(5))+(sqrt(5)−1)^3/(8*sqrt(5))(%o13) 2

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 58: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

(%i14) makelist(radcan(fiba[n]),n,1,15)-lista1;

(%o14) [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

Let us compute the ration N(n + 1)/N(n)

(%i15) define(cociente[n],radcan(fiba[n+1]/fiba[n]));

(%i16) float(cociente[100]);

(%o16) 1.618033988749895

(%i17) float((1+sqrt(5))/2);

(%o17) 1.618033988749895

(%i18) makelist([n,float(cociente[n])],n,1,15)$

(%i19) wxplot2d([discrete,%], [style, points],

[point_type, bullet]);

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 59: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Modeling some natural phenomena

Ordinary Differential Equations (ODE)

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 60: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Linear ODEs

A linear ODE is the Eq.

(1)d y(x)

dx+ a(x)y(x) = b(x), a(x), b(x) ∈ CI .

If b(x) ≡ 0 it is an homogeneous ODE and if b(x) 6= 0,non-homogeneous.

The general solution is given by

y(x) = Ce−∫a(x) dx + e−

∫a(x) dx

∫e∫a(x) dx b(x) dx

How to proof?

An Initial Value Problem (IVP) associated with the ODE (1) is thefollowing:

d y(x)

dx+ a(x)y(x) = b(x), a(x), b(x) ∈ CI , y(x0) = y0.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 61: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Linear ODEs

A linear ODE is the Eq.

(1)d y(x)

dx+ a(x)y(x) = b(x), a(x), b(x) ∈ CI .

If b(x) ≡ 0 it is an homogeneous ODE and if b(x) 6= 0,non-homogeneous. The general solution is given by

y(x) = Ce−∫a(x) dx + e−

∫a(x) dx

∫e∫a(x) dx b(x) dx

How to proof?

An Initial Value Problem (IVP) associated with the ODE (1) is thefollowing:

d y(x)

dx+ a(x)y(x) = b(x), a(x), b(x) ∈ CI , y(x0) = y0.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 62: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Linear ODEs

A linear ODE is the Eq.

(1)d y(x)

dx+ a(x)y(x) = b(x), a(x), b(x) ∈ CI .

If b(x) ≡ 0 it is an homogeneous ODE and if b(x) 6= 0,non-homogeneous. The general solution is given by

y(x) = Ce−∫a(x) dx + e−

∫a(x) dx

∫e∫a(x) dx b(x) dx

How to proof?

An Initial Value Problem (IVP) associated with the ODE (1) is thefollowing:

d y(x)

dx+ a(x)y(x) = b(x), a(x), b(x) ∈ CI , y(x0) = y0.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 63: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Linear ODEs

A linear ODE is the Eq.

(1)d y(x)

dx+ a(x)y(x) = b(x), a(x), b(x) ∈ CI .

If b(x) ≡ 0 it is an homogeneous ODE and if b(x) 6= 0,non-homogeneous. The general solution is given by

y(x) = Ce−∫a(x) dx + e−

∫a(x) dx

∫e∫a(x) dx b(x) dx

How to proof?

An Initial Value Problem (IVP) associated with the ODE (1) is thefollowing:

d y(x)

dx+ a(x)y(x) = b(x), a(x), b(x) ∈ CI , y(x0) = y0.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 64: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

ODEs with Maxima

Maxima have the command ode2 for solving ODEs. The use of itis as follows

ode2(eqn, dependent variable, independent variable)

Example: Solve the ODE z ′ = −z + x :

ode2(’diff(z,x)=x-z,z,x)$

Example: Solve the IVP z ′ = −z + x , y(0) = 1. For this case oneuses the command ic1

ic1(solution, valor of x, valor of y)

where solution is the solution of ode2 and valor x andvalor y, are the values of y when x = x0 (the initial values)

expand(ic1(%,x=1,z=2));

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 65: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Linear ODEs with Maxima

Example: Use Maximato find the solution of the ODE:d y

d x+ x y = 2x .

y(x) = Ce−∫a(x) dx + e−

∫a(x) dx

∫e∫a(x) dx b(x) dx

Then

y = Ce−x2

2 + e−x2

2

∫e

x2

2 2x dx = Ce−x2

2 + 2e−x2

2 ex2

2 = Ce−x2

2 + 2.

To solve the last EDO with the initial condition y(0) = 1.

Since the general solution is y(x) = Ce−x2

2 + 2, then

y(0) = 1 = C + 2, thus C = −1 and y(x) = 2− e−x2

2 .

Exercise: Solve the ODE y ′ = x − y and the IVP when y(1) = 2.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 66: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Linear ODEs with Maxima

Example: Use Maximato find the solution of the ODE:d y

d x+ x y = 2x .

y(x) = Ce−∫a(x) dx + e−

∫a(x) dx

∫e∫a(x) dx b(x) dx

Then

y = Ce−x2

2 + e−x2

2

∫e

x2

2 2x dx = Ce−x2

2 + 2e−x2

2 ex2

2 = Ce−x2

2 + 2.

To solve the last EDO with the initial condition y(0) = 1.

Since the general solution is y(x) = Ce−x2

2 + 2, then

y(0) = 1 = C + 2, thus C = −1 and y(x) = 2− e−x2

2 .

Exercise: Solve the ODE y ′ = x − y and the IVP when y(1) = 2.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 67: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Linear ODEs with Maxima

Example: Use Maximato find the solution of the ODE:d y

d x+ x y = 2x .

y(x) = Ce−∫a(x) dx + e−

∫a(x) dx

∫e∫a(x) dx b(x) dx

Then

y = Ce−x2

2 + e−x2

2

∫e

x2

2 2x dx = Ce−x2

2 + 2e−x2

2 ex2

2 = Ce−x2

2 + 2.

To solve the last EDO with the initial condition y(0) = 1.

Since the general solution is y(x) = Ce−x2

2 + 2, then

y(0) = 1 = C + 2, thus C = −1 and y(x) = 2− e−x2

2 .

Exercise: Solve the ODE y ′ = x − y and the IVP when y(1) = 2.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 68: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Linear ODEs with Maxima

Example: Use Maximato find the solution of the ODE:d y

d x+ x y = 2x .

y(x) = Ce−∫a(x) dx + e−

∫a(x) dx

∫e∫a(x) dx b(x) dx

Then

y = Ce−x2

2 + e−x2

2

∫e

x2

2 2x dx = Ce−x2

2 + 2e−x2

2 ex2

2 = Ce−x2

2 + 2.

To solve the last EDO with the initial condition y(0) = 1.

Since the general solution is y(x) = Ce−x2

2 + 2, then

y(0) = 1 = C + 2, thus C = −1 and y(x) = 2− e−x2

2 .

Exercise: Solve the ODE y ′ = x − y and the IVP when y(1) = 2.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 69: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Separable ODEs with Maxima

Assume that f (x , y) = a(x)b(y). We want to solve the ODE

y ′ = f (x , y)

In general

dy

dx= a(x)b(y) ⇐⇒ dy

b(y)= a(x)dx ⇐⇒

∫dy

b(y)dy =

∫a(x)dx .

Therefore, formally, the solution of the ODE is (it is named sol. inquadrature)

G [y(x)] = A(x) + C ,

where G (y) is the antiderivative (primitive) of 1/b(y) and A(x) ofa(x).

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 70: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Separable ODEs with Maxima

Assume that f (x , y) = a(x)b(y). We want to solve the ODE

y ′ = f (x , y)

In general

dy

dx= a(x)b(y) ⇐⇒ dy

b(y)= a(x)dx ⇐⇒

∫dy

b(y)dy =

∫a(x)dx .

Therefore, formally, the solution of the ODE is (it is named sol. inquadrature)

G [y(x)] = A(x) + C ,

where G (y) is the antiderivative (primitive) of 1/b(y) and A(x) ofa(x).

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 71: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Separable ODEs with Maxima

Assume that f (x , y) = a(x)b(y). We want to solve the ODE

y ′ = f (x , y)

In general

dy

dx= a(x)b(y) ⇐⇒ dy

b(y)= a(x)dx ⇐⇒

∫dy

b(y)dy =

∫a(x)dx .

Therefore, formally, the solution of the ODE is (it is named sol. inquadrature)

G [y(x)] = A(x) + C ,

where G (y) is the antiderivative (primitive) of 1/b(y) and A(x) ofa(x).

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 72: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Separable ODEs with Maxima

Example: Solve y ′ = x/y .

Using the general method:

ydy = xdx ⇐⇒ y2 = x2 + C .

This define a family of curves on the plane R2.

In general the sol. is y(x) = ±√

C + x2, where the choice of + or− depends on the initial conditions. E.g. if y(0) = 3, then C = 9and the solution is y(x) =

√9 + x2.

Exercise: Solve the ODE y ′ = 1 + y2 as well as the IVP wheny(0) = 0.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 73: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Separable ODEs with Maxima

Example: Solve y ′ = x/y .

Using the general method:

ydy = xdx ⇐⇒ y2 = x2 + C .

This define a family of curves on the plane R2.

In general the sol. is y(x) = ±√

C + x2, where the choice of + or− depends on the initial conditions. E.g. if y(0) = 3, then C = 9and the solution is y(x) =

√9 + x2.

Exercise: Solve the ODE y ′ = 1 + y2 as well as the IVP wheny(0) = 0.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 74: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Separable ODEs with Maxima

Example: Solve y ′ = x/y .

Using the general method:

ydy = xdx ⇐⇒ y2 = x2 + C .

This define a family of curves on the plane R2.

In general the sol. is y(x) = ±√

C + x2, where the choice of + or− depends on the initial conditions. E.g. if y(0) = 3, then C = 9and the solution is y(x) =

√9 + x2.

Exercise: Solve the ODE y ′ = 1 + y2 as well as the IVP wheny(0) = 0.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 75: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Separable ODEs with Maxima

Example: Solve y ′ = x/y .

Using the general method:

ydy = xdx ⇐⇒ y2 = x2 + C .

This define a family of curves on the plane R2.

In general the sol. is y(x) = ±√

C + x2, where the choice of + or− depends on the initial conditions. E.g. if y(0) = 3, then C = 9and the solution is y(x) =

√9 + x2.

Exercise: Solve the ODE y ′ = 1 + y2 as well as the IVP wheny(0) = 0.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 76: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

ODEs with Maxima. Numerical solutions of ODEs

Sometimes the command ode2 does not work (check it with theEq. z ′ = x − sen z). What to do?

In this case we should use a numerical method. Maxima has twocommands: runge1 and rk.To use the first one should load the package diffeq

load(diffeq)

It depends of five parameters:

runge1(f, x0, x1, h, y0)

Here f is the function f (x , y) in the ODE y ′ = f (x , y), x0 and x1

are the initial, x0, and final, x1, values of the independent variable,respectively; h the step-size and y0 is the initial value y0 = y(x0).The result is a list with three lists inside: the x , the y , and the y ′.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 77: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

ODEs with Maxima. Numerical solutions of ODEs

Sometimes the command ode2 does not work (check it with theEq. z ′ = x − sen z). What to do?

In this case we should use a numerical method. Maxima has twocommands: runge1 and rk.To use the first one should load the package diffeq

load(diffeq)

It depends of five parameters:

runge1(f, x0, x1, h, y0)

Here f is the function f (x , y) in the ODE y ′ = f (x , y), x0 and x1

are the initial, x0, and final, x1, values of the independent variable,respectively; h the step-size and y0 is the initial value y0 = y(x0).The result is a list with three lists inside: the x , the y , and the y ′.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 78: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

ODEs with Maxima. Example of numerical computation

Solve the IVP y ′ = 1 + y , y(0) = 1.

First we load the package

kill(all); load(diffeq);

Next we define f , and the step-size h and use the commandrunge1

f(x,y):=1+y; h:1/20;

solnum:runge1(f,0,1,h,1);

wxplot2d([discrete,solnum[1],solnum[2]])$

This ODE is linear so we can also use the commands ode2 , ice1

sol: expand(ode2(’diff(w,x)=1+w,w,x));

expand(ic1(sol,x=0,w=1));

define(solw(x),second(%));

Finally, we compare both graphics:

plot2d([[discrete,solnum[1],solnum[2]], solw(x)],[x,0,1])$

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 79: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

EDOs con Maxima

To use the other command rk we need the package dynamics.To solve the IVP y ′ = f (x , y), y(x0) = y0 we use

rk(f,y,y0,[x,x0,x1,h])

where f f is the function f (x , y), x0 and x1 initial, x0, and final,x1, values of the variable x , respectively, h is the step-size, and y0

the initial value y(x0) = y0.

The result is a list with the pairs [x , y ].

Example: Solve z ′ = x − sen z (try first with ode2)

load(dynamics)$

h:1/20;kill(x,y);

numsolrk:rk(x-sin(y),y,1,[x,0,1,h]);

wxplot2d([discrete,numsolrk],[color,blue])$

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 80: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Applications

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 81: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Applications linear ODEs

An electrical circuit. Compute the intensity i of the current

Ldi

dt+ Ri = U,

where L is the inductor, R resistance, and U the voltage.Calculate the intensity i assuming that U is a constant.

R

U L

Show in a graphic the dependence if L = 1H (henry), R = 1Ω(ohm), U = 3V (volt)

Doing the same if U = U0 sen(ωt). Show in a graphic thedependence if L = 1H (henry), R = 1Ω (ohm), U0 = 3V (volt),ω = 50Hz (hertz)

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 82: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Applications linear ODEs

An electrical circuit. Compute the intensity i of the current

Ldi

dt+ Ri = U,

where L is the inductor, R resistance, and U the voltage.Calculate the intensity i assuming that U is a constant.

R

U L

Show in a graphic the dependence if L = 1H (henry), R = 1Ω(ohm), U = 3V (volt)

Doing the same if U = U0 sen(ωt). Show in a graphic thedependence if L = 1H (henry), R = 1Ω (ohm), U0 = 3V (volt),ω = 50Hz (hertz)

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 83: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Applications linear ODEs

Example

The barometric Pascal equation is defined by

p′(h) = −λp(h), λ > 0,

where p is the pressure and h the height. Assume that for h = 0the pressure is 1 atm, obtain the function p(h).

Solution: p(h) = p0e−h/h0

The value of h0 is h0 = 8000m.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 84: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Applications linear ODEs

Pico San Cristobal Torre CerredoGrazalema (Cadiz) Picos de Europa (Cantabria)

1654m, 0.81atm 2648m, 0.71atm

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 85: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Applications linear ODEs

Mulhacen EverestSierra Nevada (Granada) Himalaya (Nepal / China)

3478m, 0.64atm 8848m, 0.32atm

Exercise: Calculate the pressure in: the Mount Elbrus 5642m andBelukha Mountain 4506m.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 86: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Applications linear ODEs

Mulhacen EverestSierra Nevada (Granada) Himalaya (Nepal / China)

3478m, 0.64atm 8848m, 0.32atm

Exercise: Calculate the pressure in: the Mount Elbrus 5642m andBelukha Mountain 4506m.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 87: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Applications of separable ODEs

Example

Let be the chemical reaction A + B → C

In t = 0 the concentration of A is a and of B is b. The velocity ofgetting C is proportional to the concentrations of A and B. Thuswe have the ODE:

x ′ = κ(a− x)(b − x), x(0) = 0.

Assuming a 6= b, find the dependence of x with time.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 88: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Applications of separable ODEs

dx

(a− x)(b − x)= κdt V log

a− x

b − x= (a− b)κt + C ,

but x(0) = 0, C = a/b, thus x(t) = ab1− e(a−b)κt

b − a e(a−b)κt.

If b > a then lımt→∞

x(t) = a but if b < a, lımt→∞

x(t) = b.

This is obvious since the reaction will end as soon as one of the Aor B finished.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 89: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

The scape velocity vE from Earth

Example

To find the scape velocity vE fromEarth of a body situated in the Earthsurface. Using the Newton’s laws onegets the ODE

dv

dt= −GMT

r2= −gR2

r2

Since r is a function of time the above EDO is quite complicate tosolve. But we can use the chain ruledv/dt = (dr/dt)(dv/dr) = v dv/dr , that leads to the EDO

vdv

dr= −gR2

r2

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 90: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Aplicaciones EDOs de 1o orden

Solve with Maxima and show that v2 = 2gR2/R + C . If v0 is theinitial velocity in the surface, then

v2(r) =2gR

r+ v2

0 − 2gR.

To be sure that our ship scape from Earth we should have ∀r > R,v2 ≥ 0.In fact it is sufficient that v ≥ 0 for r →∞, i.e.,

lımr→∞

v(r) ≥ 0 V v20 − 2gR ≥ 0

Using the real data R = 6400000m and g = 9,8m/s2 we getv0 = 11200m/s = 11,2Km/s.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 91: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Aplicaciones EDOs de 1o orden

Solve with Maxima and show that v2 = 2gR2/R + C . If v0 is theinitial velocity in the surface, then

v2(r) =2gR

r+ v2

0 − 2gR.

To be sure that our ship scape from Earth we should have ∀r > R,v2 ≥ 0.In fact it is sufficient that v ≥ 0 for r →∞, i.e.,

lımr→∞

v(r) ≥ 0 V v20 − 2gR ≥ 0

Using the real data R = 6400000m and g = 9,8m/s2 we getv0 = 11200m/s = 11,2Km/s.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 92: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Aplicaciones EDOs de 1o orden

Solve with Maxima and show that v2 = 2gR2/R + C . If v0 is theinitial velocity in the surface, then

v2(r) =2gR

r+ v2

0 − 2gR.

To be sure that our ship scape from Earth we should have ∀r > R,v2 ≥ 0.In fact it is sufficient that v ≥ 0 for r →∞, i.e.,

lımr→∞

v(r) ≥ 0 V v20 − 2gR ≥ 0

Using the real data R = 6400000m and g = 9,8m/s2 we getv0 = 11200m/s = 11,2Km/s.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 93: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Motion of falling motion with friction

Example

The velocity v(t) of a falling objectcab be described by the EDO

v ′ = g − κv r , v(0) = v0,

where g and κ are the gravity ac-celeration and the viscosity coeffi-cient, respectively.

Solve the equation (formally)

dv

g − κv r= dt V t−t0 =

∫ v

v0

dv

g − κv r=

1

g

∫ v

v0

dv

1− ω2v r, ω2 =

κ

g.

Chose r = 2 and do it with Maxima.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe

Page 94: The Math as the language of the UniverseThis curiosity for revealing the mysteries of the Universe and for understanding his language is the reason that many of us studied Physics

Aplicaciones EDOs de 1o orden

∫ v

v0

dv

1− ω2v r=

1

2ωlog

(1 + ωv)

(1− ωv)

(1− ωv0)

(1 + ωv0)= g(t − t0).

Thus

v(t) =1

ω

(1+ωv01−ωv0

)e2gω(t−t0) − 1(

1+ωv01−ωv0

)e2gω(t−t0) + 1

, ω =

√κ

g> 0.

Since ω > 0, then taking t →∞ (t 1) we see thatv(t)→ vmax = 1/ω independently of the value v0.

Exercise

Solve the cases r = 5/2, 3, 7/2 and 4. Show the correspondinggraphics.

R. Alvarez-Nodarse Universidad de Sevilla The Math as the language of the Universe