STEPS for Matlab

STEPS for MATLAB is an auxiliary module for STEPS that allows it to be integrated into Matlab. It implements a subset of the Matlab Simbiology toolbox functionality. Please refer to the Matlab Simbiology documentation for further details.

This tutorial builds a model with multiple compartments and several events. The events change the number of a molecular species or the reaction rate of a reaction.

Matlab Simbiology is in contrast to STEPS not a spatial solver but a well-mixed solver. It supports multiple compartments that may be nested and allows reaction events between the molecular species of different compartments. The STEPS well-mixed solvers 'wmrk4' and 'wmdirect'

STEPS requires volumes, molecular concentrations, and reaction rates to have units while Matlab

Major differences between STEPS and Matlab Simbiology:

  • STEPS is inherently a spatial similator but also offers the simulation of well-mixed reation systems using the Runge-Kutta-based deterministic solver 'wmrk4' and the stochastic solver implementing the SSA 'wmdirect',
  • Matlab Simbiology is a well-mixed solver not aware of complex spatial geometries. However, it is supported multiple, potentially nested, compartments,
  • STEPS is aware what happens on the surface of compartments, Matlab focuses on simulating the reactions within,
  • Matlab supports various kinetic laws while STEPS requires the law of mass action.

Limitations:

  • no repeated assignments in events,
  • only supports the '[t, x, names]' return value format. While Matlab Simbiology only supports a single realisation using this convention, STEPS for Matlab supports ensembles. 'x' is extended from a Matlab array to a cell array where each cell contains the time evolution data of one realisation. The time vector 't' and the list of molecular species 'names' are unchanged,
  • if a reaction rate is changed by an event, the same units as in the model are assumed,
  • only volume - volume reactions since Matlab does not support the concept of molecules embedded in surfaces,
  • the volume of compartments is assumed to be constant.

Reaction rate units supported:

  • '1/second',
  • '1/(micromolarity*second)',
  • '1/(nanomolarity*second)',
  • 'micromol/second',
  • 'nanomol/second'.

Compartment volume units supported:

  • 'l' or 'liter',
  • 'ml' or milliliter',
  • 'mul' or 'microliter',
  • 'nl' or 'nanoliter'.

STEPS requires a unit to be attached to each value while Matlab does not. Please see the STEPS tutrial on simulating a well mixed system for details.

Installation

In order to run this tutorial, Matlab and the Matlab API for Python needs to be installed.

Also, STEPS for Matlab need to be in the Matlab search path. The steps.utilities.matlab_support Python module exposes the abs_path variable readable by Matlab:


In [1]:
steps_mod = py.importlib.import_module('steps.utilities.matlab_support');
addpath(char(steps_mod.abs_path))

Dimerisation-decay model

This example is taken from Gillespie(1977). Construct the model and add a compartment. STEPS requires each part of the model such as a compartment or reaction rate to have a unit. For compartments, STEPS uses SI units with is m3m3 . STEPS for Matlab converts the unit given in the Matlab model automatically:


In [2]:
model = sbiomodel('Decaying-Dimerizing Reaction Set');
c = addcompartment(model, 'c');
c.CapacityUnits = 'nanoliter';
c.Capacity = 1;

Add the molecular species 's1', 's2', and 's3'. Matlab assigns species to compartments. STEPS assigns them to the top level model but allows different initial conditions per compartment.


In [3]:
s1 = addspecies(c, 's1', 'InitialAmount', 1e-4, 'InitialAmountUnits', 'micromolarity');
s2 = addspecies(c, 's2', 'InitialAmount', 0, 'InitialAmountUnits', 'micromolarity');
s3 = addspecies(c, 's3', 'InitialAmount', 0, 'InitialAmountUnits', 'micromolarity');

Add the reactions. Species 's1' either decays or dimerises forming 's2' in reaction 'r1' and 'r2', respectively. Reaction 'r3' converts species 's2' into 's3'.


In [4]:
r1 = addreaction(model, 's1 -> null');
r2a = addreaction(model, 's1 + s1 -> s2');
r2b = addreaction(model, 's2 -> 2 s1');
r3 = addreaction(model, 's2 -> s3');

The next four cells set up the reaction Kinetics. STEPS only supports the law of mass action while Matlab supports a broader range. This tutorial follows the Matlab approach to create a kinetic law objetc per reaction:


In [5]:
kl1 = addkineticlaw(r1, 'MassAction');
kl2a = addkineticlaw(r2a, 'MassAction');
kl2b = addkineticlaw(r2b, 'MassAction');
kl3 = addkineticlaw(r3, 'MassAction');

Add the parameters for the reaction rates. Please be ware, they need to have a unit attached to it:


In [6]:
p1  = addparameter(kl1, 'c1',  'Value', 1.0, 'ValueUnits', '1/second');
p2f = addparameter(kl2a, 'c2f', 'Value', 0.2, 'ValueUnits', '1/(micromolarity*second)');
p2r = addparameter(kl2b, 'c2r', 'Value', 0.5, 'ValueUnits', '1/second');
p3  = addparameter(kl3, 'c3',  'Value', 0.04, 'ValueUnits', '1/second');

and link the parameters to the kinetic


In [7]:
kl1.ParameterVariableNames = {'c1'};
kl2a.ParameterVariableNames = {'c2f'};
kl2b.ParameterVariableNames = {'c2r'};
kl3.ParameterVariableNames = {'c3'};

Introspection of the model to verify all the required components are in place.


In [8]:
r = model.get('Reactions');
r(1).get('KineticLaw').get('Parameters').get()
r(2).get('KineticLaw').get('Parameters').get()
p = model.get('Parameters');


       Annotation: ''
    ConstantValue: 1
             Name: 'c1'
            Notes: ''
           Parent: [1×1 SimBiology.KineticLaw]
              Tag: ''
             Type: 'parameter'
         UserData: []
            Value: 1
       ValueUnits: '1/second'

       Annotation: ''
    ConstantValue: 1
             Name: 'c2f'
            Notes: ''
           Parent: [1×1 SimBiology.KineticLaw]
              Tag: ''
             Type: 'parameter'
         UserData: []
            Value: 0.2000
       ValueUnits: '1/(micromolarity*second)'

Simulate the model using Matlab's 'sbiosimulate' using the stochastic 'SSA' solver and plot the results. Please be aware that the sequence of species in the data is not necessarily the same as in Matlab's 'sbiosimulate':


In [9]:
cs = getconfigset(model,'active');
p2f.Value = 6.022e6;
p2f.ValueUnits = '1/(micromolarity*second)';
cs.SolverType = 'ssa';
cs.StopTime = 30;

co = get(cs,'CompileOptions');
set(co,'UnitConversion', true);

%solver = cs.SolverOptions;
%solver.LogDecimation = 10;
%cs.CompileOptions.DimensionalAnalysis = false;
[t_ssa, x_ssa] = sbiosimulate(model);

% scale to the numer of molecules
x_ssa = x_ssa .* (6.022e23 * 1e-6 *1e-9);

h1 = subplot(2,1,1);
plot(h1, t_ssa, x_ssa(:,1));
h2 = subplot(2,1,2);
plot(h2, t_ssa, x_ssa(:,2:3));
grid(h1,'on'); 
grid(h2,'on');
title(h1,'Decay Dimerizing Reactions');
ylabel(h1,'Amount of S1');
ylabel(h2,'Amount of S2 & S3');
xlabel(h2,'Time');
legend(h2, 'S2', 'S3');


Warning: Reported from Stochastic Compilation:
Stochastic solvers expect integer initial amounts for species. A fractional initial amount was found for species named 's1'. It was rounded to the nearest integer.

> In sbiosimulate (line 140)

Simulate using STEPS for Matlab using STEPS stochastic 'wmdirect' solver:


In [10]:
p2f.Value = 6.022e6;
p2f.ValueUnits = '1/(micromolarity*second)'

[t, x, names] = run_steps(model, 'stoptime', 30, 'realisations', 1, 'modeltofile', true);


   SimBiology Parameter Array

   Index:    Name:    Value:       ValueUnits:
   1         c2f      6.022e+06    1/(micromolarity*second)

              dt: 0.1000
     modeltofile: 1
    realisations: 1
           rk4dt: 1.0000e-05
            seed: 0
          solver: 'wmdirect'
        stoptime: 30


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


value =

     1


value_unit =

1/second


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


value =

     6022000


value_unit =

1/(micromolarity*second)


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


value =

    0.5000


value_unit =

1/second


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


   SimBiology Compartment - c 

   Compartment Components:
     Capacity:          1
     CapacityUnits:     nanoliter
     Compartments:      0
     ConstantCapacity:  true
     Owner:             
     Species:           3


value =

    0.0400


value_unit =

1/second

