MATHEMATICA - Учебно

Download Report

Transcript MATHEMATICA - Учебно

By
Ahmed Faramawy
Hadeer ElHabashy
Mostafa Abo Elsoud
(T.A in ASU, Cairo, Egypt )
(T.A in AUC, Cairo, Egypt )
(National Research Center)
Under the supervision of:
Marina lyashko & SvetLana Aksenova
Laboratory of Radiation Biology,
Joint Institute for Nuclear Research
1
MATHEMATICA
What it can do for you ?
Ahmed Faramawy
(T.A in ASU, Cairo, Egypt )
2
Background
• Created by Stephen
Wolfram and his team
Wolfram Research.
• Version 1.0 was
released in 1988.
• Latest version is
Mathematica 8.0 –
released last year.
Stephen Wolfram: creator of
Mathematica
3
Q: What is Mathematica?
A: An interactive program with a vast range of uses:
-
Numerical calculations to required precision
Symbolic calculations/ simplification of algebraic expressions
Matrices and linear algebra
Graphics and data visualisation
Calculus
Equation solving (numeric and symbolic)
Optimization
Statistics
Polynomial algebra
Discrete mathematics
Number theory
Logic and Boolean algebra
Computational systems e.g. cellular automata
4
Structure
Composed of two parts:
• Kernel:
-interprets code, returns results, stores definitions
(be careful)
• Front end:
- provides an interface for inputting Mathematica
code and viewing output (including graphics and
sound) called a notebook
- contains a library of over one thousand functions
- has tools such as a debugger and automatic syntax
colouring
5
More on notebooks
• Notebooks are made up of cells.
• There are different cell types e.g. “Title”,
“Input”, “Output” with associated properties
• To evaluate a cell, highlight it and then
press shift-enter
• To stop evaluation of code, in the tool bar
click on Kernel, then Quit Kernel
6
Language rules
• ; is used at the end of the line from which no
output is required
• Built-in functions begin with a capital letter
• [ ] are used to enclose function arguments
• { } are used to enclose list elements
• ( ) are used to indicate grouping of terms
• expr/ .x
y means “replace x by y in expr”
• expr/ .rules means “apply rules to transform each
subpart of expr” (also see Replace)
• = assigns a value to a variable
• == expresses equality
• := defines a function
• x_ denotes an arbitrary expression named x
7
Language rules (2)
• Any part of the code can be commented out by
enclosing it in (* *).
• Variable names can be almost anything, BUT
- must not begin with a number or contain
whitespace, as this means multiply (see later)
- must not be protected e.g. the name of an
internal function
• BE CAREFUL - variable definitions remain until
you reassign them or Clear them or quit the
kernel (or end the session).
8
Mathematica as a calculator
• Contains mathematical and physical constants
e.g. i (Imag), e (Exp) and p (Pi)
• Addition
+
Subtraction
Multiplication
* or blank space
Division
/
Exponentiation
^
• Can do symbolic calculations and simplification of
complicated algebraic expressions – see Simplify and
FullSimplify.
9
Calculus
• See D to Differentiate.
• Can do both definite and indefinite
integrals – see Integrate
• For a numeric approximation to an integral
use NIntegrate.
10
Equation solving
• Use Solve to solve an equation with an
exact solution, including a symbolic
solution.
• Use NSolve or FindRoot to obtain a
numerical approximation to the solution.
• Use DSolve or NDSolve for differential
equations.
• To use solutions need to use expr / .x
y.
11
Creating your own functions
Plot3D equation “as example”
Plot3D Evaluate X10 NA x1 a1 t,Dz .sol1 , t,0,150 , Dz,0.5,100 , PlotLabel Style "LexA", 16 ,ColorFunction "Aquamarine",
AxesLabel Style "мин.",14,Black ,Style "Дж м2",14,Black ,Style "N",14,Black ,LabelStyle Directive Black
Ticks 20,40,80,100 , 0,20,40,60,80,100 , 400,800,1300
12
NDSolve equation “as example”
sol1 NDSolve D x1 t, Dz , t
D x2 t, Dz , t
1 k5^h1 1 k5 x1 t, Dz ^h1 x1 t, Dz 1 k6 x3 t, Dz ,
1 k7^h2 1 k7 x1 t, Dz ^h2 x2 t, Dz 1 k8 OD t, Dz k1 x3 t, Dz ,
D x3 t, Dz , t k8 OD t, Dz x2 t, Dz k1 x3 t, Dz 1 x4 t, Dz k9 x3 t, Dz k1 x1 t, Dz x3 t, Dz ,
D x4 t, Dz , t k10 1 k11^h4 1 k11 x1 t, Dz ^h4 x4 t, Dz k12 x3 t, Dz x4 t, Dz k14 k13 x4 t, Dz ^2,
D x5 t, Dz , t k15 1 k16^h5 1 k16 x1 t, Dz ^h5 k17 x7 t, Dz x5 t, Dz k18 x8 t, Dz x5 t, Dz k19 x9 t, Dz x5 t, Dz k20 x5 t, Dz ,
D x7 t, Dz , t k24 x4 t, Dz ^2 k25 x7 t, Dz 0 k34 x5 t, Dz x7 t, Dz ,
D x6 t, Dz , t k12 x4 t, Dz x3 t, Dz k22 x6 t, Dz ^2 k21 x8 t, Dz x4 t, Dz k23 x6 t, Dz ,
D x8 t, Dz , t k22 x6 t, Dz ^2 k21 x8 t, Dz x4 t, Dz k26 x8 t, Dz 0 k35 x5 t, Dz x8 t, Dz ,
D x9 t, Dz , t k27 x4 t, Dz x6 t, Dz k21 x8 t, Dz x4 t, Dz k28 x9 t, Dz 0 k36 x5 t, Dz x9 t, Dz , D x10 t, Dz , t k29 x7 t, Dz x5 t, Dz k30 x10 t, Dz ,
D x11 t, Dz , t k18 x8 t, Dz x5 t, Dz k31 x11 t, Dz x4 t, Dz k32 x11 t, Dz , D x12 t, Dz , t k19 x9 t, Dz x5 t, Dz k31 x11 t, Dz x4 t, Dz k33 x12 t, Dz ,
D x13 t, Dz , t k37 1 k39^h6 1 k39 x1 t, Dz ^h6 x13 t, Dz k38 x3 t, Dz x13 t, Dz k37, x1 0, Dz 1, x2 0, Dz 1, x3 0, Dz 0,
x4 0, Dz 1, x5 0, Dz 1, x7 0, Dz 1, x6 0, Dz 0, x8 0, Dz 0, x9 0, Dz 0, x10 0, Dz 1, x11 0, Dz 0, x12 0, Dz 0, x13 0, Dz 1 ,
x1, x2, x3, x4, x5, x7, x6, x8, x9, x10, x11, x12, x13 , t, 0, 20 , Dz, 0.5, 100 , MaxStepSize 0.8
13
Graphics
• Mathematica allows the representation of data in
many different formats:
- 1D list plots, parametric plots
- 3D scatter plots
- 3D data reconstruction
- Contour plots
- Matrix plots
- Pie charts, bar charts, histograms, statistical plots, vector
fields (need to use special packages)
• Numerous options are available to change the
appearance of the graph.
• Use Show to display combined graphics objects
14
Taking it further
• Mathematica has an excellent help menu
(shift-F1)
• Can get help within a notebook by typing?
Function Name(e.g : NDSolve )
• Website:
http://www.wolfram.com/products/mathematic
a/index.html
• To use Mathematica for parallel
programming, look up Grid Mathematica.
15
The Basic Of Mathematical
Modeling
The development of mathematical models
of the genetic regulation and repair
process in bacterial cells is caused by the
necessity to study the structure and
functioning of the genetic apparatus
and biochemical mechanisms controlling
the mutation process.
16
Steps For Building Up The Model
Reaction’s
code
Experimental
data
Sequence of
Reactions
Output
Run
Results
17
• All reactions were simulated using
Mathematica software, using two approaches:
1. Stochastic approach
2. Deterministic approach
• Outputs we obtained, characterized DNA
repair steps as well as enzyme’s
concentration changes.
18
19
Lex A protein
Result
s
lex A
N 10
1400
4
1200
1000
800
600
Blue
1 J /m2
Pink
5 J /m2
yellow
20 J /m2
Green
100 J /m2
400
200
0
50
100
2D plotting for Lex A
150
200
time min
3D plotting for Lex A
20
Rec A protein
Rec A* protein
3D plotting for Rec A & Rec A*
21
UmuD’2C protein (pol V)
UmuD2'c
N
500
min
400
300
200
Blue
1 J /m2
Pink
5 J /m2
yellow
20 J /m2
Green
100 J /m2
3D plotting for UmuD’2C
100
0
50
100
150
2D plotting for UmuD’2C
200
time min
22
DinI protein
DinI
N
800
600
3D plotting for DinI
400
200
0
50
Blue
1 J /m2
Pink
5 J /m2
yellow
20 J /m2
Green
100 J /m2
100
150
2D plotting for DinI
200
time min
23
Conclus
ion
Using mathematical
approaches
1. The model adequately describes the basic processes
of the SOS response,
2. we consider how this model could be applied for the
estimation of the mutagenic effect of UV
irradiation and radiation,
3. A model of describing the dynamics of DinIprotein is developed,
24
4. The role of the DinI-proteins in the basic life
processes of cells during the formation of mutations
is studied,
5. Graphs were obtained, characterizing the
concentration dynamic of DinI-proteins over time
and depending on the dose of UV irradiation
25
Acknowledgments
o Dr. Oleg Belov, LRB, JINR
o Marina lyashko , LRB, JINR
o SvetLana Aksenova , LRB, JINR
Thank You For Your Attention
“спасибо”
Дубна
27