nickerso / flattenCellML

Code to flatten CellML 1.1 models into 1.0 models
1 stars 1 forks source link

Algebraic initial values #5

Open nickerso opened 10 years ago

nickerso commented 10 years ago

Currently, the model compactor code will only handle initial_value attributes with variable name values if the named variable eventually resolves into a variable with a numerical initial_value attribute. It would be a fairly simple extension to correctly interpret initial value variables with simple equations (x = 2).

Ideally, we could interpret algebraic expressions to try and determine numerical initial_value's for differential equation variables. But we need to do this independently of CCGS.

nickerso commented 10 years ago

6f60c375 starts to handle the case when a variable used in an initial_value attribute resolves to a simple numerical assignment. Still need to look into other cases...

jonc125 commented 10 years ago

Fully solving this problem probably requires something like the partial evaluation available in PyCml!

nickerso commented 10 years ago

Thanks Jonathan. A direct link to the code would be helpful.

jonc125 commented 10 years ago

The main driver code is at https://chaste.cs.ox.ac.uk/trac/browser/trunk/python/pycml/optimize.py#L241, although it makes use of a lot of other bits in that folder.