Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of...

33
October 25, 2005 Start Presentation ICSC 2005: Beijing Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot, Universitat Politècnica de Catalunya
  • date post

    18-Dec-2015
  • Category

    Documents

  • view

    218
  • download

    0

Transcript of Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of...

Page 1: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

Object-oriented Modeling in the Service of MedicineFrançois E. Cellier, ETH Zürich

Àngela Nebot, Universitat Politècnica de Catalunya

Page 2: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

System Complexity and theUnderstandability 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.

Page 3: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

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.

Page 4: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

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.

Page 5: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

Bond Graph Modeling• Bond graphs are one type of graphical object-

oriented 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.

Page 6: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

The Bond Model

• The modeling of physical systems by means of bond graphs operates on a graphical description of energy flows.

• 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.

ef

P = e · fe: Effortf: Flow

Page 7: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

Sources in Bond Graph Representation

U 0

iva vb

U0

+U0

iSe

I 0I

va vb

u

0 Sf uI0

Voltage and current have opposite directions

Energy is being added to the system

Page 8: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

Passive Electrical Elements in Bond Graph RepresentationRi

va vb

u

Civa vb

u

Liva vb

u

ui

R

ui

C

ui

I

Voltage and current have same directions

Energy is being taken out off to the system

Page 9: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

Junctions

0e1

e2

e3f1

f2

f3

1e1

e2

e3f1

f2

f3

e1 = e2

e2 = e3

f1 – f2 – f3 = 0

f1 = f2

f2 = f3

e1 – e2 – e3 = 0

Page 10: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

An Example I

Page 11: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

An Example II

v0 = 0 P = v0 · i0 = 0

Page 12: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

An Example III

Page 13: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

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.

ef

Page 14: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

“Causalization” of the Sources

U0 = f(t)

I0 = f(t)

U0

iSe

Sf uI0

The source computes the effort.

The flow has to be computed on the right side.

The source computes the flow.

The causality of the sources is fixed.

Page 15: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

“Causalization” of the Passive Elements

ui

R

u = R · i

ui

R

i = u / R

ui

Cdu/dt = i / C

ui

Idi/dt = u / I

The causality of resistors is free.

The causality of the storage elements is determined by the desire to use integrators instead of differentiators.

Page 16: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

“Causalization” of the Junctions

0e1

e2

e3f1

f2

f3

e2 = e1

e3 = e1

f1 = f2 + f3

1e1

e2

e3f1

f2

f3

f2 = f1

f3 = f1

e1 = e2+ e3

Junctions of type 0 have only one flow equation, and therefore, they must have exactly one causality bar.

Junctions of type 1 have only one effort equation, and therefore, they must have exactly (n-1) causality bars.

Page 17: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

“Causalization” of the Bond Graph

U0.eU0.f

L1.

f

L1.

e

R1.

e

R1.

f

R2.fR2.e

C1.f

C1.e

C1.e C1.eU0.e

U0.

e

R1.f R1.f

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 .fR2 .f = C1 .e / R2

R1 .e = U0 .e – C1 .eR1 .f = R1 .e / R1

e

Page 18: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

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:

p = e · dt

Generalized Momentum:

Generalized Position: q = f · dt

Page 19: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

Relations Between the Base Variables

e f

qp

R

CI

Resistor:

Capacity:

Inductivity:

e = R( f )

q = C( e )

p = I( f )

Arbitrarily non-linear functions in 1st and 3rd quadrants

There cannot exist other storage elements besides C and I.

Page 20: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

Effort Flow Generalized Momentum

Generalized Position

e f 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

TemperatureT (K)

Entropy FlowS’ (W / K)

- EntropyS (J / K )

Page 21: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

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.

Page 22: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

Transporter Model I

Diagram Window

Icon Window

Page 23: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

Transporter Model II

Equation window

Documentation window

Page 24: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

Container Model

Diagram Window

Icon Window

Page 25: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

Valve Model (Transporter)

Diagram Window

Page 26: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

Heart Chamber (Container)

Diagram Window

Icon Window

Page 27: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

Left Ventricle (Heart Chamber)

Diagram Window

Page 28: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

The Heart

Diagram Window

Icon Window

Page 29: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

The Thorax

Diagram Window

Page 30: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

The Cardiovascular System

Icon Window

Page 31: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

The Cardiovascular System

Heart Rate Controller

Myocardiac Contractility Controller

Peripheric Resistance Controller

Venous Tone Controller

Coronary Resistance Controller

Central Nervous System Control (Qualitative Model)

Regenerate

Regenerate

Regenerate

Regenerate

Regenerate

Heart

Circulatory Flow Dynamics

Carotid Sinus Blood Pressure

Recode

Hemodynamical System (Quantitative Model)

TH

B2

Q4

D2

Q6

PAC Pressure of the arteries in the brain.

Page 32: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

Simulation Results (Valsalva Maneuver)

Page 33: Start Presentation ICSC 2005: Beijing October 25, 2005 Object-oriented Modeling in the Service of Medicine François E. Cellier, ETH Zürich Àngela Nebot,

October 25, 2005 Start PresentationICSC 2005: Beijing

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.