I looking for to generate the pulses (similar to binary pattern ex.011010)over a certain time interval.

3 views (last 30 days)
I am thinking do this by releasing certain fix number of molecules generated over a period of time repeatedly by a species object.For example if I need to send a 1 bit information, species object will release 100 molecules for 0.1 sec and to send 0 bit information species object doesn't release any molecules for 0.1 sec and to send again a 1 bit information species object will release 100 molecules for 0.1 sec and so on repeatedly depends on the information I am interested send (ex. 011010). Please share your knowledge and experiences if someone familiar with this sort of a modeling. How can I get this pattern using simbiology? Do I have to use the compartment object for this purpose? Can I use pulse generation for this purpose. I am new to simbiology still I am at learning stage. I would be very grateful if someone could help me with how to generate this pulses using simbiology.

Answers (2)

Arthur Goldsipe
Arthur Goldsipe on 7 Mar 2015
Hi,
I see two different ways to interpret your question. I'll try to show you how to implement solutions for both from the MATLAB command line. You can also build the same models using the graphical interface of the SimBiology Desktop.
Interpretation 1: You want to repeatedly add molecules to your system at a fix rate (let's say you add 4 moles at a rate of 2 moles per second). This means that the rate of addition is either 0 or 1, but the total number of molecules is accumulating. This can be accomplished using an infusion or rate-based dose. Here's an example:
model = sbiomodel('dosing');
compartment = model.addcompartment('cell');
species = compartment.addspecies('species');
dose = model.adddose('dose', 'schedule');
dose.TargetName = 'species';
dose.Time = [1 4 7];
dose.Amount = [4 4 4];
dose.Rate = [2 2 2];
dose.Active = true;
sd = sbiosimulate(model);
sbioplot(sd);
Interpretation 2: You want a species or parameter in your model to alternative between values of 0 and 1 at specified times. The most straightforward way to do that is to create an event for each change in value. Here's an example:
model = sbiomodel('Pulse signal');
parameter = model.addparameter('pulse');
parameter.ConstantValue = false;
model.addevent('time > 1', 'pulse = 1');
model.addevent('time > 3', 'pulse = 0');
model.addevent('time > 4', 'pulse = 1');
model.addevent('time > 8', 'pulse = 0');
sd = sbiosimulate(model);
sbioplot(sd);
If you have many pulses, this approach can be quite tedious. It can also make the simulations inefficient. Here's an alternative that requires you to write a helper function in a separate file. Let's call that file nextPulseTime.m and set the contents to the following:
function nextTime = nextPulseTime(time)
pulseTimes = [1 3 4 8 10];
nextTimeIndex = find(pulseTimes > time, 1);
nextTime = pulseTimes(nextTimeIndex);
And create your model as follows:
model = sbiomodel('Pulse signal');
pulse = model.addparameter('pulse');
pulse.ConstantValue = false;
nextTime = model.addparameter('nextTime');
nextTime.ConstantValue = false;
model.addrule('nextTime = nextPulseTime(0)', 'initialAssignment');
model.addevent('time > nextTime', {'pulse = (1-pulse)', 'nextTime = nextPulseTime(time)'});
sd = sbiosimulate(model);
sbioplot(sd);

zahmeeth sakkaff
zahmeeth sakkaff on 8 Mar 2015
Thank you Goldsipe! Its wonderful. Do you think can I have the .sbproj format of these models

Categories

Find more on Simulate Responses to Biological Variability and Doses in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!