Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » sbml-discuss » encoding a maximum function for t<=t0
Show: Today's Posts  :: Message Navigator
| Subscribe to topic 
Return to the default flat view Create a new topic Submit Reply
AuthorTopic
myers


Posts: 140
Location:
University of Utah
Registered:
May 2008
Re: encoding a maximum function for t<=t0 18 May '11 11:58 Go to previous messageGo to previous message

I thought about this solution, and it general it may be fine.
However, if x is not updated continuously but rather discretely, this
is a very expensive solution as it forces time to go at this minimum
increment. When x is updated discretely such as with events or
stochastic reactions, my solution would only fire the event as
needed. So, I guess it depends on your exact goal.

Cheers,

Chris

On May 18, 2011, at 12:15 PM, Frank T. Bergmann wrote:

> There is a cheaper way of calculating the maximum, that also gets
> around the
> circular restriction on assignment rule. The basic idea is to have
> one event
> fire constantly (say every couple of ms) and there you would do your
> assignment. This trigger function is way easier to find (as the
> rootfinder
> does no longer have to search for the single root at which a != b).
>
> I'll attach a sample model:
>
> p = defn simple_model
>
> x = sin(time)*time/10;
>
> event_0000001: at(geq(time-last,0.01)): xmax =
> piecewise(x,gt(x,xmax),xmax),
> last = time;
>
> end;
>
> p.x = 0;
> p.last = 0;
> p.xmax = 0;
>
>
> I've tested it with RoadRunner and COPASI and all is well with this
> one.
>
> Cheers
> Frank
>
>> -----Original Message-----
>> From: sbml-discuss-bounces@caltech.edu [mailto:sbml-discuss-
>> bounces@caltech.edu] On Behalf Of Sven Sahle
>> Sent: Wednesday, May 18, 2011 10:55 AM
>> To: SBML Discussion List
>> Subject: Re: [sbml-discuss] encoding a maximum function for t<=t0
>>
>> Hi,
>>
>> I can confirm that COPASI does not support this use of events. I'm
>> just
> not sure
>> what a simulator actually should do with this model. My best guess
>> would
> be
>> that the simulator should stop at the first time x gets larger than
>> xmax.
>>
>> Sven
>>
>> Am 18.05.2011 um 18:29 schrieb schubert@ebi.ac.uk:
>>
>>> Thank you for the suggestion.
>>>
>>> I have implemented an example in L2V4 [1] but I couldn't get it to
>>> work in Copasi [2] so far - the event should fire at least at t=6.25
>>> but doesn't
>>> (L2V4 doesn't support initialValues for triggers but it should be
>>> fine
>>> as well as xmax and next_xmax are equal in the beginning).
>>>
>>> [1] http://pastebin.com/YguQ7AAQ
>>> [2] http://imageshack.us/photo/my-images/16/screenshotxbf.png/
>>>
>>>> Hi,
>>>>
>>>> Encoding max/min is NOT the problem as this is easy to do with
>>>> existing mathML subset just as he points out below:
>>>>
>>>> max(x,y) = piecewise(x,gt(x,y),y)
>>>> min(x,y) = piecewise(x,lt(x,y),y)
>>>>
>>>> If you like to use those functions, then simply add those to your
>>>> list of functions.
>>>>
>>>> The actual problem is the desire to create a function that
>>>> updates a
>>>> variable based on the variables value. Since assignment rules are
>>>> evaluated continuously, this usually will not make sense as your
>>>> simulator would simply halt continuously updating its value. For
>>>> example, what if you said: x := x + 1.
>>>>
>>>> In the case mentioned, the value reaches a fix point, so in some
>>>> sense it is okay assuming that x and xmax are defined initially.
>>>> To
>>>> avoid the problem getting into an infinite update loop, SBML simply
>>>> disallows all cycles whether or not they could reach a fix point.
>>>> The
>>>> only way I see that this can currently be encoded is to use an
>>>> event
>>>> to update it. For example:
>>>>
>>>> Rule:
>>>> nextXmax := piecewise(x,gt(x,xmax),xmax)
>>>>
>>>> Event:
>>>> Trigger: neq(xmax,nextXmax)
>>>> Trigger initially true: false
>>>> Assignment: xmax:extXmax
>>>>
>>>> I tried this, and it seems to work.
>>>>
>>>> Cheers,
>>>>
>>>> Chris
>>>>
>>>>
>>>> On May 18, 2011, at 8:39 AM, Nicolas Le Novère wrote:
>>>>
>>>>> Hello all,
>>>>>
>>>>> Just to mention that we need the min/max functions in SED-ML as
>>>>> well. I thought it was there but it is not. And as a result SED-ML
>>>>> cannot encode one of the examples present in the MIASE paper ...
>>>>>
>>>>> So I would vote to include min and max to the next version of the
>>>>> core (or in the extended math package, if this is still planned)
>>>>>
>>>>> Cheers
>>>>>
>>>>> On 18/05/11 09:51, schubert@ebi.ac.uk wrote:
>>>>>> Dear all,
>>>>>>
>>>>>> A model I'm trying to encode is using the function
>>>>>> max*(x,t0) = max(x,t<=t0)
>>>>>> where x is a variable, t the time and t0 the current time.
>>>>>>
>>>>>> Is there a way to encode this in SBML? The most natural way to do
>>>>>> it would be a xmax = piecewise(x,gt(x,xmax),xmax) but that is
>>>>>> rejected as circular assignment (also when xmax has an initial
>>>>>> value, i.e. the expression itself would be mathematically valid).
>>>>>>
>>>>>> Alternatively, is there a reason this is prohibited entirely
>>>>>> instead of checking whether xmax has an initial value?
>>>>>>
>>>>>> Regards,
>>>>>> Michael
>>>>>>
>>>>>> ____________________________________________________________
>>>>>> To manage your sbml-discuss list subscription, visit
>>>>>> https://utils.its.caltech.edu/mailman/listinfo/sbml-discuss
>>>>>>
>>>>>> For a web interface to the sbml-discuss mailing list, visit
>>>>>> http://sbml.org/Forums/
>>>>>>
>>>>>> For questions or feedback about the sbml-discuss list, contact
>>>>>> sbml-team@caltech.edu
>>>>>
>>>>>
>>>>> --
>>>>> Nicolas LE NOVERE, Computational Systems Neurobiology, EMBL-EBI,
>>>>> WTGC, Hinxton CB101SD UK, Mob:+447833147074, Tel:+441223494521
>>>>> Fax:468, Skype:n.lenovere, AIM:nlenovere, twitter:@lenovere
>>>>> http://www.ebi.ac.uk/~lenov/, http://www.ebi.ac.uk/compneur/
>>>>>
>>>>> ____________________________________________________________
>>>>> To manage your sbml-discuss list subscription, visit
>>>>> https://utils.its.caltech.edu/mailman/listinfo/sbml-discuss
>>>>>
>>>>> For a web interface to the sbml-discuss mailing list, visit
>>>>> http://sbml.org/Forums/
>>>>>
>>>>> For questions or feedback about the sbml-discuss list, contact
>>>>> sbml-team@caltech.edu
>>>>
>>>> ____________________________________________________________
>>>> To manage your sbml-discuss list subscription, visit
>>>> https://utils.its.caltech.edu/mailman/listinfo/sbml-discuss
>>>>
>>>> For a web interface to the sbml-discuss mailing list, visit
>>>> http://sbml.org/Forums/
>>>>
>>>> For questions or feedback about the sbml-discuss list, contact
>>>> sbml-team@caltech.edu
>>>>
>>>
>>>
>>> ____________________________________________________________
>>> To manage your sbml-discuss list subscription, visit
>>> https://utils.its.caltech.edu/mailman/listinfo/sbml-discuss
>>>
>>> For a web interface to the sbml-discuss mailing list, visit
>>> http://sbml.org/Forums/
>>>
>>> For questions or feedback about the sbml-discuss list, contact
>>> sbml-team@caltech.edu
>>
>> Dr. Sven Sahle
>> Abteilung Modellierung biologischer Prozesse Universität Heidelberg,
>> BIOQUANT/Zoologie
>>
>>
>>
>> ____________________________________________________________
>> To manage your sbml-discuss list subscription, visit
>> https://utils.its.caltech.edu/mailman/listinfo/sbml-discuss
>>
>> For a web interface to the sbml-discuss mailing list, visit
>> http://sbml.org/Forums/
>>
>> For questions or feedback about the sbml-discuss list, contact sbml-
>> team@caltech.edu
> <
> simple_max
> .xml>____________________________________________________________
> To manage your sbml-discuss list subscription, visit
> https://utils.its.caltech.edu/mailman/listinfo/sbml-discuss
>
> For a web interface to the sbml-discuss mailing list, visit
> http://sbml.org/Forums/
>
> For questions or feedback about the sbml-discuss list,
> contact sbml-team@caltech.edu

