The document describes stochastic simulations of chemical reaction cascades. It discusses simulating a series of reactions (A to B, B to C, etc.) at different rates. A simulation script is provided, and sample output shows species A decreasing while B increases over the first second. The model is expanded to allow species E to decay via a new reaction. Visualizations show this does not affect A-D profiles but changes E's profile. Faster decay of E is also discussed.
Math 1300: Section 8-3 Conditional Probability, Intersection, and IndependenceJason Aubrey
The document defines conditional probability as the probability of an event occurring given that another event has already occurred. It provides an example of calculating conditional probability using a probability table and the formula P(A|B) = P(A intersect B) / P(B). The document also explains how conditional probability restricts the sample space to outcomes in the given event.
The document discusses portfolio theory and diversification from a mathematical perspective. It introduces portfolio variance and how diversifying investments reduces risk. The variance of a portfolio is not a linear combination of the component variances due to correlation between investments. Harry Markowitz's efficient portfolios provide the maximum return for a given level of risk or minimum risk for a given level of return through diversification.
Stochastic modelling and its applicationsKartavya Jain
Stochastic processes and modelling have various applications in telecommunications. Token rings, continuous-time Markov chains, and fluid-flow models are used to model traffic flow and network performance. Aggregate dynamic stochastic models can model air traffic control by representing aircraft arrivals as Poisson processes. Disturbances like weather can be incorporated by altering flow rates. Wireless network models use search algorithms and location stochastic processes to track mobile users.
This document discusses deterministic and stochastic models. Deterministic models have unique outputs for given inputs, while stochastic models incorporate random elements, so the same inputs can produce different outputs. The document provides examples of how each model type is used, including for steady state vs. dynamic processes. It notes that while deterministic models are simpler, stochastic models better account for real-world uncertainties. In nature, deterministic models describe behavior based on known physical laws, while stochastic models are needed to represent random factors and heterogeneity.
The document provides feedback on Part 1 of a computer science practical. It summarizes submissions for Part 1, including operating systems used. It addresses some common problems and uncertainties students had, such as compilation errors, unfamiliar aspects of Objective-C, and error messages. It also provides clarification on issues like imports, method implementations, and pointer conversions.
Feedback on Part 1 of the Software Engineering Large PracticalStephen Gilmore
This document summarizes feedback from the first part of a software engineering practical project. It discusses issues seen in student submissions, such as Java syntax errors, incomplete functionality, and problems with XML documents. It also provides examples of user interfaces and additional features students have implemented. The document encourages students to pay careful attention to instructions, use logging for development, and notes changes to the sample data file.
This document is from a computer science practical session on arrays in Objective-C. It discusses creating and initializing arrays, sorting arrays, handling memory management of arrays, and using mutable arrays. The document provides code examples for creating arrays, adding and retrieving elements, sorting arrays, and updating mutable arrays. It also discusses best practices for memory management when using arrays.
Robotium is an Android testing framework that allows automation of Android app tests using JUnit. It launches the app on an emulator, programmatically enters values and clicks buttons, and reports which tests pass or fail. Automating tests in this way makes re-running tests after code changes simple and removes human intervention.
Math 1300: Section 8-3 Conditional Probability, Intersection, and IndependenceJason Aubrey
The document defines conditional probability as the probability of an event occurring given that another event has already occurred. It provides an example of calculating conditional probability using a probability table and the formula P(A|B) = P(A intersect B) / P(B). The document also explains how conditional probability restricts the sample space to outcomes in the given event.
The document discusses portfolio theory and diversification from a mathematical perspective. It introduces portfolio variance and how diversifying investments reduces risk. The variance of a portfolio is not a linear combination of the component variances due to correlation between investments. Harry Markowitz's efficient portfolios provide the maximum return for a given level of risk or minimum risk for a given level of return through diversification.
Stochastic modelling and its applicationsKartavya Jain
Stochastic processes and modelling have various applications in telecommunications. Token rings, continuous-time Markov chains, and fluid-flow models are used to model traffic flow and network performance. Aggregate dynamic stochastic models can model air traffic control by representing aircraft arrivals as Poisson processes. Disturbances like weather can be incorporated by altering flow rates. Wireless network models use search algorithms and location stochastic processes to track mobile users.
This document discusses deterministic and stochastic models. Deterministic models have unique outputs for given inputs, while stochastic models incorporate random elements, so the same inputs can produce different outputs. The document provides examples of how each model type is used, including for steady state vs. dynamic processes. It notes that while deterministic models are simpler, stochastic models better account for real-world uncertainties. In nature, deterministic models describe behavior based on known physical laws, while stochastic models are needed to represent random factors and heterogeneity.
The document provides feedback on Part 1 of a computer science practical. It summarizes submissions for Part 1, including operating systems used. It addresses some common problems and uncertainties students had, such as compilation errors, unfamiliar aspects of Objective-C, and error messages. It also provides clarification on issues like imports, method implementations, and pointer conversions.
Feedback on Part 1 of the Software Engineering Large PracticalStephen Gilmore
This document summarizes feedback from the first part of a software engineering practical project. It discusses issues seen in student submissions, such as Java syntax errors, incomplete functionality, and problems with XML documents. It also provides examples of user interfaces and additional features students have implemented. The document encourages students to pay careful attention to instructions, use logging for development, and notes changes to the sample data file.
This document is from a computer science practical session on arrays in Objective-C. It discusses creating and initializing arrays, sorting arrays, handling memory management of arrays, and using mutable arrays. The document provides code examples for creating arrays, adding and retrieving elements, sorting arrays, and updating mutable arrays. It also discusses best practices for memory management when using arrays.
Robotium is an Android testing framework that allows automation of Android app tests using JUnit. It launches the app on an emulator, programmatically enters values and clicks buttons, and reports which tests pass or fail. Automating tests in this way makes re-running tests after code changes simple and removes human intervention.
Common Java problems when developing with AndroidStephen Gilmore
For some, developing for the Android platform might provide their first experience of working with a complex, modern Java API. This may test your knowledge of the Java programming language, especially with regard to features such as generics. The Android APIs make use of generics throughout and so you will have to know how to create and handle generic classes.
This document is from a computer science practical session on Objective-C given by Stephen Gilmore on October 19, 2012. It contains several questions about whether sample code snippets would print "Yes", "No", or throw an exception, followed by the answers.
This document provides instructions for installing and using Xcode on Mac computers. It summarizes that there will be no computer science lecture the following week, and that Xcode is now available on library Macs. It then demonstrates how to install Xcode from the App Store, create a new project, write and run sample code, and use features like autocompletion, static analysis, and the debugger.
This document provides an overview of Objective-C concepts for a computer science practical session, including:
- Objective-C source files are divided into .h header files and .m implementation files.
- Classes are declared in header files with @interface and implemented in .m files with @implementation.
- Methods can be instance or class methods, distinguished by - and + prefixes.
- Properties expose fields and allow controlling access to values.
- Memory is managed through reference counting, which increments a counter when objects are created and decrements it when they are released.
This document provides an overview of debugging Android applications using Eclipse and Android Virtual Devices (AVDs). It discusses the Eclipse DDMS perspective for debugging, creating and using AVDs to emulate Android devices, and examining manifest files. It also covers string and image resources, and potential issues with the automatically generated R.java file.
The document discusses the stochastic simulation algorithm (SSA) for modeling chemical reactions. It explains that molecular reactions are inherently random processes. The SSA was developed by Gillespie to take into account this randomness by simulating reaction times and species populations. The algorithm works by choosing reaction times and events based on propensity functions derived from statistical thermodynamics. It provides an exact numerical simulation of a well-stirred chemically reacting system.
This document provides steps for getting started with Android development, including getting the Android SDK, creating an Android project, configuring and running an application on an emulator, debugging issues like NullPointerExceptions, and working with the Android user interface using XML layouts and drag and drop in the Eclipse editor. The document demonstrates core tasks for setting up an Android development environment and debugging a simple application.
The document describes a computer science practical assignment to create a command-line application in Objective-C that simulates chemical reactions stochastically. It explains that the simulation tracks the molecules of different chemical species and fires reactions according to reaction rates defined by the law of mass action. It provides an example simulation script specifying reaction constants, initial molecule counts, and reactions to simulate an enzyme-substrate system over time.
The document provides information about the Computer Science Large Practical (CSLP) and Software Engineering Large Practical (SELP) courses, including:
- The CSLP requires students to create a chemical reaction simulator in Objective-C, while the SELP requires developing an Android app to help students decide elections.
- Both courses run in the first semester and are assessed through coursework only.
- The courses aim to prepare students for later individual projects by providing larger programming projects with more design elements than previous courseworks.
This document discusses several Java programming topics including raw type parameters, working with the Java compiler, logging, and static analysis. It describes common Java problems like raw types and demonstrates how to address them. It also shows how to configure Java compiler preferences for tighter type checking and how logging and static analysis can help find bugs.
Feedback on Part 1 of the Individual PracticalStephen Gilmore
This document appears to be a presentation on common Java programming problems. It discusses topics like dead code, unused imports, overridden methods, emulator views comparing app functionality and design across different versions, and errors logged in the LogCat view. Each section includes screenshots related to the topic.
Creating and working with databases in AndroidStephen Gilmore
The document discusses code for a TODOs application that uses an SQLite database. It covers creating the database adapter and helper classes, writing methods to insert, update, and delete TODO items from the database, and retrieving data. It also discusses running the application and viewing TODO items, as well as the code for an activity to edit an individual TODO item.
The document discusses various aspects of developing Android applications in Eclipse, including manifest files, string and drawable resources, application attributes, and common Eclipse issues. It provides instructions and screenshots for editing the manifest, managing resources, updating strings, and dealing with problems like the R.java file not regenerating properly. Moving the project folder is presented as a solution to one such issue.
Project management for the individual practicalStephen Gilmore
The document discusses project management and outlines the roles of a developer and project manager. It emphasizes the importance of planning for the unexpected, predicting issues that could cause delays like weather or technical problems, and setting deadlines earlier to account for potential delays. Regular backups of work are also recommended in case of hardware or internet failures.
The document discusses various aspects of developing Android applications including getting started, running an app, managing apps, debugging apps, and designing layouts with XML. It covers creating a new project, running an app on an emulator, debugging a NullPointerException, and designing user interfaces by dragging and dropping widgets in a graphical layout editor that automatically updates the corresponding XML code.
The document discusses tools for Android development in Eclipse, including the Eclipse DDMS perspective for viewing emulators and devices, creating Android virtual devices, and starting the emulator to launch and interact with the virtual device.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
Common Java problems when developing with AndroidStephen Gilmore
For some, developing for the Android platform might provide their first experience of working with a complex, modern Java API. This may test your knowledge of the Java programming language, especially with regard to features such as generics. The Android APIs make use of generics throughout and so you will have to know how to create and handle generic classes.
This document is from a computer science practical session on Objective-C given by Stephen Gilmore on October 19, 2012. It contains several questions about whether sample code snippets would print "Yes", "No", or throw an exception, followed by the answers.
This document provides instructions for installing and using Xcode on Mac computers. It summarizes that there will be no computer science lecture the following week, and that Xcode is now available on library Macs. It then demonstrates how to install Xcode from the App Store, create a new project, write and run sample code, and use features like autocompletion, static analysis, and the debugger.
This document provides an overview of Objective-C concepts for a computer science practical session, including:
- Objective-C source files are divided into .h header files and .m implementation files.
- Classes are declared in header files with @interface and implemented in .m files with @implementation.
- Methods can be instance or class methods, distinguished by - and + prefixes.
- Properties expose fields and allow controlling access to values.
- Memory is managed through reference counting, which increments a counter when objects are created and decrements it when they are released.
This document provides an overview of debugging Android applications using Eclipse and Android Virtual Devices (AVDs). It discusses the Eclipse DDMS perspective for debugging, creating and using AVDs to emulate Android devices, and examining manifest files. It also covers string and image resources, and potential issues with the automatically generated R.java file.
The document discusses the stochastic simulation algorithm (SSA) for modeling chemical reactions. It explains that molecular reactions are inherently random processes. The SSA was developed by Gillespie to take into account this randomness by simulating reaction times and species populations. The algorithm works by choosing reaction times and events based on propensity functions derived from statistical thermodynamics. It provides an exact numerical simulation of a well-stirred chemically reacting system.
This document provides steps for getting started with Android development, including getting the Android SDK, creating an Android project, configuring and running an application on an emulator, debugging issues like NullPointerExceptions, and working with the Android user interface using XML layouts and drag and drop in the Eclipse editor. The document demonstrates core tasks for setting up an Android development environment and debugging a simple application.
The document describes a computer science practical assignment to create a command-line application in Objective-C that simulates chemical reactions stochastically. It explains that the simulation tracks the molecules of different chemical species and fires reactions according to reaction rates defined by the law of mass action. It provides an example simulation script specifying reaction constants, initial molecule counts, and reactions to simulate an enzyme-substrate system over time.
The document provides information about the Computer Science Large Practical (CSLP) and Software Engineering Large Practical (SELP) courses, including:
- The CSLP requires students to create a chemical reaction simulator in Objective-C, while the SELP requires developing an Android app to help students decide elections.
- Both courses run in the first semester and are assessed through coursework only.
- The courses aim to prepare students for later individual projects by providing larger programming projects with more design elements than previous courseworks.
This document discusses several Java programming topics including raw type parameters, working with the Java compiler, logging, and static analysis. It describes common Java problems like raw types and demonstrates how to address them. It also shows how to configure Java compiler preferences for tighter type checking and how logging and static analysis can help find bugs.
Feedback on Part 1 of the Individual PracticalStephen Gilmore
This document appears to be a presentation on common Java programming problems. It discusses topics like dead code, unused imports, overridden methods, emulator views comparing app functionality and design across different versions, and errors logged in the LogCat view. Each section includes screenshots related to the topic.
Creating and working with databases in AndroidStephen Gilmore
The document discusses code for a TODOs application that uses an SQLite database. It covers creating the database adapter and helper classes, writing methods to insert, update, and delete TODO items from the database, and retrieving data. It also discusses running the application and viewing TODO items, as well as the code for an activity to edit an individual TODO item.
The document discusses various aspects of developing Android applications in Eclipse, including manifest files, string and drawable resources, application attributes, and common Eclipse issues. It provides instructions and screenshots for editing the manifest, managing resources, updating strings, and dealing with problems like the R.java file not regenerating properly. Moving the project folder is presented as a solution to one such issue.
Project management for the individual practicalStephen Gilmore
The document discusses project management and outlines the roles of a developer and project manager. It emphasizes the importance of planning for the unexpected, predicting issues that could cause delays like weather or technical problems, and setting deadlines earlier to account for potential delays. Regular backups of work are also recommended in case of hardware or internet failures.
The document discusses various aspects of developing Android applications including getting started, running an app, managing apps, debugging apps, and designing layouts with XML. It covers creating a new project, running an app on an emulator, debugging a NullPointerException, and designing user interfaces by dragging and dropping widgets in a graphical layout editor that automatically updates the corresponding XML code.
The document discusses tools for Android development in Eclipse, including the Eclipse DDMS perspective for viewing emulators and devices, creating Android virtual devices, and starting the emulator to launch and interact with the virtual device.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
Thinking of getting a dog? Be aware that breeds like Pit Bulls, Rottweilers, and German Shepherds can be loyal and dangerous. Proper training and socialization are crucial to preventing aggressive behaviors. Ensure safety by understanding their needs and always supervising interactions. Stay safe, and enjoy your furry friends!
Film vocab for eal 3 students: Australia the movie
More Stochastic Simulation Examples
1. Computer Science Large Practical:
More Stochastic Simulation Examples
Stephen Gilmore
School of Informatics
Friday 2nd November, 2012
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 1 / 26
2. A reaction network: the cascade
Often one chemical species transforms into another, which transforms
into a third, which transforms into a fourth, and so on.
Events such as these are the basis of signalling processes which occur
within living organisms.
A series of reactions such as A becoming B, B becoming C , and so
forth is called a cascade.
The reactions in the cascade may occur at different rates. This will
affect the dynamics of the process.
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 2 / 26
3. A simulation script, cascade.txt (1/3)
# The simulation stop time (t) is 100 seconds
t = 100
# The kinetic real-number rate constants of the four
# reactions: a, b, c, d
a = 0.5
b = 0.25
c = 0.125
d = 0.0625
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 3 / 26
4. A simulation script, cascade.txt (2/3)
# The initial integer molecule counts of the five species,
# A, B, C, D, and E. Only A is present initially.
# (A, B, C, D, E) = (1000, 0, 0, 0, 0)
A = 1000
B = 0
C = 0
D = 0
E = 0
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 4 / 26
5. A simulation script, cascade.txt (3/3)
# The four reactions. The reaction ‘a’ transforms
# A into B. The reaction ’b’ transforms B into C, and
# so on through the cascade. The cascade stops
# with E.
# A has a special role because it is only consumed,
# never produced. E has a special role because it
# is only produced, never consumed.
a : A -> B
b : B -> C
c : C -> D
d : D -> E
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 5 / 26
6. A simulation of the first second of the cascade example
The columns are time, and the molecule counts of A, B, C, D, E.
0.0, 1000, 0, 0, 0, 0
0.1, 949, 51, 0, 0, 0
0.2, 888, 112, 0, 0, 0
0.3, 843, 154, 3, 0, 0
0.4, 791, 203, 6, 0, 0
0.5, 756, 232, 12, 0, 0
0.6, 707, 273, 20, 0, 0
0.7, 674, 302, 22, 2, 0
0.8, 644, 322, 32, 2, 0
0.9, 615, 339, 44, 2, 0
From this we can see (as expected) that A decreases and B increases, then
later C increases, and later still D increases. No molecules of E were
produced during the first second of this simulation.
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 6 / 26
7. Visualising the results using GNUplot
Store as “cascade.gnu”, plot using “gnuplot cascade.gnu” if results are in “cascade.csv”
set terminal postscript color
set output "cascade.ps"
set key right center
set xlabel "time"
set ylabel "molecule count"
set datafile separator ","
plot
"cascade.csv" using 1:2 with linespoints title "A",
"cascade.csv" using 1:3 with linespoints title "B",
"cascade.csv" using 1:4 with linespoints title "C",
"cascade.csv" using 1:5 with linespoints title "D",
"cascade.csv" using 1:6 with linespoints title "E"
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 7 / 26
8. Visualising the results of a cascade simulation
1000
800
600
molecule count
A
B
C
D
E
400
200
0
0 20 40 60 80 100
time
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 8 / 26
9. Adding a reaction: allowing E to decay
Now we make a slight change to the model, adding a reaction which
decays E.
We need a new reaction constant for this new reaction. We have
assigned reaction e the slowest rate.
Our intuition should be that this does not make much difference to
the profile of chemical species A, B, C and D in the output, but it
should affect the profile of species E .
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 9 / 26
10. A simulation script, cascade-decay.txt (1/3)
# The simulation stop time (t) is 100 seconds
t = 100
# The kinetic real-number rate constants of the five
# reactions: a, b, c, d, e
a = 0.5
b = 0.25
c = 0.125
d = 0.0625
e = 0.03125
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 10 / 26
11. A simulation script, cascade-decay.txt (2/3)
This part is exactly the same as cascade.txt
# The initial integer molecule counts of the five species,
# A, B, C, D, and E. Only A is present initially.
# (A, B, C, D, E) = (1000, 0, 0, 0, 0)
A = 1000
B = 0
C = 0
D = 0
E = 0
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 11 / 26
12. A simulation script, cascade-decay.txt (3/3)
# The five reactions. The reaction ‘a’ transforms
# A into B. The reaction ’b’ transforms B into C, and
# so on through the cascade. The cascade stops
# with E.
# A has a special role because it is only consumed,
# never produced. E has a special role because it
# decays without producing another output.
a : A -> B
b : B -> C
c : C -> D
d : D -> E
e : E ->
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 12 / 26
13. Visualising the results of a cascade-decay simulation
1000
800
600
molecule count
A
B
C
D
E
400
200
0
0 20 40 60 80 100
time
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 13 / 26
14. About the cascade-decay simulation
Our intuition was correct. The profiles of A, B, C , and D are very
similar to previously.
Because this is a stochastic simulation which involves pseudo-random
number generation the results will not be exactly the same but they
will be very similar.
We can see that reactions are still occurring right up to the stop-time
of this simulation (t = 100 seconds).
That is perfectly OK in the results. We simulate up to the stop-time
and no further.
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 14 / 26
15. Changing a rate in the model
We set the new reaction, e, to be the slowest reaction in the model,
but what if we had chosen it to be the fastest reaction instead?
We can find out how this would affect the results by changing the
rate of reaction e.
Our intuition should be that this again does not make much
difference to the profile of chemical species A, B, C and D in the
output, but it should affect the profile of species E .
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 15 / 26
16. A simulation script, cascade-decay-fast.txt (1/3)
# The simulation stop time (t) is 100 seconds
t = 100
# The kinetic real-number rate constants of the five
# reactions: a, b, c, d, e
a = 0.5
b = 0.25
c = 0.125
d = 0.0625
e = 1.0
# The fastest reaction is e, the decay reaction for E.
# The slowest reaction here is d.
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 16 / 26
17. A simulation script, cascade-decay-fast.txt (2/3)
This part is exactly the same as cascade-decay.txt
# The initial integer molecule counts of the five species,
# A, B, C, D, and E. Only A is present initially.
# (A, B, C, D, E) = (1000, 0, 0, 0, 0)
A = 1000
B = 0
C = 0
D = 0
E = 0
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 17 / 26
18. A simulation script, cascade-decay-fast.txt (3/3)
This part is exactly the same as cascade-decay.txt
# The five reactions. The reaction ‘a’ transforms
# A into B. The reaction ’b’ transforms B into C, and
# so on through the cascade. The cascade stops
# with E.
# A has a special role because it is only consumed,
# never produced. E has a special role because it
# decays without producing another output.
a : A -> B
b : B -> C
c : C -> D
d : D -> E
e : E ->
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 18 / 26
19. Visualising the results of a cascade-decay-fast simulation
1000
800
600
molecule count
A
B
C
D
E
400
200
0
0 20 40 60 80 100
time
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 19 / 26
20. About the cascade-decay-fast simulation
Our intuition was correct again. The profiles of A, B, C , and D are
very similar to previously.
We can see that very little E builds up in the system (because it
decays away much faster than it is produced).
The profile for E hovers around zero throughout the simulation run.
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 20 / 26
21. A dimerisation example
We saw earlier that dimerisation is a special case for the Gillespie
simulation algorithm.
Let’s consider an example which uses dimerisation and also includes a
decay reaction.
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 21 / 26
22. A simulation script, dimer-decay.txt (1/3)
# The simulation stop time (t) is 20 seconds
t = 20
# The kinetic real-number rate constants of the four
# reactions: d, x, y, z
d = 1.0
x = 0.002
y = 0.5
z = 0.04
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 22 / 26
23. A simulation script, dimer-decay.txt (2/3)
# The initial integer molecule counts of the three
# species, X, Y, and Z. Only X is present initially.
# (X, Y, Z) = (10000, 0, 0)
X = 10000
Y = 0
Z = 0
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 23 / 26
24. A simulation script, dimer-decay.txt (3/3)
# The four reactions:
# (d), X can decay to nothing;
# (x), two molecules of X can bind to form Y;
# (y), Y can unbind to give two molecules of X; and
# (z), a molecule of Y can produce a molecule of Z.
d : X ->
x : X + X -> Y
y : Y -> X + X
z : Y -> Z
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 24 / 26
25. Visualising the results of a dimer-decay simulation
10000
8000
6000
molecule count
X
Y
Z
4000
2000
0
0 5 10 15 20
time
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 25 / 26
26. Summary
We have seen some examples of simulation scripts involving cascades
and dimerisation.
Try creating some of your own. For example:
A cascade which involves more species.
A cascade where every species can decay, not just the last one.
A dimerisation example without a decay reaction.
Stephen Gilmore (School of Informatics) Stochastic simulation examples Friday 2nd November, 2012 26 / 26