Prev: Slider not moving, any suggestions?
Next: Help!! Error -----> le Matrix dimensions do not match
From: Bernard on 7 Apr 2010 16:30 I am using SimBiology 3.1 for pharmacokinetic-pharmacodynamic modeling. I generate the models either within the SimBiology environment or programatically within a MATLAB script. My current model works well when the drug concentration vs. response relationship uses a standard Henri-Michaelis-Menten KineticLaw (for a simple Emax model). However, I also want to model systems in which the response is not strictly hyperbolic and so require a Hill slope. SimBiology has a built in KineticLaw for this (Hill-Kinetics) but I am having trouble with it and I can find no working examples with this. I have DimensionalAnalysis and UnitConversion active. SimBiology requests units for Hill slope ('n') but this should be dimensionless, so I used a fake unit of micromole/micromole to allow it to pass the dimension check. SimBiology also appears to insist that the Hill slope is an integer. This really limits its usefulness as many/most real world Hill slopes are non-integer. I tried to enter the value as e.g. 2 or uint(2) or int(2) (where uint and int are uint8, 16, 32 or 64) but no luck. Can someone give me a working example where Hill-Kinetics is used? Is the limitation within the SimBiology desktop? (I think the desktop automatically converts the value to a double) so do I need to generate it in a script?) Is it possible to use a non-integer slope value? I am mainly interested in simulation rather than fitting/modeling so I would not be trying to fit this parameter. Thanks for any advice.
From: Arthur Goldsipe on 9 Apr 2010 14:09 "Bernard " <bernard.murray(a)gilead.com> wrote in message <hpiq1d$33b$1(a)fred.mathworks.com>... > I am using SimBiology 3.1 for pharmacokinetic-pharmacodynamic modeling. I generate the models either within the SimBiology environment or programatically within a MATLAB script. My current model works well when the drug concentration vs. response relationship uses a standard Henri-Michaelis-Menten KineticLaw (for a simple Emax model). However, I also want to model systems in which the response is not strictly hyperbolic and so require a Hill slope. SimBiology has a built in KineticLaw for this (Hill-Kinetics) but I am having trouble with it and I can find no working examples with this. I have DimensionalAnalysis and UnitConversion active. SimBiology requests units for Hill slope ('n') but this should be dimensionless, so I used a fake unit of micromole/micromole to allow it to pass the dimension check. SimBiology also appears to insist that the Hill slope is an integer. This really > limits its usefulness as many/most real world Hill slopes are non-integer. I tried to enter the value as e.g. 2 or uint(2) or int(2) (where uint and int are uint8, 16, 32 or 64) but no luck. Can someone give me a working example where Hill-Kinetics is used? Is the limitation within the SimBiology desktop? (I think the desktop automatically converts the value to a double) so do I need to generate it in a script?) Is it possible to use a non-integer slope value? I am mainly interested in simulation rather than fitting/modeling so I would not be trying to fit this parameter. > Thanks for any advice. Bernard is bumping up against some current limitations with dimensional analysis and unit conversion in SimBiology. I've sent him a model that shows a couple of workarounds, but I wanted to describe the issues and workarounds here in case anyone else encounters similar problems. SimBiology's dimensional analysis should fully support the arithmetic operations +, -, *, and /. The case of ^ is a bit trickier to handle, because of the possibility of generating units raised to fractional powers. In this case, SimBiology explicitly disallows fractional exponents and will error if you try to simulate a model containing such expressions. SimBiology is also currently unable to do dimensional analysis on expressions that involve other arbitrary functions (including sin, exp, log, or any user-defined function). However, when SimBiology encounters such an expression, it will warn the user but will continue to simulate. This provides a couple of possible workarounds for implementing Hill kinetics while enabling dimensional analysis and unit conversion on parts of the model. For both options, create a MATLAB function in a file, such as HillFactor.m that is defined something like this: function factor = HillFactor(K, S, n) % Note: in this implementation, K and S must have dimensionally consistent units, % and n must be dimensionless. factor = S^n / (K^n + S^n); Option 1: Create a reaction with the rate set to something like "V1*HillFactor(K1, S1, n1)". You will receive a warning that this rate expression will not be checked for dimensional consistency, but you be able to simulate. However, you are then responsible for ensuring that V1 has the appropriate units. Option 2: Create a non-constant parameter "factor" with dimensionless units (such as "second/second") and assign it the following value via a repeatedAssignment rule: "factor1 = HillFactor(K1, S1, n1)". Then, create a reaction with the rate set to "V1*factor1". Although SimBiology will not do dimensional analysis on the repeatedAssignment rule, it will do dimension analysis on the rate and ensure that V1 has the correct units. -Arthur
From: Bernard on 9 Apr 2010 16:46 "Arthur Goldsipe" <REMOVE.Arthur.Goldsipe(a)REMOVE.mathworks.com> wrote in message <hpnqg2$gn5$1(a)fred.mathworks.com>... [snip] > For both options, create a MATLAB function in a file, such as HillFactor.m that is defined something like this: > > function factor = HillFactor(K, S, n) > % Note: in this implementation, K and S must have dimensionally consistent units, > % and n must be dimensionless. > factor = S^n / (K^n + S^n); > > Option 1: Create a reaction with the rate set to something like "V1*HillFactor(K1, S1, n1)". You will receive a warning that this rate expression will not be checked for dimensional consistency, but you be able to simulate. However, you are then responsible for ensuring that V1 has the appropriate units. > > Option 2: Create a non-constant parameter "factor" with dimensionless units (such as "second/second") and assign it the following value via a repeatedAssignment rule: "factor1 = HillFactor(K1, S1, n1)". Then, create a reaction with the rate set to "V1*factor1". Although SimBiology will not do dimensional analysis on the repeatedAssignment rule, it will do dimension analysis on the rate and ensure that V1 has the correct units. > > -Arthur Arthur, thank you very much. Both those options work well and allow me to continue to use DimensionalAnalysis and UnitConversion. The Hill slope doesn't have to be an integer which is great. Your reply also alerted me to the fact that you can use an external m-code user function in a SimBiology model (while being careful about dimensions and units). I wasn't aware of this (although it is mentioned in the User Guide) and it is a nice option if Rules-based functions are too restricting. Thanks very much for your prompt and helpful reply. Bernard
|
Pages: 1 Prev: Slider not moving, any suggestions? Next: Help!! Error -----> le Matrix dimensions do not match |