Gillespie
=========
Gillespie Stochastic Simulation Algorithm
The two classic versions of the algorithm implemented in MATLAB:
- The _direct_ method
- The _first-reaction_ method
Example model
-------------
![Simulation output](ssa.png)
Consider the following two-state model of the expression of a single gene.
```
Reaction network:
1. transcription: 0 --kR--> mRNA
2. translation: mRNA --kP--> mRNA + protein
3. mRNA decay: mRNA --gR--> 0
4. protein decay: protein --gP--> 0
```
1\. Provide the time interval and the initial state of the system.
```matlab
tspan = [0, 10000]; %seconds
x0 = [0, 0]; %mRNA, protein
```
2\. Provide a stoichiometry matrix for your system. Each row of the stoichiometry matrix gives the stoichiometry of a reaction in the network.
```matlab
stoich_matrix = [ 1 0 %transcription
0 1 %translation
-1 0 %mRNA decay
0 -1 ]; %protein decay
```
3\. Provide a propensity function.
```matlab
pfun = @propensities_2state;
```
The solver calculates reaction propensities using a user-defined function. The inputs to this function are:
- `x`: the state system at current time
- `p`: reaction rate constants
The order of the elements in the returned vector `a` should match the order of reactions in the stoichiometry matrix.
```matlab
function a = propensities_2state(x, p)
% Return reaction propensities given current state x
mRNA = x(1);
protein = x(2);
a = [p.kR %transcription
p.kP*mRNA %translation
p.gR*mRNA %mRNA decay
p.gP*protein]; %protein decay
end
```
4\. Optionally, provide a set of rate constants to pass to the propensity function. Here, we define the rate constants as a struct:
```matlab
p.kR = 0.1; %molecules/sec
p.kP = 0.1; %sec^-1
p.gR = 0.1; %sec^-1
p.gP = 0.002; %sec^-1
```
5\. Run the solver!
```matlab
[t,x] = directMethod(stoich_matrix, pfun, tspan, x0, p);
```
没有合适的资源?快使用搜索试试~ 我知道了~
Gillespie 随机模拟算法附matlab代码.zip
共9个文件
m:3个
png:3个
txt:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 108 浏览量
2023-04-15
09:17:45
上传
评论
收藏 797KB ZIP 举报
温馨提示
1.版本:matlab2014/2019a,内含运行结果,不会运行可私信 2.领域:智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,更多内容可点击博主头像 3.内容:标题所示,对于介绍可点击主页搜索博客 4.适合人群:本科,硕士等教研学习使用 5.博客介绍:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可si信
资源推荐
资源详情
资源评论
收起资源包目录
Gillespie 随机模拟算法附matlab代码.zip (9个子文件)
Gillespie 随机模拟算法附matlab代码
基于Gillespie算法及膜系统的藻类生长建模.pdf 393KB
说明.txt 517B
仿真咨询.png 350KB
更多代码关注我.png 114KB
ssa_example.m 1KB
+Gillespie
directMethod.m 4KB
firstReactionMethod.m 4KB
ssa.png 6KB
README.md 2KB
共 9 条
- 1
资源评论
天天Matlab科研工作室
- 粉丝: 2w+
- 资源: 7253
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- #P0015. 全排列 超级简单
- pta题库答案c语言之排序4统计工龄.zip
- pta题库答案c语言之树结构7堆中的路径.zip
- pta题库答案c语言之树结构3TreeTraversalsAgain.zip
- pta题库答案c语言之树结构2ListLeaves.zip
- pta题库答案c语言之树结构1树的同构.zip
- 基于C++实现民航飞行与地图简易管理系统可执行程序+说明+详细注释.zip
- pta题库答案c语言之复杂度1最大子列和问题.zip
- 三维装箱问题(Three-Dimensional Bin Packing Problem,3D-BPP)是一个经典的组合优化问题
- 以下是一些关于Linux线程同步的基本概念和方法.txt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功