Zhenhong Li | 14 Apr 21:26
Picon

Fwd: questions about MCSim


Hello,

I am a PhD student at Oregon Health & Science University. I am using MCSim to do my modeling work for hormone
profiles in Fathead Minnows. The question I would like to ask is about "vectors". 

According to MCSim manual, vectors should be defined as <variable-name>'['<integer>']'. Can I define
the <integer> as a variable? I mean, for example, I would like to use a 'n' to replace the <integer>; then in
the first run, I define n=10 (the vector has a length of 10), and in the second run I define n=7 (the vector has
a length of 7), as so on. Then, for different runs, the length of the vector varies.

I tried several times, it seems that the present program does not accept it. Would you please give me any
suggestion? Can I modify the program a little bit to add this function in? and how? Thank you very much!

Best!

Cindy
Frédéric BOIS | 15 Apr 16:08
Picon
Favicon

Re: Fwd: questions about MCSim

Dear Cindy,

I actually love the [] syntax, it's one of my most brilliant ideas. That being said, it is also half-baked and
imperfect. In particular you should be aware
of the fact that you will NOT be able to use the vector syntax in your input files... Some of my collaborators
asked me when I will finish that, and I
had to explain to them that it was a large task. But to answer specifically your questions:
The first (sad) answer is no: you cannot dynamically change the size of an array defined in MCSim.
Alternatives may exist: 
- Can you work with a maximum length vector and use only part of it in various runs ? (that would assume a
particular structure 
  for your system) You could combine that with conditional statements for the computation of  the
derivatives (for example
  dt(Y[1-20]) = (n < 10 ? a*Y[i-1] - b*Y[i] : 0);
  That's somewhat wasteful, but not too much, because null derivative states take no time to integrate.
- If you really feel like programming, you can indeed change the code, it's free for all. But honestly, you
would be stretching quite far the syntax
  and the code, and I don't even have an idea where you would start, because there is no connection between run
time inputs (defined in input files)
  and the precompilation model definition files. You would have to define a mechanism to define dynamic
allocation of space and on the fly ODE
  rewriting... sounds impractical to me. You may want to look at a way (scripting) to generate automatically
the model files and a template input file,
  recompile the model on the fly and run it. That's would be a way (but slow). Actually, if you are in mood for
programming, the best use of your time
  would be to change the mcsim/sim codes to allow the bracket syntax in input files...
- You may also want to look at the latest capability of the code: to use a collection of separate SBML files and
a template transport model to generate
  automatically a global model (but still, that would be slow if you wanted to run 1000 different models...).
I haven't explored everything it can be used 
(Continue reading)


Gmane