log level: info
{"species": ["s1", "s2", "s3"], "data": [[[[60222.0, 0.0, 0.0], [60222.0, 0.0, 0.0], [1227.0, 29259.0, 117.0], [1191.0, 29070.0, 265.0], [1204.0, 28887.0, 385.0], [1133.0, 28721.0, 529.0], [1122.0, 28554.0, 634.0], [1221.0, 28327.0, 746.0], [1177.0, 28180.0, 856.0], [1179.0, 28009.0, 970.0], [1159.0, 27842.0, 1095.0], [1149.0, 27680.0, 1208.0], [1151.0, 27504.0, 1326.0], [1156.0, 27356.0, 1419.0], [1104.0, 27232.0, 1511.0], [1070.0, 27078.0, 1628.0], [1139.0, 26873.0, 1744.0], [1154.0, 26701.0, 1847.0], [1172.0, 26552.0, 1937.0], [1163.0, 26388.0, 2049.0], [1100.0, 26244.0, 2167.0], [1051.0, 26128.0, 2260.0], [1105.0, 25935.0, 2365.0], [1136.0, 25769.0, 2466.0], [1078.0, 25653.0, 2560.0], [1120.0, 25464.0, 2670.0], [1071.0, 25312.0, 2786.0], [1082.0, 25163.0, 2879.0], [1107.0, 24992.0, 2983.0], [1060.0, 24852.0, 3099.0], [1118.0, 24660.0, 3198.0], [1093.0, 24517.0, 3304.0], [1097.0, 24352.0, 3399.0], [1090.0, 24218.0, 3489.0], [1073.0, 24071.0, 3595.0], [1100.0, 23905.0, 3695.0], [1097.0, 23757.0, 3795.0], [996.0, 23652.0, 3902.0], [1052.0, 23470.0, 4016.0], [1063.0, 23323.0, 4111.0], [1064.0, 23190.0, 4191.0], [1001.0, 23066.0, 4290.0], [1064.0, 22900.0, 4376.0], [1044.0, 22759.0, 4471.0], [1063.0, 22609.0, 4554.0], [1025.0, 22471.0, 4650.0], [1017.0, 22332.0, 4734.0], [1047.0, 22174.0, 4825.0], [1052.0, 22037.0, 4906.0], [1059.0, 21907.0, 4976.0], [1015.0, 21796.0, 5069.0], [1001.0, 21667.0, 5150.0], [993.0, 21533.0, 5239.0], [1035.0, 21370.0, 5329.0], [993.0, 21247.0, 5425.0], [1061.0, 21073.0, 5518.0], [940.0, 20999.0, 5601.0], [963.0, 20861.0, 5677.0], [983.0, 20731.0, 5752.0], [1007.0, 20568.0, 5854.0], [970.0, 20471.0, 5926.0], [942.0, 20348.0, 6010.0], [986.0, 20194.0, 6092.0], [920.0, 20108.0, 6166.0], [979.0, 19951.0, 6248.0], [934.0, 19838.0, 6341.0], [948.0, 19705.0, 6421.0], [970.0, 19546.0, 6514.0], [955.0, 19436.0, 6582.0], [1003.0, 19284.0, 6661.0], [972.0, 19173.0, 6735.0], [937.0, 19065.0, 6807.0], [917.0, 18954.0, 6882.0], [936.0, 18831.0, 6951.0], [954.0, 18702.0, 7017.0], [970.0, 18571.0, 7095.0], [913.0, 18462.0, 7182.0], [953.0, 18322.0, 7248.0], [887.0, 18250.0, 7308.0], [992.0, 18080.0, 7385.0], [966.0, 17961.0, 7464.0], [963.0, 17840.0, 7544.0], [908.0, 17756.0, 7613.0], [898.0, 17647.0, 7677.0], [860.0, 17550.0, 7752.0], [955.0, 17399.0, 7819.0], [907.0, 17307.0, 7890.0], [922.0, 17192.0, 7959.0], [849.0, 17119.0, 8019.0], [879.0, 17002.0, 8076.0], [896.0, 16882.0, 8140.0], [854.0, 16780.0, 8220.0], [904.0, 16651.0, 8285.0], [870.0, 16571.0, 8342.0], [889.0, 16449.0, 8406.0], [847.0, 16356.0, 8475.0], [937.0, 16184.0, 8557.0], [883.0, 16100.0, 8623.0], [882.0, 16000.0, 8684.0], [865.0, 15899.0, 8747.0], [913.0, 15768.0, 8809.0], [892.0, 15659.0, 8875.0], [861.0, 15575.0, 8933.0], [863.0, 15464.0, 8997.0], [873.0, 15349.0, 9063.0], [835.0, 15264.0, 9119.0], [843.0, 15171.0, 9166.0], [879.0, 15033.0, 9237.0], [907.0, 14920.0, 9291.0], [812.0, 14860.0, 9353.0], [791.0, 14773.0, 9411.0], [843.0, 14645.0, 9472.0], [861.0, 14534.0, 9540.0], [824.0, 14454.0, 9597.0], [841.0, 14347.0, 9656.0], [791.0, 14271.0, 9710.0], [808.0, 14170.0, 9770.0], [869.0, 14051.0, 9826.0], [819.0, 13973.0, 9881.0], [833.0, 13880.0, 9928.0], [841.0, 13789.0, 9970.0], [821.0, 13691.0, 10037.0], [788.0, 13613.0, 10093.0], [787.0, 13528.0, 10138.0], [792.0, 13438.0, 10187.0], [788.0, 13367.0, 10230.0], [789.0, 13278.0, 10278.0], [785.0, 13205.0, 10318.0], [805.0, 13105.0, 10364.0], [752.0, 13020.0, 10424.0], [785.0, 12924.0, 10470.0], [745.0, 12872.0, 10516.0], [755.0, 12780.0, 10562.0], [749.0, 12697.0, 10608.0], [805.0, 12559.0, 10671.0], [708.0, 12502.0, 10727.0], [735.0, 12411.0, 10770.0], [727.0, 12319.0, 10817.0], [721.0, 12237.0, 10860.0], [723.0, 12138.0, 10916.0], [706.0, 12067.0, 10960.0], [773.0, 11944.0, 11005.0], [783.0, 11865.0, 11041.0], [765.0, 11795.0, 11091.0], [769.0, 11728.0, 11125.0], [732.0, 11679.0, 11162.0], [741.0, 11591.0, 11213.0], [753.0, 11510.0, 11250.0], [737.0, 11425.0, 11298.0], [754.0, 11331.0, 11345.0], [766.0, 11251.0, 11384.0], [757.0, 11185.0, 11424.0], [729.0, 11122.0, 11469.0], [730.0, 11055.0, 11507.0], [699.0, 10987.0, 11553.0], [703.0, 10908.0, 11599.0], [672.0, 10850.0, 11636.0], [702.0, 10750.0, 11679.0], [715.0, 10668.0, 11716.0], [695.0, 10592.0, 11765.0], [706.0, 10497.0, 11817.0], [673.0, 10430.0, 11868.0], [680.0, 10359.0, 11902.0], [684.0, 10290.0, 11936.0], [713.0, 10222.0, 11962.0], [722.0, 10138.0, 12008.0], [726.0, 10063.0, 12049.0], [656.0, 10019.0, 12096.0], [681.0, 9926.0, 12140.0], [677.0, 9851.0, 12190.0], [640.0, 9800.0, 12226.0], [675.0, 9712.0, 12265.0], [645.0, 9662.0, 12299.0], [636.0, 9589.0, 12339.0], [690.0, 9487.0, 12383.0], [660.0, 9429.0, 12422.0], [691.0, 9343.0, 12460.0], [658.0, 9293.0, 12496.0], [640.0, 9227.0, 12532.0], [665.0, 9149.0, 12566.0], [648.0, 9094.0, 12601.0], [658.0, 9026.0, 12629.0], [679.0, 8948.0, 12663.0], [616.0, 8902.0, 12704.0], [636.0, 8820.0, 12739.0], [650.0, 8740.0, 12779.0], [663.0, 8661.0, 12823.0], [627.0, 8612.0, 12854.0], [627.0, 8543.0, 12892.0], [618.0, 8479.0, 12928.0], [613.0, 8419.0, 12967.0], [631.0, 8340.0, 13005.0], [671.0, 8264.0, 13031.0], [594.0, 8233.0, 13073.0], [617.0, 8148.0, 13117.0], [602.0, 8099.0, 13144.0], [588.0, 8038.0, 13179.0], [665.0, 7937.0, 13215.0], [595.0, 7909.0, 13242.0], [578.0, 7853.0, 13270.0], [591.0, 7785.0, 13304.0], [590.0, 7724.0, 13337.0], [601.0, 7647.0, 13378.0], [560.0, 7609.0, 13404.0], [568.0, 7548.0, 13432.0], [612.0, 7452.0, 13474.0], [588.0, 7401.0, 13507.0], [587.0, 7344.0, 13531.0], [546.0, 7308.0, 13561.0], [558.0, 7243.0, 13592.0], [525.0, 7214.0, 13617.0], [540.0, 7150.0, 13646.0], [573.0, 7081.0, 13671.0], [570.0, 7025.0, 13699.0], [587.0, 6960.0, 13729.0], [594.0, 6900.0, 13754.0], [614.0, 6838.0, 13774.0], [574.0, 6799.0, 13802.0], [541.0, 6763.0, 13827.0], [603.0, 6667.0, 13861.0], [543.0, 6646.0, 13890.0], [534.0, 6595.0, 13924.0], [541.0, 6540.0, 13947.0], [540.0, 6489.0, 13973.0], [540.0, 6434.0, 13999.0], [541.0, 6377.0, 14033.0], [507.0, 6342.0, 14058.0], [510.0, 6287.0, 14082.0], [570.0, 6203.0, 14115.0], [520.0, 6180.0, 14139.0], [536.0, 6123.0, 14162.0], [510.0, 6090.0, 14179.0], [520.0, 6028.0, 14207.0], [522.0, 5980.0, 14227.0], [517.0, 5935.0, 14251.0], [504.0, 5901.0, 14271.0], [489.0, 5864.0, 14291.0], [501.0, 5814.0, 14309.0], [543.0, 5740.0, 14334.0], [547.0, 5692.0, 14357.0], [531.0, 5650.0, 14378.0], [509.0, 5614.0, 14397.0], [473.0, 5583.0, 14419.0], [512.0, 5521.0, 14437.0], [502.0, 5473.0, 14464.0], [485.0, 5433.0, 14488.0], [466.0, 5393.0, 14509.0], [457.0, 5347.0, 14535.0], [471.0, 5285.0, 14564.0], [492.0, 5232.0, 14580.0], [488.0, 5183.0, 14602.0], [471.0, 5133.0, 14630.0], [492.0, 5073.0, 14658.0], [465.0, 5045.0, 14673.0], [497.0, 4984.0, 14697.0], [475.0, 4957.0, 14713.0], [497.0, 4900.0, 14741.0], [459.0, 4878.0, 14758.0], [497.0, 4815.0, 14781.0], [444.0, 4808.0, 14795.0], [463.0, 4759.0, 14813.0], [449.0, 4719.0, 14835.0], [451.0, 4671.0, 14859.0], [483.0, 4610.0, 14879.0], [448.0, 4582.0, 14896.0], [481.0, 4536.0, 14906.0], [444.0, 4506.0, 14930.0], [462.0, 4454.0, 14952.0], [456.0, 4413.0, 14971.0], [460.0, 4370.0, 14990.0], [451.0, 4333.0, 15009.0], [479.0, 4285.0, 15020.0], [461.0, 4260.0, 15034.0], [440.0, 4233.0, 15049.0], [414.0, 4215.0, 15062.0], [403.0, 4187.0, 15076.0], [376.0, 4163.0, 15091.0], [385.0, 4124.0, 15109.0], [437.0, 4066.0, 15122.0], [427.0, 4036.0, 15140.0], [394.0, 4021.0, 15152.0], [389.0, 3980.0, 15171.0], [438.0, 3919.0, 15187.0], [438.0, 3873.0, 15210.0], [412.0, 3854.0, 15221.0], [416.0, 3814.0, 15234.0], [426.0, 3778.0, 15247.0], [380.0, 3779.0, 15252.0], [429.0, 3724.0, 15263.0], [376.0, 3704.0, 15280.0], [407.0, 3650.0, 15295.0], [377.0, 3633.0, 15308.0], [389.0, 3595.0, 15319.0], [385.0, 3552.0, 15341.0], [381.0, 3518.0, 15354.0], [386.0, 3483.0, 15364.0], [386.0, 3441.0, 15386.0], [391.0, 3409.0, 15396.0], [438.0, 3356.0, 15404.0], [385.0, 3352.0, 15418.0]]]], "compartments": ["c"]}STEPS exit status:
     0

