Continuous System Modeling

Download Report

Transcript Continuous System Modeling

Object-oriented Modeling in the Service of Medicine
François E. Cellier, ETH Zürich
Àngela Nebot, Universitat Politècnica de Catalunya
October 25, 2005
ICSC 2005: Beijing
Start Presentation
System Complexity and the
Understandability of Models
• As the systems that are being analyzed by
mathematical models have grown in complexity
over the years, they have become increasingly
difficult to interpret and maintain.
• Modelers need to concern themselves with the
understandability and maintainability of their
models.
• Tools need to be developed that support them in this
endeavor.
October 25, 2005
ICSC 2005: Beijing
Start Presentation
Object-oriented Modeling
• The object-oriented modeling paradigm enables the
modeler to encapsulate knowledge in such a way
that snippets of knowledge can be translated to a
language familiar to the domain expert.
• The complexity of the models is locally contained
by encapsulation and hierarchical composition of
models.
• Models are being made more easily understandable
by exploiting the two-dimensional nature of planar
graphics.
October 25, 2005
ICSC 2005: Beijing
Start Presentation
Graphical Modeling
• Models of subsystems can be encapsulated as
graphical objects, called icons.
• The icons can be topologically interconnected to
form a two-dimensional network.
• Sub-networks of graphical objects can be grouped
together to form new objects, for which icons can be
designed. In this way, systems can be hierarchically
composed from sub-systems forming a tree.
• The leaves of the tree must be described by
equations.
October 25, 2005
ICSC 2005: Beijing
Start Presentation
Bond Graph Modeling
• Bond graphs are one type of graphical objectoriented models.
• They describe the power flow through a physical
system.
• Since energy and power flow are common to all
types of physical systems, bond graphs are domain
independent.
• The equation-based leaf models of bond graphs can
be pre-coded for all domains.
October 25, 2005
ICSC 2005: Beijing
Start Presentation
The Bond Model
• The modeling of physical systems by means of bond graphs
operates on a graphical description of energy flows.
e: Effort
e
P=e·f
f: Flow
f
• The energy flows are represented as directed harpoons. The
two adjugate variables, which are responsible for the energy
flow, are annotated above (intensive: potential variable, “e”)
and below (extensive: flow variable, “f”) the harpoon.
• The hook of the harpoon always points to the left, and the
term “above” refers to the side with the hook.
October 25, 2005
ICSC 2005: Beijing
Start Presentation
Sources in Bond Graph Representation
U0
va
i
+
U0
vb

Se
U0
i
Energy is being
Voltage and current
added to the system
have opposite directions
I0
va
I0
vb

Sf
u
I0
u
October 25, 2005
ICSC 2005: Beijing
Start Presentation
Passive Electrical Elements in
Bond Graph Representation
va
i
R
vb
Voltage and current
have same directions
u
va
i
C
vb
u
va
i
October 25, 2005

i
u
i
R
C
Energy is being taken
out off to the system
L
vb
u

u

u
i
ICSC 2005: Beijing
I
Start Presentation
Junctions
e2
e1
f1
f2
0
e3

e1 = e2
e2 = e3
f1 – f2 – f3 = 0

f1 = f2
f2 = f3
e1 – e2 – e 3 = 0
f3
e2
e1
f1
October 25, 2005
f2
1
e3
f3
ICSC 2005: Beijing
Start Presentation
An Example I
October 25, 2005
ICSC 2005: Beijing
Start Presentation
An Example II
v0 = 0
October 25, 2005

P = v0 · i0 = 0
ICSC 2005: Beijing
Start Presentation
An Example III
October 25, 2005
ICSC 2005: Beijing
Start Presentation
Causal Bond Graphs
• Every bond defines two separate variables, the effort e and
the flow f.
• Consequently, we need two equations to compute values
for these two variables.
• It turns out that it is always possible to compute one of the
two variables at each side of the bond.
• A vertical bar symbolizes the side where the flow is being
computed.
e
f
October 25, 2005
ICSC 2005: Beijing
Start Presentation
“Causalization” of the Sources
The flow has to be
computed on the right side.
Se
U0
i
U0 = f(t)
The source computes the effort.
Sf
u
I0
I0 = f(t)
The source computes the flow.
 The causality of the sources is fixed.
October 25, 2005
ICSC 2005: Beijing
Start Presentation
“Causalization” of the Passive Elements
u
i
u
R
R
i
u=R·i
i=u/R
 The causality of resistors is free.
u
i
u
C
I
i
du/dt = i / C
 The
di/dt = u / I
causality of the storage elements is
determined by the desire to use integrators instead
of differentiators.
October 25, 2005
ICSC 2005: Beijing
Start Presentation
“Causalization” of the Junctions
e2
e1
f1
f2
0
e3
f3

e2 = e1
e3 = e1
f1 = f2 + f3
Junctions of type 0 have only one flow equation, and therefore, they
must have exactly one causality bar.
e2
f2 = f1
f2
e1
f3 = f1

