Gillespie 随机模拟算法附matlab代码

本文介绍了一种使用Gillespie算法进行均匀化学动力系统仿真的方法,并通过一个两状态模型来模拟基因表达过程。该模型涉及转录、翻译、mRNA衰减和蛋白质衰减四个反应步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法  神经网络预测 雷达通信  无线传感器

信号处理 图像处理 路径规划 元胞自动机 无人机  电力系统

⛄ 内容介绍

Gillespie 算法是仿真均匀化学动力系统的一种标准算法,其一般步骤可以概述如下

⛄ 部分代码

function ssa_example()

% Simulate a two-state model of gene expression

import Gillespie.*

%% 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

%% Rate constants

p.kR = 0.1;%0.01;      

p.kP = 0.1;%1;                     

p.gR = 0.1;                        

p.gP = 0.002;

%% Initial state

tspan = [0, 10000]; %seconds

x0    = [0, 0];     %mRNA, protein

%% Specify reaction network

pfun = @propensities_2state;

stoich_matrix = [ 1  0    %transcription

                  0  1    %translation

                 -1  0    %mRNA decay

                  0 -1 ]; %protein decay

%% Run simulation

[t,x] = directMethod(stoich_matrix, pfun, tspan, x0, p);

%[t,x] = firstReactionMethod(stoich_matrix, pfun, tspan, x0, p);

%% Plot time course

figure();

stairs(t,x); set(gca,'XLim',tspan);

xlabel('time (s)');

ylabel('molecules');

legend({'mRNA','protein'});

end

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

⛄ 运行结果

⛄ 参考文献

[1] Argoti A ,  Fan L T ,  Cruz J , et al. Introducing stochastic simulation of chemical reactions using the gillespie algorithm and MATLAB: Revisited and augmented[J]. Chemical Engineering Education, 2008, 42(1):35-46.

[2]张雄雄, 周永华, 艾矫燕. 基于Gillespie算法及膜系统的藻类生长建模[J]. 计算机仿真, 2019(2):4.

⛄ Matlab代码关注

❤️部分理论引用网络文献,若有侵权联系博主删除

❤️ 关注我领取海量matlab电子书和数学建模资料

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值