t, x, names output convention.

and also plot the results:


In [11]:
figure;
h1 = subplot(2,1,1);
plot(t, x{1}(:,1));
h2 = subplot(2,1,2);
plot(t, x{1}(:,2), t, x{1}(:,3));
grid(h1,'on'); 
grid(h2,'on');
title(h1,'Decay Dimerizing Reactions');
ylabel(h1,'Amount of S1');
ylabel(h2,'Amount of S2 & S3');
xlabel(h2,'Time');
legend(h2, 'S2', 'S3');


Diffusion between compartments and events

Construct the model and add two compartments 'a' and 'b' with the volume of 1 liter each to it:


In [12]:
model = sbiomodel('Two_compartment_diffusion');
a = addcompartment(model, 'a');
b = addcompartment(model, 'b');
a.CapacityUnits = 'liter';
b.CapacityUnits = 'liter';

Add the molecular species 'x', 'y', 'z'. The species 'n' is the sink for decyed molecules. Matlab assigns species to compartments. STEPS assigns them to the top level model but allows different initial conditions per compartment.


In [13]:
% species
x_a = addspecies(a, 'x', 'InitialAmount', 1000, 'InitialAmountUnits', 'molecule');
x_b = addspecies(b, 'x', 'InitialAmount', 0, 'InitialAmountUnits', 'molecule');
y_a = addspecies(a, 'y', 'InitialAmount', 0, 'InitialAmountUnits', 'molecule');
y_b = addspecies(b, 'y', 'InitialAmount', 1000, 'InitialAmountUnits', 'molecule');
z_a = addspecies(a, 'z', 'InitialAmount', 2000, 'InitialAmountUnits', 'molecule');
n_a = addspecies(a, 'n', 'InitialAmount', 0, 'InitialAmountUnits', 'molecule');

Matlab uses a 'compartment.specie' notation distinguish molecular species within different compartments. Reactions involving two compartments are translated into STEPS surface reactions. A STEPS patch is automatically created. Reactions involving more than two compartments are not supported.

There are two compartments 'a' and 'b' in this example. Molecules of species 'x' and 'y' can diffuse from one compartment to the other as given in reaction 'r1' to 'r4'. Furthermore, species 'z' is limited to compartment 'a' and decays.


In [14]:
% reactions
r1 = addreaction(model, 'a.x -> b.x');
r2 = addreaction(model, 'b.x -> a.x');
r3 = addreaction(model, 'a.y -> b.y');
r4 = addreaction(model, 'b.y -> a.y');
r5 = addreaction(model, 'a.z -> a.n');

As in the previous example, the next four cells set up the reaction Kinetics. STEPS only supports the law of mass action while Matlab supports a broader range. This tutorial follows the Matlab approach to create a kinetic law objetc per reaction:


In [15]:
% Set the kinetic law
kl1 = addkineticlaw(r1, 'MassAction');
kl2 = addkineticlaw(r2, 'MassAction');
kl3 = addkineticlaw(r3, 'MassAction');
kl4 = addkineticlaw(r4, 'MassAction');
kl5 = addkineticlaw(r5, 'MassAction');

as well as a parameter for the reation rate of each reaction. In order to modify the reaction rates by an event during the course of the simulation, the parameters have to be defined as non-constant:


In [16]:
% Add rate constant parameter, c2, to kinetic law with value = 0.01
p1 = addparameter(model, 'c1', 'Value', 0.25, 'ConstantValue', false);
p2 = addparameter(model, 'c2', 'Value', 0.25, 'ConstantValue', false);
p3 = addparameter(model, 'c3', 'Value', 0.25, 'ConstantValue', false);
p4 = addparameter(model, 'c4', 'Value', 0.25, 'ConstantValue', false);
p5 = addparameter(model, 'c5', 'value', 0.1, 'ConstantValue', false);

The reaction rates are linked to the kinetic laws and with it to the reaction by setting the \ParameterVariableNames\ property of the kinetic law to the name of the desired parameter:


In [17]:
set(kl1, 'ParameterVariableNames', {'c1'});
set(kl2, 'ParameterVariableNames', {'c2'});
set(kl3, 'ParameterVariableNames', {'c3'});
set(kl4, 'ParameterVariableNames', {'c4'});
set(kl5, 'ParameterVariableNames', {'c5'});

STEPS requires units for each part of the model. For reaction rates steps requires the molecular concentration part of the rate to be given in $\frac{Mol}{liter}$. STEPS for Matlab automatically converts the units.


In [18]:
% Add units to c2
p1.ValueUnits = '1/second';
p2.ValueUnits = '1/second';
p3.ValueUnits = '1/second';
p4.ValueUnits = '1/second';
p5.ValueUnits = '1/second';

Add the events. An event has a trigger \time\ which gives the simulation time when the event occurs and a string defining what shall happen. Matlab supports arbitrary Matlab code such as function call in events. STEPS for Matlab only supports assigning a value to a molecular species and reaction rates.

It is assumed that the variables changed by the event have the same units as in molecular concentration as in the earlier model definition.


In [19]:
% add a simple event, at t=15 we set x_a=1000 and y_b=1000
e1 = addevent(model, 'time>=15', {'a.x = 1000', 'b.y = 1000'});
e2 = addevent(model, 'time>=10', 'a.x = 0');
e3 = addevent(model, 'time>=20', 'a.z = 0');
e4 = addevent(model, 'time>=5', 'c5 = 0');
e5 = addevent(model, 'time>=15', 'c5 = 0.1');

Introspect the model and the parameters. The model got 2 compartments, 5 reactions with a parameter each, 6 molecular species, and 5 events:


In [ ]:
model
model.get('Events')

Simulate the model using Matlab's Simbiology solver up to 't = 30' seconds:


In [71]:
% this would be running the simulation using Matlab simbiology
cs = getconfigset(model,'active');
% cs.SolverType = 'ssa';
cs.StopTime = 30;
[t, x, names] = sbiosimulate(model);

and plot the results. STEPS for Matlab only supports the '[t, x, name]' return value convention of 'sbiosimulate' where 'x' denotes the vector of time points, 'x' the array containing the time evoluton data, and 'names' the column or species names of 'x'. However, it has been extended to support ensembles of realisations by using a cell array for the time evolution data 'x'. Each cell contains a single realisation of the ensemble computed.


In [21]:
% plot
h1 = subplot(2,1,1);
plot(h1, t, x(:,1:3));
h2 = subplot(2,1,2);
plot(h2, t, x(:,5:6));
grid(h1,'on'); 
grid(h2,'on');
title(h1,'Diffusion between 2 compartments');
ylabel(h1,'Amount compartment a');
ylabel(h2,'Amount compartment b');
xlabel(h2,'Time');
legend(h1, 'x', 'y', 'z');
legend(h2, 'x', 'y');


Finally, simulate the reaction system using STEPS for Matlab.

STEPS for Matlab does not yet support returning Simbiology SimData objects. Only the [t, x, names] convention is supported where t is a vector of time points, x the corresponding state data, and names the list of molecular species names. However, while Matlab Simbiology only supports a single realisation using this return data format convention, STEPS for Matlab also supports ensembles by extending x to a cell array, one cell per realisation.

