exercises: c = 0 on the whole boundary no flux at all boundaries in these cases, make surface color...

71
Exercises: C = 0 on the whole boundary no flux at all boundaries In these cases, make surface color plots of the concentration in the cell at different moments of time, learn how to make line plots, determine how fast the concentration spreads, and in general think about the meaning of the results.

Upload: bertha-ellis

Post on 29-Dec-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

Exercises:

C = 0 on the whole boundary no flux at all boundaries

In these cases, make surface color plots of the concentration in the cell at different moments of time, learn how to make line plots, determine how fast the concentration spreads, and in general think about the meaning of the results.

Exercise 1:

Create a Biomodel like this

An elliptical cell with concentration confied somewhere inside it.

Create this Geometry (2D analytic). Think how to create geometry.

Or if you can not Use shared Geometry from my account

FileOpenGeometryShared Geometries Satarupaellipse_diffclick

See what I did to create this geometry. Save this geometry. It will be saved in your Geometry document.

• Application (deterministic)

• Structure Mapping

• Initial Conditions (concentration confied inside the ellipse and C=0 at the whole boundary)

• Save the Model

• Simulation

Now you know all the steps:

Structure Mapping:

Value boundary condition for the ellipse

Initail Condition: concentration is confined some where inside the ellipse

Results:

For t=3.4 secFor t=0 sec

For t=10.0 sec For t=22.3 sec

For t=10.0 sec

Spatial plot:

For t=2.5 sec For t=28.1 sec

Time plot:

Play with your Model:

1. Change the Difussion Constant. See how fast equllibrim occurs.

2. Make the source concentration a point, see what happens.

3. Now you change the geometry, Create a new one (big or small), see the results

Exercise 2:

Diffusion in this geometric structure with concentration in one of the circles

Consider this structure as a cell in ECM

Your Biomodel will look like this

Create this Geometry (2D analytic). Think how to create geometry.

Or if you can not Use shared Geometry from my account

FileOpenGeometryShared Geometries Satarupa2circle_rectangleclick

See what I did to create this geometry. Save this geometry. It will be saved in your Geometry document.

1. Application (deterministic)

1. Structure Mapping

2. Initial Conditions

3. Save the Model

4. Simulation

Now you know all the steps:

Structure Mapping:

concentration is confined some where inside one of the circles andNo Flux BC

Initial condition

Results:

For t=0 secFor t=4.9 sec

For t=60 sec For t=194.6 sec

For Diffusion Constant =1

Diffusion constant = 10

For t= 52.9sec

For t= 77.4sec

Line plot: Diffusion Constant =10

For t= 80.6secFor t= 41.9sec

For t= 12.4secFor t= 1.6sec

Play with your Model:

1. Change the Difussion Constant. See how fast equllibrim occurs.

2. Make the source concentration a point, see what happens.

3. Now you change the geometry, Create a new one (big or small), see the results

Diffusion - ReactionNow we will study

There will be a diffusion of concentration from left wall of the box to the right walland inside this box concentration is decaying with a rate r (say).

Crx

CD

t

C*

2

2

That is,

Now we will see results of diffusion-reaction in Vcell

FileopenBioModel model name (find out the model with diff in box which you did during last lab )

Select the compartment and right click to get this document then click Reactions..

Now we will use any of our old models of diff in Box from last lab

Hint:

We will modify this model --

Now save this model with a new name to study diffusion-Reaction.

In the reaction window use Reaction tool and line tool to set reaction. It will look like this

Note: there is no other reactant . C is decaying itself. So we set the reaction like this.

Click In the reaction window to get Reaction kinetic editor.1.Set the reaction General2. Put the value of the constant r =0.5

Close the reaction kinetic editor window. Save the model with a name.

Set Boundary condition

Go to initial condition

Save the Model See the Math Model Run Simulation.

Reaction and

Diffusion

R=0.5, D= 10, t=0.9 R=0.5, D= 10, t=8.9

R=1, D= 10, t=2 R=1, D= 10, t=10