1
e3
f1
e1 = e2 + e 3
f3
Junctions of type 1 have only one effort equation, and therefore,
they must have exactly (n-1) causality bars.
October 25, 2005
ICSC 2005: Beijing
Start Presentation
e
U0.e
U0.f
R1.e
R1.f
L1.e
U0.e
L1.f
“Causalization” of the Bond Graph
U0.e
R1.f
C1.e
R1.f
R2.e
C1.e
R2.f
C1.e
C1.f
October 25, 2005
ICSC 2005: Beijing
U0 .e = f(t)
U0 .f = L1 .f + R1 .f
dL1 .f /dt = U0 .e / L1
dC1 .e /dt = C1 .f / C1
C1 .f = R1 .f – R2 .f
R2 .f = C1 .e / R2
R1 .e = U0 .e – C1 .e
R1 .f = R1 .e / R1
Start Presentation
The Four Base Variables of the
Bond Graph Methodology
• Beside from the two adjugate variables e and f, there are
two additional physical quantities that play an important
role in the bond graph methodology:
Generalized Momentum:
p =
 e · dt
Generalized Position:
q =
 f · dt
October 25, 2005
ICSC 2005: Beijing
Start Presentation
Relations Between the Base Variables
p

e
Resistor:
e = R( f )
Capacity:
q = C( e )
Inductivity:
p = I( f )
q
I C
R

f

Arbitrarily non-linear functions
in 1st and 3rd quadrants
 There cannot exist other storage elements besides
October 25, 2005
ICSC 2005: Beijing
C and I.
Start Presentation
Effort
Generalized
Momentum
Flow
e
f
Generalized Position
p
q
Electrical
Circuits
Voltage
u (V)
Current
i (A)
Magnetic Flux
 (V·sec)
Charge
q (A·sec)
Translational
Systems
Force
F (N)
Velocity
v (m / sec)
Momentum
M (N·sec)
Position
x (m)
Rotational
Systems
Torque
T (N·m)
Angular Velocity
 (rad / sec)
Torsion
T (N·m·sec)
Angle
 (rad)
Hydraulic
Systems
Pressure
p (N / m2)
Volume Flow
q (m3 / sec)
Pressure
Momentum
Γ (N·sec / m2)
Volume
V (m3)
Chemical
Systems
Chem. Potential
 (J / mol)
Molar Flow
 (mol/sec)
-
Number of Moles
n (mol)
Thermodynamic
Systems
Temperature
T (K)
Entropy Flow
S’ (W / K)
-
Entropy
S (J / K )
October 25, 2005
ICSC 2005: Beijing
Start Presentation
Hemodynamics
• The hemodynamics describe the flow of blood
through the heart and the blood vessels, i.e., the
flow of blood through the cardiovascular system.
• The hemodynamics of the human body can be
interpreted as a hydromechanical system. Blood is
similar to water, blood vessels can be inerpreted as
pipes, and the heart chambers act as hydraulic
pumps.
• Some of the chambers and vessels contain valves
that act like check valves, preventing a backflow.
October 25, 2005
ICSC 2005: Beijing
Start Presentation
Transporter Model I
Icon Window
Diagram Window
October 25, 2005
ICSC 2005: Beijing
Start Presentation
Transporter Model II
Equation window
Documentation
window
October 25, 2005
ICSC 2005: Beijing
Start Presentation
Container Model
Icon Window
Diagram Window
October 25, 2005
ICSC 2005: Beijing
Start Presentation
Valve Model (Transporter)
Diagram Window
October 25, 2005
ICSC 2005: Beijing
Start Presentation
Heart Chamber (Container)
Icon Window
Diagram Window
October 25, 2005
ICSC 2005: Beijing
Start Presentation
Left Ventricle (Heart Chamber)
Diagram Window
October 25, 2005
ICSC 2005: Beijing
Start Presentation
The Heart
Icon Window
Diagram Window
October 25, 2005
ICSC 2005: Beijing
Start Presentation
The Thorax
Diagram Window
October 25, 2005
ICSC 2005: Beijing
Start Presentation
The Cardiovascular System
Icon Window
October 25, 2005
ICSC 2005: Beijing
Start Presentation
The Cardiovascular System
Central Nervous System Control
(Qualitative Model)
Heart Rate Controller
Hemodynamical System
(Quantitative Model)
Regenerate
TH
Heart
B2
Myocardiac Contractility
Controller
Regenerate
Peripheric Resistance
Controller
Regenerate
Venous Tone Controller
Regenerate
Coronary Resistance
Controller
Q4
Circulatory
Flow Dynamics
D2
Q6
Regenerate
PAC
Recode
October 25, 2005
Carotid Sinus Blood
Pressure
ICSC 2005: Beijing
Pressure of the
arteries in the
brain.
Start Presentation
Simulation Results (Valsalva Maneuver)
October 25, 2005
ICSC 2005: Beijing
Start Presentation
Summary
• Object-oriented graphical modeling has helped us translate a
hydro-mechanical model of the cardiovascular system into a
representation that medical personnel can interpret and deal
with.
• The knowledge at each layer was suitably encapsulated for
limiting the local complexity to a level that can be represented
on a single screen.
• No manual translation from the high-level representation to
executable simulation code is needed. The graphical model at
each level contains all of the model equations at that level and
underneath it. Hence the model can be compiled in a fully
automated fashion and simulated thereafter.
October 25, 2005
ICSC 2005: Beijing
Start Presentation