____________________________________________________________
To manage your sbml-discuss list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-discuss

For a web interface to the sbml-discuss mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-discuss list,
contact sbml-team@caltech.edu

      

SubjectPosterDate
Read Message   encoding a maximum function for t<=t0 schubert18 May '11 01:51
Read Message   Re: encoding a maximum function for t<=t0 Nicolas Le Novere18 May '11 07:39
Read Message   Re: encoding a maximum function for t<=t0 myers18 May '11 08:31
Read Message   Re: encoding a maximum function for t<=t0 Sven Sahle18 May '11 08:47
Read Message   Re: encoding a maximum function for t<=t0 myers18 May '11 08:55
Read Message   Re: encoding a maximum function for t<=t0 kieransmallbone18 May '11 09:21
Read Message   Re: encoding a maximum function for t<=t0 Nicolas Le Novere18 May '11 09:25
Read Message   Re: encoding a maximum function for t<=t0 myers18 May '11 09:31
Read Message   Re: encoding a maximum function for t<=t0 schubert18 May '11 09:29
Read Message   Re: encoding a maximum function for t<=t0 myers18 May '11 10:12
Read Message   Re: encoding a maximum function for t<=t0 Sven Sahle18 May '11 10:55
Read Message   Re: encoding a maximum function for t<=t0 fbergman18 May '11 11:15
Read Message   Re: encoding a maximum function for t<=t0  myers18 May '11 11:58
Read Message   Re: encoding a maximum function for t<=t0 Stefan.Hoops18 May '11 13:17
Read Message   Re: encoding a maximum function for t<=t0 Lucian Smith18 May '11 12:15
Read Message   Re: encoding a maximum function for t<=t0 Sven Sahle18 May '11 08:41
Read Message   Re: encoding a maximum function for t<=t0 Nicolas Le Novere18 May '11 09:33
Previous Topic:About the upcoming votes on L3 package proposals
Next Topic:Re: [SED-ML-discuss] encoding a maximum function for t<=t0
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.