Post on 29-Dec-2015
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:
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:
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.
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 !!!
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
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.
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.
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.
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
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
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
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
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 .
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
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 !!!