Diffusion-Reaction in an elliptical cell with concentration confied somewhere inside it.

We can use our previous model and change it a bit to see the result of Diffusion-Reaction.

Open your saved Ellipse_diffusion model. Now go to File Save as.. with a new name (diff_reac_ellipse, say)

So, this way we can save time and monotonous jobs !!!

Now we set the Reaction same as before:

Save the Model.

Initial Condition: concentration is confined some where inside the ellipse like before

Save the Model and See the Math Description

Set no flux Boundary condition in structure mapping section.

See how Diffusion and Reaction are described in Math Model

Reaction-DiffusionInside the ellipse

Note c is a Function

Results:

r=0.3, D= 10, t=0.1 r=0.3, D= 10, t=1

r=1, D= 1, t=1.1

Exercise 1 (double source):

2

2

c cD rc S x

t x

No flux on the whole boundary

Save previous ellipse model with a new name !!!!

Only difference is declaring Initial Condition, where you have to set two sources of concentration.

Initial Condition for two sources

For r=1, D=1

Now we will write our Math Model for solving PDEs

Lotka-Volterra Model with diffusion in 2D space with no Flux BC

2

2

...r

RDWRbRa

t

RR

2

2

...r

WDWcWRd

t

WW

DR and DW are diffusion constants for Rabbit and Wolf

growth predation

Deathgrowth

Start filenewMathModel Spatial

Then you have to choose a geometry. For L-V model just consider a box.Imagine this Box as the Jungle. No Flux BC means animals must stay inside it.

This Window will pop up

Here we will write pde.

Open your old Lotka –Volterra model (ODE) and copy paste all constants .

Add diffusion rates as constant, like

Constant W_N_diffusionRate 0.2;Constant R_N_diffusionRate 0.2;

Then copy-Paste VolumeVariables and Functions

CompartmentSubDomain subVolume1 {

}

In this section we will write PDEs for Rabbit and wolf.

CompartmentSubDomain subVolume1 {BoundaryXm FluxBoundaryXp FluxBoundaryYm FluxBoundaryYp FluxPdeEquation R_N {

BoundaryXm 0.0;BoundaryXp 0.0;BoundaryYm 0.0;BoundaryYp 0.0;Rate J_predation;Diffusion R_N_diffusionRate;Initial R_N_init;

}

Change Flux from value

No flux BC

Similarly write down the equations for Wolf

Predation rate

Diffusion rate

PdeEquation W_N {BoundaryXm 0.0;BoundaryXp 0.0;BoundaryYm 0.0;BoundaryYp 0.0;Rate J_wolfgrowth;Diffusion W_N_diffusionRate;Initial W_N_init;

}}

}

Wolf equation---

Click Apply Changes Simulation Run Save the Model

Click Equation view to see the equations.

Lotka-Volterra spatial MathModel --

Run the simulation for t=10 sec, time step=0.01, See the results..

Here we have thought that rabbits and wolves are mixed up in jungle ....

Increase the time and see how number of Rabbits and wolves chages.

Rabbit at t=4.25wolf at t=4.25

You can play with with it, changinging different parameters

Time Plot

Rabbit : a=10, c=5 DR=0.2Wolf : a=10, c=5 DW=0.2

Now, consider Rabbits and wolves live in two different places in Jungle

save this model with a new name.File save as..(a new name to modify it)

Modify the code:Cut the Constant declaration for initial Rabbit and Wolf.

Constant d 1.0;Constant c 1.0;Constant b 1.0;Constant a 1.0;Constant W_N_diffusionRate 0.2;Constant R_N_diffusionRate 0.2;

VolumeVariable R_NVolumeVariable W_N

Function J_predation ((a * R_N) - (R_N * b * W_N));Function J_wolfgrowth ((R_N * d * W_N) - (c * W_N));Function R_N_init (10.0 * ((((-5.0 + x) ^ 2.0) + (y ^ 2.0)) < 25.0));Function W_N_init (5.0 * ((((-5.0 + x) ^ 2.0) + ((-10.0 + y) ^ 2.0)) < 25.0));