Input arguments. They are given as name, value pair.

  • solver - 'wmdirect' or 'wmrk4', default: 'wmdirect'. Please see the STEPS documentation for details (TODO: links missing)
  • seed - set an explicit see for the pseudo random number generator. If '0' or nothing given, a seed will be generated,
  • realisations - the number of realisations to be computed, default: '1',
  • rk4dt - internal time step of the Runge-Kutta solver wmrk4, default: '1e-5',
  • dt - increment between the time points at which the molecular populations are stored,
  • stoptime - the final time up to which the simulation will be computed,
  • modeltofile - boolean flag, 'True' or False'. If set to 'True', the generated STEPS model is written to a file.

In [72]:
[t,x, names] = run_steps(model, 'stoptime', 30, 'realisations', 1, 'modeltofile', true, 'solver', 'wmrk4');


              dt: 0.1000
     modeltofile: 1
    realisations: 1
           rk4dt: 1.0000e-05
            seed: 0
          solver: 'wmrk4'
        stoptime: 30

log level: info
{"species": ["n", "x", "y", "z"], "compartments": ["a", "b"], "data": [[[[0.0, 1000.0, 0.0, 2000.0], [19.90033250166516, 975.6147122503535, 24.385287749644604, 1980.0996674983344], [39.602653386477755, 952.4187090179876, 47.58129098200664, 1960.3973466135199], [59.10893290295271, 930.3539882125621, 69.64601178743695, 1940.8910670970472], [78.4211216953039, 909.3653765390447, 90.63462346095645, 1921.5788783046935], [97.54115099850381, 889.4003915357748, 110.599608464228, 1902.4588490015014], [116.4709328315207, 870.4091103408471, 129.59088965915853, 1883.5290671684909], [135.2123601882068, 852.3440448592605, 147.65595514073863, 1864.7876398118033], [153.76730722691497, 835.1600230176457, 164.8399769823471, 1846.2326927731], [172.13762945781397, 818.8140758106466, 181.18592418934406, 1827.862370542212], [190.32516392843098, 803.2653298560192, 196.73467014397087, 1809.6748360715892], [208.33172940717319, 788.4749051900565, 211.52509480993587, 1791.6682705928429], [226.1591265657978, 774.4058180469231, 225.59418195306748, 1773.8408734342177], [243.809138158874, 761.0228883805103, 238.9771116194831, 1756.1908618411344], [261.2835292022703, 748.2926518957844, 251.70734810420598, 1738.716470797729], [278.584047149655, 736.1832763706657, 263.8167236293327, 1721.4159528503335], [295.71242206723906, 724.6644820588297, 275.3355179411633, 1704.287577932744], [312.67036680678734, 713.7074659746414, 286.29253402535204, 1687.3296331931995], [329.4595771769043, 703.2848298706275, 296.71517012936374, 1670.5404228230818], [346.0817321126198, 693.3705117276219, 306.6294882723626, 1653.9182678873535], [362.53849384328197, 683.9397205861319, 316.0602794138498, 1637.4615061566938], [378.83150805877, 674.9688745560269, 325.03112544395674, 1621.1684919411962], [394.9624040740887, 666.4355418495181, 333.56445815046214, 1605.0375959258731], [410.93279499228305, 658.3183846900345, 341.6816153099475, 1589.0672050076735], [426.7442778657516, 650.5971059566292, 349.40289404334607, 1573.2557221342113], [442.39843385595805, 643.2523984306437, 356.7476015693309, 1557.6015661440094], [457.8968283915442, 636.265896517572, 363.7341034824005, 1542.1031716084126], [473.24101132488164, 629.6201303235254, 370.3798696764458, 1526.758988675073], [488.4325170870523, 623.2984819713996, 376.70151802857896, 1511.5674829128964], [503.4728648412896, 617.2851440475029, 382.71485595247776, 1496.5271351586648], [518.363558634902, 611.5650800748268, 388.43491992515703, 1481.6364413650438], [533.1060875496751, 606.1239869139864, 393.8760130859939, 1466.8939124502626], [547.7019258507949, 600.948258997945, 399.0517410020348, 1452.298074149144], [562.1525331342448, 596.0249543109958, 403.97504568898444, 1437.8474668656995], [576.4593544728039, 591.3417620269867, 408.65823797299464, 1423.5406455271493], [590.623820560522, 586.8869717258339, 413.11302827414204, 1409.3761794394215], [604.6473478558139, 582.6494441114049, 417.3505558885734, 1395.352652144116], [618.531338723096, 578.6185831574171, 421.38141684255476, 1381.4686612768323], [632.2771815730255, 574.7843096119121, 425.21569038805643, 1367.7228184268995], [645.8862510013373, 571.1370357938449, 428.86296420612354, 1354.1137489985701], [659.3599079263199, 567.6676416188881, 432.33235838108067, 1340.6400920735864], [672.6994997254828, 564.367451794333, 435.6325482056341, 1327.3005002744108], [685.906360368522, 561.2282141267846, 438.7717858731845, 1314.0936396313678], [698.9818105525007, 558.2420788869237, 441.75792111305424, 1301.0181894473797], [711.9271578333409, 555.401579181229, 444.59842081875064, 1288.0728421665392], [724.7436967565596, 552.6996122808923, 447.3003877190888, 1275.256303243304], [737.4327089867338, 550.1294218612736, 449.8705781387141, 1262.5672910131339], [749.9954634356516, 547.6845811075598, 452.31541889242624, 1250.004536564216], [762.4332163892308, 545.358976644416, 454.64102335557095, 1237.5667836106365], [774.747211633127, 543.1467932493252, 456.85320675066214, 1225.2527883667367], [786.9386805771248, 541.0424993115267, 458.9575006884586, 1213.0613194227276], [786.9386805771248, 539.0408330001038, 460.95916699988487, 1213.0613194227276], [786.9386805771248, 537.136789106647, 462.86321089333927, 1213.0613194227276], [786.9386805771248, 535.3256065296537, 464.6743934703326, 1213.0613194227276], [786.9386805771248, 533.6027563692702, 466.39724363070616, 1213.0613194227276], [786.9386805771248, 531.9639306027153, 468.0360693972579, 1213.0613194227276], [786.9386805771248, 530.4050313119418, 469.5949686880279, 1213.0613194227276], [786.9386805771248, 528.9221604367306, 471.07783956324107, 1213.0613194227276], [786.9386805771248, 527.5116100274931, 472.4883899724764, 1213.0613194227276], [786.9386805771248, 526.1698529734878, 473.83014702648126, 1213.0613194227276], [786.9386805771248, 524.8935341831955, 475.10646581677827, 1213.0613194227276], [786.9386805771248, 523.6794621948196, 476.3205378051492, 1213.0613194227276], [786.9386805771248, 522.5246011960201, 477.4753988039468, 1213.0613194227276], [786.9386805771248, 521.4260634327542, 478.5739365672075, 1213.0613194227276], [786.9386805771248, 520.3811019884156, 479.61889801154473, 1213.0613194227276], [786.9386805771248, 519.3871039150878, 480.6128960848649, 1213.0613194227276], [786.9386805771248, 518.4415836998478, 481.5584163001054, 1213.0613194227276], [786.9386805771248, 517.5421770496563, 482.4578229503009, 1213.0613194227276], [786.9386805771248, 516.6866349793986, 483.31336502055484, 1213.0613194227276], [786.9386805771248, 515.8728181882801, 484.1271818116788, 1213.0613194227276], [786.9386805771248, 515.098691710412, 484.90130828954875, 1213.0613194227276], [786.9386805771248, 514.3623198263783, 485.6376801735785, 1213.0613194227276], [786.9386805771248, 513.6618612229156, 486.3381387770423, 1213.0613194227276], [786.9386805771248, 512.9955643886559, 487.0044356113015, 1213.0613194227276], [786.9386805771248, 512.361763234458, 487.63823676549873, 1213.0613194227276], [786.9386805771248, 511.758872927304, 488.2411270726523, 1213.0613194227276], [786.9386805771248, 511.1853859273938, 488.81461407256256, 1213.0613194227276], [786.9386805771248, 510.6398682185114, 489.3601317814449, 1213.0613194227276], [786.9386805771248, 510.1209557222374, 489.87904427771895, 1213.0613194227276], [786.9386805771248, 509.62735088704045, 490.3726491129159, 1213.0613194227276], [786.9386805771248, 509.15781944372833, 490.842180556228, 1213.0613194227276], [786.9386805771248, 508.71118731912236, 491.288812680834, 1213.0613194227276], [786.9386805771248, 508.28633770026977, 491.7136622996866, 1213.0613194227276], [786.9386805771248, 507.8822082418305, 492.11779175812586, 1213.0613194227276], [786.9386805771248, 507.4977884096595, 492.50221159029684, 1213.0613194227276], [786.9386805771248, 507.1321169539339, 492.8678830460224, 1213.0613194227276], [786.9386805771248, 506.784279505548, 493.21572049440834, 1213.0613194227276], [786.9386805771248, 506.4534062897011, 493.54659371025525, 1213.0613194227276], [786.9386805771248, 506.1386699510089, 493.8613300489474, 1213.0613194227276], [786.9386805771248, 505.8392834846901, 494.16071651526624, 1213.0613194227276], [786.9386805771248, 505.5544982686291, 494.4455017313272, 1213.0613194227276], [786.9386805771248, 505.2836021914455, 494.71639780851086, 1213.0613194227276], [786.9386805771248, 505.0259178718517, 494.97408212810467, 1213.0613194227276], [786.9386805771248, 504.78080096481796, 495.2191990351384, 1213.0613194227276], [786.9386805771248, 504.5476385504059, 495.45236144955044, 1213.0613194227276], [786.9386805771248, 504.3258476011318, 495.67415239882456, 1213.0613194227276], [786.9386805771248, 504.1148735240878, 495.88512647586856, 1213.0613194227276], [786.9386805771248, 503.91418877420347, 496.0858112257529, 1213.0613194227276], [786.9386805771248, 503.7232915350678, 496.27670846488854, 1213.0613194227276], [786.9386805771248, 503.5417044641445, 496.4582955358118, 1213.0613194227276], [786.9386805771248, 0.0, 496.6310265007839, 1213.0613194227276], [786.9386805771248, 12.1104904870695, 496.79533327718667, 1213.0613194227276], [786.9386805771248, 23.630345383484027, 496.95162671754963, 1213.0613194227276], [786.9386805771248, 34.588370326911324, 497.10029763687254, 1213.0613194227276], [786.9386805771248, 45.011966087492326, 497.2417177899049, 1213.0613194227276], [786.9386805771248, 54.92719708403933, 497.3762408006862, 1213.0613194227276], [786.9386805771248, 64.35885655865842, 497.50420304681165, 1213.0613194227276], [786.9386805771248, 73.33052857277052, 497.6259245005515, 1213.0613194227276], [786.9386805771248, 81.86464697954652, 497.74170952894303, 1213.0613194227276], [786.9386805771248, 89.9825515202295, 497.85184765486304, 1213.0613194227276], [786.9386805771248, 97.70454118460093, 497.9566142809976, 1213.0613194227276], [786.9386805771248, 105.0499249690269, 498.05627137848273, 1213.0613194227276], [786.9386805771248, 112.03707015901003, 498.1510681419714, 1213.0613194227276], [786.9386805771248, 118.68344825696833, 498.24124161274926, 1213.0613194227276], [786.9386805771248, 125.00567867009187, 498.32701727146014, 1213.0613194227276], [786.9386805771248, 131.01957026751506, 498.40860960193635, 1213.0613194227276], [786.9386805771248, 136.74016091073344, 498.48622262749507, 1213.0613194227276], [786.9386805771248, 142.18175505607462, 498.5600504211309, 1213.0613194227276], [786.9386805771248, 147.35795952330537, 498.63027759078125, 1213.0613194227276], [786.9386805771248, 152.28171751975592, 498.6970797409559, 1213.0613194227276], [786.9386805771248, 156.9653410050924, 498.7606239118216, 1213.0613194227276], [786.9386805771248, 161.42054147761772, 498.8210689969028, 1213.0613194227276], [786.9386805771248, 165.65845925912512, 498.8785661403983, 1213.0613194227276], [786.9386805771248, 169.68969135150292, 498.9332591151163, 1213.0613194227276], [786.9386805771248, 173.52431793475722, 498.985284681984, 1213.0613194227276], [786.9386805771248, 177.17192757271408, 499.03477293200933, 1213.0613194227276], [786.9386805771248, 180.64164118942531, 499.0818476116073, 1213.0613194227276], [786.9386805771248, 183.94213487622466, 499.12662643198667, 1213.0613194227276], [786.9386805771248, 187.0816615864808, 499.1692213635249, 1213.0613194227276], [786.9386805771248, 190.06807177227728, 499.2097389157407, 1213.0613194227276], [786.9386805771248, 192.9088330146304, 499.2482804036135, 1213.0613194227276], [786.9386805771248, 195.61104869633155, 499.2849422009434, 1213.0613194227276], [786.9386805771248, 198.18147576411036, 499.31981598132046, 1213.0613194227276], [786.9386805771248, 200.62654162451034, 499.3529889473555, 1213.0613194227276], [786.9386805771248, 202.95236021575894, 499.38454404874756, 1213.0613194227276], [786.9386805771248, 205.16474729580207, 499.41456018968375, 1213.0613194227276], [786.9386805771248, 207.2692349847197, 499.44311242615015, 1213.0613194227276], [786.9386805771248, 209.27108559791367, 499.47027215361584, 1213.0613194227276], [786.9386805771248, 211.1753048046358, 499.49610728554177, 1213.0613194227276], [786.9386805771248, 212.986654144766, 499.52068242321434, 1213.0613194227276], [786.9386805771248, 214.7096629351437, 499.5440590172801, 1213.0613194227276], [786.9386805771248, 216.3486395952215, 499.56629552139896, 1213.0613194227276], [786.9386805771248, 217.90768242035477, 499.58744753841574, 1213.0613194227276], [786.9386805771248, 219.3906898296744, 499.60756795939085, 1213.0613194227276], [786.9386805771248, 220.8013701141695, 499.62670709585376, 1213.0613194227276], [786.9386805771248, 222.14325070934308, 499.6449128056171, 1213.0613194227276], [786.9386805771248, 223.41968701563394, 499.66223061243943, 1213.0613194227276], [786.9386805771248, 224.6338707886766, 499.6787038198558, 1213.0613194227276], [786.9386805771248, 225.78883812034567, 499.69437361946484, 1213.0613194227276], [786.9386805771248, 226.88747703056407, 499.7092791939299, 1213.0613194227276], [786.9386805771248, 1000.0, 499.7234578149499, 1213.0613194227276], [799.0088423782859, 982.1670022904323, 511.9228452509801, 1200.9911576215673], [810.9589040628483, 965.2037301420586, 523.5272615409956, 1189.0410959369922], [822.7900606469403, 949.0677665387456, 534.5657237701912, 1177.2099393529013], [834.5034952560812, 933.7187631666342, 545.0658338438201, 1165.4965047437775], [846.1003792434841, 919.1183395223445, 555.0538475063375, 1153.8996207563703], [857.5818723072141, 905.2299869417437, 564.5547399944185, 1142.418127692639], [868.9491226061436, 892.0189773092726, 573.5922684880798, 1131.0508773936917], [880.2032668747844, 879.4522762195205, 582.1890315160024, 1119.796733125052], [891.3454305369386, 867.4984603740727, 590.3665254636059, 1108.654569462898], [902.3767278182497, 856.1276390068371, 598.1451983252239, 1097.6232721815823], [913.2982618576507, 845.3113791416023, 605.5445008347475, 1086.7017381421895], [924.1111248176428, 835.0226344947594, 612.5829351025754, 1075.8888751822014], [934.816397993528, 825.2356778455237, 619.2781008805352, 1065.1836020063117], [945.4151519215482, 815.9260367044807, 625.6467395704316, 1054.584848078287], [955.9084464859321, 807.0704321195924, 631.7047760862672, 1044.091553513909], [966.2973310248757, 798.6467204667205, 637.4673586748154, 1033.7026689749712], [976.5828444354955, 790.6338380790154, 642.9488967941452, 1023.4171555643502], [986.7660152776947, 783.0117485767757, 648.1630971447612, 1013.233984722151], [996.8478618770534, 775.7613927660924, 653.1229979435061, 1003.1521381227923], [1006.8293924266309, 768.8646409808816, 657.8410015258685, 993.1706075732149], [1016.711605087792, 762.3042477493232, 662.3289053582989, 983.2883949120537], [1026.495488090041, 756.0638086711803, 666.5979315380287, 973.5045119097947], [1036.1820198298442, 750.1277193982532, 670.6587548541388, 963.8179801699833], [1045.7721689684352, 744.481136615398, 674.5215294801187, 954.2278310313886], [1055.266894528717, 739.109940924476, 678.1959143645539, 944.7331054710993], [1064.6671459911536, 734.0007015385293, 681.6910973835676, 935.3328540086413], [1073.9738633887423, 729.1406426978086, 685.0158183152582, 926.0261366110363], [1083.187977400981, 724.5176117237189, 688.1783906937342, 916.8120225987916], [1092.3104094469456, 720.1200486307933, 691.1867225972509, 907.6895905528269], [1101.3420717774347, 715.9369572207122, 694.0483364225291, 898.6579282223396], [1110.2838675662094, 711.9578775860709, 696.7703876946832, 889.7161324335606], [1119.1366910003042, 708.1728599551833, 699.3596829597591, 880.8633089994686], [1127.9014273694415, 704.5724398124307, 701.8226968046062, 872.0985726303398], [1136.5789531545622, 701.147614232088, 704.1655880467835, 863.4210468452318], [1145.1701361154653, 697.8898193662885, 706.3942151347327, 854.829863884329], [1153.6758353776117, 694.7909090309579, 708.5141507970297, 846.3241646221828], [1162.0969015180133, 691.8431343361132, 710.5306959770562, 837.9030984817739], [1170.4341766503082, 689.039124309574, 712.4488930881236, 829.5658233494777], [1178.6884945089575, 686.3718674657403, 714.2735386221636, 821.3115054908327], [1186.8606805326388, 683.8346942731936, 716.0091951434177, 813.1393194671722], [1194.951551946727, 681.4212604773949, 717.6602026972597, 805.0484480530841], [1202.9619178451348, 679.1255312367472, 719.230689662544, 797.0380821546753], [1210.8925792711307, 676.9417660323594, 720.7245830747163, 789.1074207286988], [1218.7443292974299, 674.8645043137549, 722.1456184454435, 781.255670702385], [1226.5179531055946, 672.8885518446258, 723.4973491033286, 773.4820468941984], [1234.2142280645041, 671.0089677145852, 724.7831550790982, 765.7857719352766], [1241.8339238080766, 669.2210519842699, 726.0062515574587, 758.1660761917133], [1249.3778023122093, 667.5203339330707, 727.1696969166769, 750.6221976875808], [1256.8466179710445, 665.9025608799838, 728.2764003761564, 743.1533820287422], [1264.2411176723833, 664.3636875497335, 729.3291292710056, 0.0], [1264.2411176723833, 662.899865957419, 730.3305159718072, 0.0], [1264.2411176723833, 661.5074357865943, 731.2830644669144, 0.0], [1264.2411176723833, 660.1829152365493, 732.1891566237241, 0.0], [1264.2411176723833, 658.9229923159962, 733.0510581445864, 0.0], [1264.2411176723833, 657.7245165613622, 733.8709242322524, 0.0], [1264.2411176723833, 656.584491159007, 734.6508049789905, 0.0], [1264.2411176723833, 655.5000654516059, 735.3926504928847, 0.0], [1264.2411176723833, 654.4685278100385, 736.0983157741405, 0.0], [1264.2411176723833, 653.4872988529086, 736.7695653535154, 0.0], [1264.2411176723833, 652.5539249967155, 737.408077704596, 0.0], [1264.2411176723833, 651.6660723206508, 738.0154494408522, 0.0], [1264.2411176723833, 650.821520730556, 738.5931993079886, 0.0], [1264.2411176723833, 650.0181584075443, 739.1427719816097, 0.0], [1264.2411176723833, 649.2539765273622, 739.6655416796535, 0.0], [1264.2411176723833, 648.5270642372622, 740.1628155986713, 0.0], [1264.2411176723833, 647.8356038778883, 740.6358371824773, 0.0], [1264.2411176723833, 647.1778664381842, 741.08578923142, 0.0], [1264.2411176723833, 646.5522072319454, 741.5137968599907, 0.0], [1264.2411176723833, 645.9570617852544, 741.9209303101919, 0.0], [1264.2411176723833, 645.3909419245122, 742.3082076277221, 0.0], [1264.2411176723833, 644.8524320551733, 742.6765972075999, 0.0], [1264.2411176723833, 644.34018562207, 743.027020215655, 0.0], [1264.2411176723833, 643.852921742323, 743.3603528919432, 0.0], [1264.2411176723833, 643.3894220024093, 743.677428741765, 0.0], [1264.2411176723833, 642.9485274115594, 743.979040619922, 0.0], [1264.2411176723833, 642.5291355036361, 744.265942713194, 0.0], [1264.2411176723833, 642.1301975804223, 744.5388524262692, 0.0], [1264.2411176723833, 641.7507160893144, 744.7984521755791, 0.0], [1264.2411176723833, 641.3897421289169, 745.045391095718, 0.0], [1264.2411176723833, 641.0463730763064, 745.2802866626063, 0.0], [1264.2411176723833, 640.719750329999, 745.503726237516, 0.0], [1264.2411176723833, 640.4090571630062, 745.716268535768, 0.0], [1264.2411176723833, 640.1135166805731, 745.9184450238179, 0.0], [1264.2411176723833, 639.83238987755, 746.1107612481917, 0.0], [1264.2411176723833, 639.5649737904981, 746.2936980996222, 0.0], [1264.2411176723833, 639.3105997399099, 746.467713015523, 0.0], [1264.2411176723833, 639.0686316581639, 746.6332411238299, 0.0], [1264.2411176723833, 638.8384644990111, 746.790696331034, 0.0], [1264.2411176723833, 638.6195227246784, 746.9404723571728, 0.0], [1264.2411176723833, 638.411258866679, 747.0829437203206, 0.0], [1264.2411176723833, 638.2131521568912, 747.2184666730917, 0.0], [1264.2411176723833, 638.0247072253516, 747.3473800934628, 0.0], [1264.2411176723833, 637.8454528615714, 747.4700063321377, 0.0], [1264.2411176723833, 637.6749408362716, 747.5866520185677, 0.0], [1264.2411176723833, 637.5127447805779, 747.6976088277454, 0.0], [1264.2411176723833, 637.3584591198661, 747.8031542094901, 0.0], [1264.2411176723833, 637.2116980596228, 747.9035520822202, 0.0], [1264.2411176723833, 637.07209462075, 747.9990534929211, 0.0], [1264.2411176723833, 636.9392997219234, 748.0898972448597, 0.0], [1264.2411176723833, 636.8129813067418, 748.1763104947322, 0.0], [1264.2411176723833, 636.6928235133624, 748.2585093206872, 0.0], [1264.2411176723833, 636.5785258847159, 748.3366992625898, 0.0], [1264.2411176723833, 636.4698026171967, 748.4110758360275, 0.0], [1264.2411176723833, 636.3663818460032, 748.4818250211748, 0.0], [1264.2411176723833, 636.2680049653479, 748.549123727847, 0.0], [1264.2411176723833, 636.1744259817802, 748.6131402378604, 0.0], [1264.2411176723833, 636.0854108990909, 748.6740346258409, 0.0], [1264.2411176723833, 636.0007371332117, 748.7319591594684, 0.0], [1264.2411176723833, 635.9201929556262, 748.787058680258, 0.0], [1264.2411176723833, 635.8435769639336, 748.8394709657183, 0.0], [1264.2411176723833, 635.7706975782479, 748.8893270738433, 0.0], [1264.2411176723833, 635.7013725621447, 748.9367516708933, 0.0], [1264.2411176723833, 635.6354285669726, 748.981863343047, 0.0], [1264.2411176723833, 635.572700698395, 749.024774892987, 0.0], [1264.2411176723833, 635.5130321040651, 749.0655936219355, 0.0], [1264.2411176723833, 635.4562735814261, 749.1044215979875, 0.0], [1264.2411176723833, 635.4022832045958, 749.1413559113037, 0.0], [1264.2411176723833, 635.3509259695184, 749.1764889168986, 0.0], [1264.2411176723833, 635.3020734563472, 749.2099084655963, 0.0], [1264.2411176723833, 635.255603508359, 749.2416981236739, 0.0], [1264.2411176723833, 635.211399926484, 749.2719373818327, 0.0], [1264.2411176723833, 635.1693521787312, 749.300701853966, 0.0], [1264.2411176723833, 635.1293551238406, 749.328063466241, 0.0], [1264.2411176723833, 635.0913087483301, 749.3540906369333, 0.0], [1264.2411176723833, 635.0551179164501, 749.3788484475349, 0.0], [1264.2411176723833, 635.0206921322705, 749.4023988054615, 0.0], [1264.2411176723833, 634.9879453133914, 749.424800598885, 0.0], [1264.2411176723833, 634.9567955757169, 749.4461098439455, 0.0], [1264.2411176723833, 634.9271650286722, 749.4663798248648, 0.0], [1264.2411176723833, 634.8989795804601, 749.4856612271508, 0.0], [1264.2411176723833, 634.872168752787, 749.5040022643457, 0.0], [1264.2411176723833, 634.8466655046067, 749.5214487986079, 0.0], [1264.2411176723833, 634.8224060645166, 749.5380444553498, 0.0], [1264.2411176723833, 634.799329771279, 749.5538307323591, 0.0], [1264.2411176723833, 634.777378922142, 749.5688471035554, 0.0], [1264.2411176723833, 634.7564986285503, 749.5831311176847, 0.0], [1264.2411176723833, 634.736636678892, 749.596718492224, 0.0], [1264.2411176723833, 634.7177434079455, 749.6096432026928, 0.0], [1264.2411176723833, 634.6997715727028, 749.621937567588, 0.0], [1264.2411176723833, 634.6826762342046, 749.6336323292398, 0.0], [1264.2411176723833, 634.6664146452022, 749.6447567306277, 0.0], [1264.2411176723833, 634.650946143261, 749.6553385885629, 0.0], [1264.2411176723833, 634.6362320490537, 749.6654043631958, 0.0], [1264.2411176723833, 634.6222355696964, 749.6749792242097, 0.0], [1264.2411176723833, 634.6089217066874, 749.6840871137404, 0.0], [1264.2411176723833, 634.5962571684444, 749.6927508062569, 0.0], [1264.2411176723833, 634.5842102870192, 749.7009919654973, 0.0], [1264.2411176723833, 634.5727509389329, 749.7088311986555, 0.0], [1264.2411176723833, 634.5618504698452, 749.7162881079041, 0.0]], [[0.0, 0.0, 1000.0, 0.0], [0.0, 24.385287749644604, 975.6147122503535, 0.0], [0.0, 47.58129098200664, 952.4187090179876, 0.0], [0.0, 69.64601178743695, 930.3539882125621, 0.0], [0.0, 90.63462346095645, 909.3653765390447, 0.0], [0.0, 110.599608464228, 889.4003915357748, 0.0], [0.0, 129.59088965915853, 870.4091103408471, 0.0], [0.0, 147.65595514073863, 852.3440448592605, 0.0], [0.0, 164.8399769823471, 835.1600230176457, 0.0], [0.0, 181.18592418934406, 818.8140758106466, 0.0], [0.0, 196.73467014397087, 803.2653298560192, 0.0], [0.0, 211.52509480993587, 788.4749051900565, 0.0], [0.0, 225.59418195306748, 774.4058180469231, 0.0], [0.0, 238.9771116194831, 761.0228883805103, 0.0], [0.0, 251.70734810420598, 748.2926518957844, 0.0], [0.0, 263.8167236293327, 736.1832763706657, 0.0], [0.0, 275.3355179411633, 724.6644820588297, 0.0], [0.0, 286.29253402535204, 713.7074659746414, 0.0], [0.0, 296.71517012936374, 703.2848298706275, 0.0], [0.0, 306.6294882723626, 693.3705117276219, 0.0], [0.0, 316.0602794138498, 683.9397205861319, 0.0], [0.0, 325.03112544395674, 674.9688745560269, 0.0], [0.0, 333.56445815046214, 666.4355418495181, 0.0], [0.0, 341.6816153099475, 658.3183846900345, 0.0], [0.0, 349.40289404334607, 650.5971059566292, 0.0], [0.0, 356.7476015693309, 643.2523984306437, 0.0], [0.0, 363.7341034824005, 636.265896517572, 0.0], [0.0, 370.3798696764458, 629.6201303235254, 0.0], [0.0, 376.70151802857896, 623.2984819713996, 0.0], [0.0, 382.71485595247776, 617.2851440475029, 0.0], [0.0, 388.43491992515703, 611.5650800748268, 0.0], [0.0, 393.8760130859939, 606.1239869139864, 0.0], [0.0, 399.0517410020348, 600.948258997945, 0.0], [0.0, 403.97504568898444, 596.0249543109958, 0.0], [0.0, 408.65823797299464, 591.3417620269867, 0.0], [0.0, 413.11302827414204, 586.8869717258339, 0.0], [0.0, 417.3505558885734, 582.6494441114049, 0.0], [0.0, 421.38141684255476, 578.6185831574171, 0.0], [0.0, 425.21569038805643, 574.7843096119121, 0.0], [0.0, 428.86296420612354, 571.1370357938449, 0.0], [0.0, 432.33235838108067, 567.6676416188881, 0.0], [0.0, 435.6325482056341, 564.367451794333, 0.0], [0.0, 438.7717858731845, 561.2282141267846, 0.0], [0.0, 441.75792111305424, 558.2420788869237, 0.0], [0.0, 444.59842081875064, 555.401579181229, 0.0], [0.0, 447.3003877190888, 552.6996122808923, 0.0], [0.0, 449.8705781387141, 550.1294218612736, 0.0], [0.0, 452.31541889242624, 547.6845811075598, 0.0], [0.0, 454.64102335557095, 545.358976644416, 0.0], [0.0, 456.85320675066214, 543.1467932493252, 0.0], [0.0, 458.9575006884586, 541.0424993115267, 0.0], [0.0, 460.95916699988487, 539.0408330001038, 0.0], [0.0, 462.86321089333927, 537.136789106647, 0.0], [0.0, 464.6743934703326, 535.3256065296537, 0.0], [0.0, 466.39724363070616, 533.6027563692702, 0.0], [0.0, 468.0360693972579, 531.9639306027153, 0.0], [0.0, 469.5949686880279, 530.4050313119418, 0.0], [0.0, 471.07783956324107, 528.9221604367306, 0.0], [0.0, 472.4883899724764, 527.5116100274931, 0.0], [0.0, 473.83014702648126, 526.1698529734878, 0.0], [0.0, 475.10646581677827, 524.8935341831955, 0.0], [0.0, 476.3205378051492, 523.6794621948196, 0.0], [0.0, 477.4753988039468, 522.5246011960201, 0.0], [0.0, 478.5739365672075, 521.4260634327542, 0.0], [0.0, 479.61889801154473, 520.3811019884156, 0.0], [0.0, 480.6128960848649, 519.3871039150878, 0.0], [0.0, 481.5584163001054, 518.4415836998478, 0.0], [0.0, 482.4578229503009, 517.5421770496563, 0.0], [0.0, 483.31336502055484, 516.6866349793986, 0.0], [0.0, 484.1271818116788, 515.8728181882801, 0.0], [0.0, 484.90130828954875, 515.098691710412, 0.0], [0.0, 485.6376801735785, 514.3623198263783, 0.0], [0.0, 486.3381387770423, 513.6618612229156, 0.0], [0.0, 487.0044356113015, 512.9955643886559, 0.0], [0.0, 487.63823676549873, 512.361763234458, 0.0], [0.0, 488.2411270726523, 511.758872927304, 0.0], [0.0, 488.81461407256256, 511.1853859273938, 0.0], [0.0, 489.3601317814449, 510.6398682185114, 0.0], [0.0, 489.87904427771895, 510.1209557222374, 0.0], [0.0, 490.3726491129159, 509.62735088704045, 0.0], [0.0, 490.842180556228, 509.15781944372833, 0.0], [0.0, 491.288812680834, 508.71118731912236, 0.0], [0.0, 491.7136622996866, 508.28633770026977, 0.0], [0.0, 492.11779175812586, 507.8822082418305, 0.0], [0.0, 492.50221159029684, 507.4977884096595, 0.0], [0.0, 492.8678830460224, 507.1321169539339, 0.0], [0.0, 493.21572049440834, 506.784279505548, 0.0], [0.0, 493.54659371025525, 506.4534062897011, 0.0], [0.0, 493.8613300489474, 506.1386699510089, 0.0], [0.0, 494.16071651526624, 505.8392834846901, 0.0], [0.0, 494.4455017313272, 505.5544982686291, 0.0], [0.0, 494.71639780851086, 505.2836021914455, 0.0], [0.0, 494.97408212810467, 505.0259178718517, 0.0], [0.0, 495.2191990351384, 504.78080096481796, 0.0], [0.0, 495.45236144955044, 504.5476385504059, 0.0], [0.0, 495.67415239882456, 504.3258476011318, 0.0], [0.0, 495.88512647586856, 504.1148735240878, 0.0], [0.0, 496.0858112257529, 503.91418877420347, 0.0], [0.0, 496.27670846488854, 503.7232915350678, 0.0], [0.0, 496.4582955358118, 503.5417044641445, 0.0], [0.0, 496.6310265007839, 503.36897349917245, 0.0], [0.0, 484.5205360137144, 503.2046667227697, 0.0], [0.0, 473.0006811172995, 503.0483732824067, 0.0], [0.0, 462.04265617387466, 502.8997023630838, 0.0], [0.0, 451.61906041328996, 502.75828221005145, 0.0], [0.0, 441.7038294167416, 502.6237591992701, 0.0], [0.0, 432.2721699421206, 502.4957969531447, 0.0], [0.0, 423.3004979280067, 502.37407549940485, 0.0], [0.0, 414.7663795212317, 502.2582904710133, 0.0], [0.0, 406.6484749805476, 502.1481523450933, 0.0], [0.0, 398.92648531617556, 502.04338571895875, 0.0], [0.0, 391.58110153175016, 501.9437286214736, 0.0], [0.0, 384.5939563417668, 501.84893185798495, 0.0], [0.0, 377.9475782438105, 501.7587583872071, 0.0], [0.0, 371.6253478306873, 501.6729827284962, 0.0], [0.0, 365.61145623326325, 501.59139039802, 0.0], [0.0, 359.89086559004437, 501.5137773724613, 0.0], [0.0, 354.44927144470245, 501.43994957882546, 0.0], [0.0, 349.2730669774716, 501.3697224091751, 0.0], [0.0, 344.34930898101794, 501.3029202590004, 0.0], [0.0, 339.66568549568257, 501.23937608813475, 0.0], [0.0, 335.2104850231556, 501.17893100305355, 0.0], [0.0, 330.97256724164396, 501.12143385955807, 0.0], [0.0, 326.94133514926494, 501.06674088484004, 0.0], [0.0, 323.1067085660125, 501.01471531797233, 0.0], [0.0, 319.4590989280547, 500.965227067947, 0.0], [0.0, 315.9893853113456, 500.91815238834903, 0.0], [0.0, 312.68889162454525, 500.8733735679697, 0.0], [0.0, 309.54936491428793, 500.83077863643143, 0.0], [0.0, 306.56295472849195, 500.7902610842157, 0.0], [0.0, 303.7221934861389, 500.75171959634287, 0.0], [0.0, 301.0199778044349, 500.7150577990129, 0.0], [0.0, 298.4495507366559, 500.6801840186359, 0.0], [0.0, 296.0044848762573, 500.6470110526008, 0.0], [0.0, 293.6786662850094, 500.6154559512088, 0.0], [0.0, 291.4662792049691, 500.5854398102726, 0.0], [0.0, 289.3617915160528, 500.5568875738062, 0.0], [0.0, 287.35994090285965, 500.5297278463405, 0.0], [0.0, 285.4557216961375, 500.5038927144146, 0.0], [0.0, 283.6443723560091, 500.479317576742, 0.0], [0.0, 281.9213635656296, 500.4559409826762, 0.0], [0.0, 280.2823869055499, 500.4337044785574, 0.0], [0.0, 278.7233440804172, 500.4125524615406, 0.0], [0.0, 277.240336671098, 500.3924320405655, 0.0], [0.0, 275.8296563865997, 500.3732929041026, 0.0], [0.0, 274.4877757914256, 500.35508719433926, 0.0], [0.0, 273.21133948513295, 500.3377693875169, 0.0], [0.0, 271.99715571208947, 500.32129618010055, 0.0], [0.0, 270.84218838042455, 500.3056263804915, 0.0], [0.0, 269.74354947020527, 500.29072080602646, 0.0], [0.0, 268.69849181190637, 1000.0, 0.0], [0.0, 286.5314895214798, 987.8006125639724, 0.0], [0.0, 303.4947616698483, 976.1961962739567, 0.0], [0.0, 319.630725273156, 965.1577340447611, 0.0], [0.0, 334.97972864526645, 954.6576239711322, 0.0], [0.0, 349.58015228955446, 944.6696103086148, 0.0], [0.0, 363.4685048701451, 935.1687178205339, 0.0], [0.0, 376.679514502624, 926.1311893268726, 0.0], [0.0, 389.24621559237477, 917.5344262989499, 0.0], [0.0, 401.20003143782793, 909.3569323513465, 0.0], [0.0, 412.57085280506493, 901.5782594897285, 0.0], [0.0, 423.3871126703025, 894.1789569802048, 0.0], [0.0, 433.6758573171411, 887.1405227123769, 0.0], [0.0, 443.4628139663714, 880.4453569344171, 0.0], [0.0, 452.77245510741346, 874.0767182445207, 0.0], [0.0, 461.62805969229777, 868.0186817286851, 0.0], [0.0, 470.05177134516543, 862.2560991401369, 0.0], [0.0, 478.06465373286926, 856.7745610208071, 0.0], [0.0, 485.68674323510317, 851.5603606701911, 0.0], [0.0, 492.93709904579214, 846.6004598714462, 0.0], [0.0, 499.83385083100615, 841.8824562890838, 0.0], [0.0, 506.3942440625692, 837.3945524566534, 0.0], [0.0, 512.6346831407145, 833.1255262769237, 0.0], [0.0, 518.5707724136415, 829.0647029608135, 0.0], [0.0, 524.2173551964968, 825.2019283348336, 0.0], [0.0, 529.5885508874188, 821.5275434503984, 0.0], [0.0, 534.6977902733655, 818.0323604313847, 0.0], [0.0, 539.5578491140861, 814.7076394996941, 0.0], [0.0, 544.1808800881759, 811.5450671212182, 0.0], [0.0, 548.5784431811014, 808.5367352177014, 0.0], [0.0, 552.7615345911826, 805.6751213924232, 0.0], [0.0, 556.7406142258238, 802.9530701202691, 0.0], [0.0, 560.5256318567115, 800.3637748551932, 0.0], [0.0, 564.126051999464, 797.9007610103462, 0.0], [0.0, 567.5508775798068, 795.5578697681689, 0.0], [0.0, 570.8086724456062, 793.3292426802196, 0.0], [0.0, 573.9075827809369, 791.2093070179226, 0.0], [0.0, 576.8553574757816, 789.1927618378961, 0.0], [0.0, 579.6593675023207, 787.2745647268288, 0.0], [0.0, 582.3266243461545, 785.4499191927887, 0.0], [0.0, 584.8637975387012, 783.7142626715346, 0.0], [0.0, 587.2772313344999, 782.0632551176926, 0.0], [0.0, 589.5729605751476, 780.4927681524083, 0.0], [0.0, 591.7567257795354, 778.998874740236, 0.0], [0.0, 593.8339874981399, 777.5778393695089, 0.0], [0.0, 595.809939967269, 776.2261087116237, 0.0], [0.0, 597.6895240973096, 774.9403027358542, 0.0], [0.0, 599.4774398276248, 773.7172062574937, 0.0], [0.0, 601.1781578788241, 772.5537608982754, 0.0], [0.0, 602.795930931911, 771.4470574387959, 0.0], [0.0, 604.3348042621612, 770.3943285439467, 0.0], [0.0, 605.7986258544757, 769.3929418431451, 0.0], [0.0, 607.1910560253004, 768.4403933480379, 0.0], [0.0, 608.5155765753454, 767.5343011912282, 0.0], [0.0, 609.7754994958985, 766.672399670366, 0.0], [0.0, 610.9739752505326, 765.8525335827, 0.0], [0.0, 612.1140006528877, 765.0726528359618, 0.0], [0.0, 613.1984263602889, 764.3308073220676, 0.0], [0.0, 614.2299640018563, 763.6251420408119, 0.0], [0.0, 615.2111929589862, 762.9538924614369, 0.0], [0.0, 616.1445668151792, 762.3153801103563, 0.0], [0.0, 617.032419491244, 761.7080083741001, 0.0], [0.0, 617.8769710813388, 761.1302585069637, 0.0], [0.0, 618.6803334043504, 760.5806858333426, 0.0], [0.0, 619.4445152845326, 760.0579161352988, 0.0], [0.0, 620.1714275746326, 759.560642216281, 0.0], [0.0, 620.8628879340065, 759.087620632475, 0.0], [0.0, 621.5206253737106, 758.6376685835323, 0.0], [0.0, 622.1462845799493, 758.2096609549616, 0.0], [0.0, 622.7414300266404, 757.8025275047604, 0.0], [0.0, 623.3075498873826, 757.4152501872302, 0.0], [0.0, 623.8460597567215, 757.0468606073524, 0.0], [0.0, 624.3583061898248, 756.6964375992973, 0.0], [0.0, 624.8455700695717, 756.3631049230091, 0.0], [0.0, 625.3090698094854, 756.0460290731874, 0.0], [0.0, 625.7499644003353, 755.7444171950303, 0.0], [0.0, 626.1693563082587, 755.4575151017583, 0.0], [0.0, 626.5682942314725, 755.1846053886832, 0.0], [0.0, 626.9477757225803, 754.9250056393732, 0.0], [0.0, 627.3087496829779, 754.6780667192344, 0.0], [0.0, 627.6521187355884, 754.443171152346, 0.0], [0.0, 627.9787414818958, 754.2197315774363, 0.0], [0.0, 628.2894346488886, 754.0071892791843, 0.0], [0.0, 628.5849751313217, 753.8050127911345, 0.0], [0.0, 628.8661019343448, 753.6126965667606, 0.0], [0.0, 629.1335180213966, 753.4297597153301, 0.0], [0.0, 629.3878920719849, 753.2557447994293, 0.0], [0.0, 629.6298601537309, 753.0902166911225, 0.0], [0.0, 629.8600273128836, 752.9327614839183, 0.0], [0.0, 630.0789690872164, 752.7829854577795, 0.0], [0.0, 630.2872329452158, 752.6405140946317, 0.0], [0.0, 630.4853396550036, 752.5049911418606, 0.0], [0.0, 630.6737845865432, 752.3760777214895, 0.0], [0.0, 630.8530389503234, 752.2534514828146, 0.0], [0.0, 631.0235509756232, 752.1368057963846, 0.0], [0.0, 631.1857470313169, 752.0258489872069, 0.0], [0.0, 631.3400326920287, 751.9203036054622, 0.0], [0.0, 631.486793752272, 751.8199057327321, 0.0], [0.0, 631.6263971911447, 751.7244043220312, 0.0], [0.0, 631.7591920899714, 751.6335605700926, 0.0], [0.0, 631.885510505153, 751.5471473202201, 0.0], [0.0, 632.0056682985323, 751.4649484942652, 0.0], [0.0, 632.1199659271789, 751.3867585523625, 0.0], [0.0, 632.2286891946981, 751.3123819789248, 0.0], [0.0, 632.3321099658916, 751.2416327937775, 0.0], [0.0, 632.4304868465468, 751.1743340871053, 0.0], [0.0, 632.5240658301145, 751.1103175770919, 0.0], [0.0, 632.6130809128039, 751.0494231891114, 0.0], [0.0, 632.697754678683, 750.991498655484, 0.0], [0.0, 632.7782988562685, 750.9363991346943, 0.0], [0.0, 632.8549148479611, 750.883986849234, 0.0], [0.0, 632.9277942336469, 750.834130741109, 0.0], [0.0, 632.9971192497501, 750.786706144059, 0.0], [0.0, 633.0630632449222, 750.7415944719053, 0.0], [0.0, 633.1257911134998, 750.6986829219653, 0.0], [0.0, 633.1854597078296, 750.6578641930168, 0.0], [0.0, 633.2422182304687, 750.6190362169648, 0.0], [0.0, 633.2962086072989, 750.5821019036487, 0.0], [0.0, 633.3475658423764, 750.5469688980537, 0.0], [0.0, 633.3964183555476, 750.513549349356, 0.0], [0.0, 633.4428883035358, 750.4817596912784, 0.0], [0.0, 633.4870918854108, 750.4515204331196, 0.0], [0.0, 633.5291396331636, 750.4227559609864, 0.0], [0.0, 633.5691366880542, 750.3953943487113, 0.0], [0.0, 633.6071830635647, 750.369367178019, 0.0], [0.0, 633.6433738954447, 750.3446093674174, 0.0], [0.0, 633.6777996796243, 750.3210590094908, 0.0], [0.0, 633.7105464985034, 750.2986572160673, 0.0], [0.0, 633.7416962361779, 750.2773479710069, 0.0], [0.0, 633.7713267832225, 750.2570779900875, 0.0], [0.0, 633.7995122314346, 750.2377965878015, 0.0], [0.0, 633.8263230591077, 750.2194555506067, 0.0], [0.0, 633.8518263072881, 750.2020090163444, 0.0], [0.0, 633.8760857473782, 750.1854133596025, 0.0], [0.0, 633.8991620406158, 750.1696270825933, 0.0], [0.0, 633.9211128897527, 750.1546107113969, 0.0], [0.0, 633.9419931833445, 750.1403266972676, 0.0], [0.0, 633.9618551330028, 750.1267393227283, 0.0], [0.0, 633.9807484039493, 750.1138146122595, 0.0], [0.0, 633.9987202391919, 750.1015202473643, 0.0], [0.0, 634.0158155776902, 750.0898254857125, 0.0], [0.0, 634.0320771666926, 750.0787010843246, 0.0], [0.0, 634.0475456686338, 750.0681192263894, 0.0], [0.0, 634.0622597628411, 750.0580534517566, 0.0], [0.0, 634.0762562421984, 750.0484785907427, 0.0], [0.0, 634.0895701052074, 750.039370701212, 0.0], [0.0, 634.1022346434504, 750.0307070086955, 0.0], [0.0, 634.1142815248755, 750.022465849455, 0.0], [0.0, 634.1257408729618, 750.0146266162968, 0.0], [0.0, 634.1366413420495, 750.0071697070482, 0.0]]]]}STEPS exit status:
     0

t, x, names output convention.

Plot the results. Please be aware that the sequence of species in the data is not necessarily the same as in Matlab's 'sbiosimulate'.


In [73]:
% plot
h1 = subplot(2,1,1);
plot(h1, t, x{1}(:,2:4));
h2 = subplot(2,1,2);
plot(h2, t, x{1}(:,6:7));
grid(h1,'on'); 
grid(h2,'on');
title(h1,'Diffusion between 2 compartments');
ylabel(h1,'Amount compartment a');
ylabel(h2,'Amount compartment b');
xlabel(h2,'Time');
legend(h1, 'x', 'y', 'z');
legend(h2, 'x', 'y');