Rabbits and Wolves must be described as Functions not as Constants

Only change: last two lines in Fuction declaration

New MathModel looks like --

Rabbits and wolves at different times

At t=0 At t=.275growth

At t=1.989decay

At t=0.16decay

At t=.591growthAt t=0

Rabbit

wolf

Apply Changes—run simulation

T=10 secTimesteps=0.001a= 10.0c=5.0Edit diffusion rates 0.5 for rabbits and wolves.

Rabbits, t=3.37 Wolves, t=3.37

1.Change diffusion rate

2. Change growth and death rate of Rabbit and wolf

3. Modify the positions of rabbit and wolf

4. Run for different time .

In these two Models edit different parameters and try to think what is Happening and why?

Rabbit at t=5.806 wolft at t=5.806

Fitzhugh-Nagumo system with voltage (ions) spreading along the axon

2

20.2 1

0.002*

V VI V V V C D

t xC

V Ct

2, 0 0.5 (1- )

0.0003; 0

V x t x

D I

Create 2D analytic geometry. Set size x=1, Y= 0.5, origin at (0.0). Save it with a name .

1.Copy the constants from the old F-N model (ODE model) and paste, cut Constant V_init, because V is now a sptial variable, i.e. a Function

2. Constant V_diffusionRate 0.0003;

3. Copy & paste VolumeVariable and Function.Add new function for V_init.

2, 0 0.5 (1- )

0.0003; 0

V x t x

D I

These are condition for our new system:

Go file new math ModelSpatial click the geometry you just created

We will set PDE and ODE here—

CompartmentSubDomain subVolume1 { Priority 0 BoundaryXm Flux BoundaryXp Flux PdeEquation V { BoundaryXm 0.0; BoundaryXp 0.0; Rate J1; Diffusion V_diffusionRate; Initial V_init;}

OdeEquation C {RateJ2;Initial C_init;}

} }

Click Apply changes.

We have 1 ODE for C

The code looks like -

Click equation viewer --

Close this window and click simulation

Run simulation for t=100, I=0, 0.05, 0.2

can you increase parameter I and get periodic firing?

For I=0.0V at t=0.0 C at t=0.0

Time plot CTime plot V

Time plot for V with I= 0.05 Time plot for V with I= 0.2

Time plot for C with I= 0.2Time plot for C with I= 0.05

Time plot for I=0.2, t= 1000 sec

V C

2

2

getting sickmoving around

getting sick recovering

2

2

recoveringmoving around

S SSI D

t x

ISI I

t

R RI D

t x

Exercise: SIR MODEL

(Infected individuals do not move, they stay at home)

What is the effect of diffusion? How is the behavior affected by the diffusion coefficient D?

What if you have two ‘nests’ of infection?

Again create a math Model- Spatial for BOX geometry.

1. Copy – Paste the Constants, VolumeVariable and Functions. Add diffusionRate as constant.

2.Cut Initial concentration for infected population. We want to set infected population in a particular place. So we will declare it as Function.

3. We have no Flux BC.

4. Infected people do not move, so no diffusion for Infectected population, i.e. ODE .

Part-1

Part-2

Healthy people move arround and if they come near infected people, who are In the middle, they get sick !!

What happens to Healthy Population:

Time plot

Line plot

S_init=9.0,D= 1.0

Infected popultion stays at the middle , see how the concentration Changes as you increase the time.

Line plot, t= .3

Time plot

Line plot, t= 10

Recovered Population:

Time plot Line plot

Now consider two Nests of infection- that is infection in two places:

Save this SIR model with a new name to modify it .

Only change Function I_init

((((x-5)^2 + y^2) < 1 ) || (((x-5)^2 + (y-10)^2) < 1 )) *0.2 ;

It specifies two two places of infected population with the concentration 0.2

That‘s all !!!

Susceptible (D=1):

Line plot Time plot

Infected

Time plot

Line plot

Recovered:

When Diffusion rate =0

If healthy people dont move.

Nothing happens outside the infected region

Infection becomes epidemic inthe infected region

Recovered