Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can resets change variables of integration? #327

Open
kerimoyle opened this issue Apr 27, 2020 · 16 comments
Open

Can resets change variables of integration? #327

kerimoyle opened this issue Apr 27, 2020 · 16 comments
Labels

Comments

@kerimoyle
Copy link
Collaborator

In the introduction page we say:
image

... but later on we use the terms (x', t', p') to describe the new state after reset. I wouldn't have thought that t could change? so should be (x', t, p') instead?
See here for an example: https://cellml-specification-dev.readthedocs.io/en/i324_examples_chapter/reference/examples/resets/reset_example_3_orderofevaluation.html

@MichaelClerx
Copy link
Contributor

yeah. should be (x', t, p) even

@kerimoyle
Copy link
Collaborator Author

Hmm ... we need to make it clearer that values of p can't change then. At the moment the reading I got (from elsewhere, not the intro page) was that they were the set of non-integrated variables, but that resets could change them... I guess 2. says not though.

@MichaelClerx
Copy link
Contributor

I only changed it last week to have that big preamble defining x, t, an p, so it's not really clear throughout the doc yet

@MichaelClerx
Copy link
Contributor

MichaelClerx commented Apr 27, 2020

and the document might be inconsistent at some points, because I used to think p could change! But then changed it so that x is all variables that are either defined through a derivative, or with an initial condition but no "eternal truth". Otherwise it wouldn't make sense to say "x = 1" AND a reset can set it to 12. We can only say "x[0] = 1 AND a reset can set it to 12"

But that was quite a late realisation!

@kerimoyle
Copy link
Collaborator Author

OK, I'll keep an eye out... though I wonder whether it's actually needed to define them like this? You've used the terminology in a few of the examples at the beginning, but then just say "system values don't change" or something like that in the later ones? Do you have a preference for which is used where, or is there a reason for the change?

@MichaelClerx
Copy link
Contributor

Just trying to clarify

@kerimoyle
Copy link
Collaborator Author

But is it an eternal truth to say A = B and then reset the value of B or A? Or are we totally forbidding changes to non-integrated variables?

@kerimoyle
Copy link
Collaborator Author

Hmmm ... thinking about it again, what about this:

dx/dt = 1
a = x
reset x -> 3 at x = 3

.. so in this example x = [x], p = [a], but the reset changes x, so the value of a changes too ... so does this mean that p has changed? in which case we need to keep the p' notation?

@MichaelClerx
Copy link
Contributor

But is it an eternal truth to say A = B and then reset the value of B or A? Or are we totally forbidding changes to non-integrated variables?

Not non-integrated variables. The set x is all variables with an initial condition, but without a statement like y = 3

@MichaelClerx
Copy link
Contributor

So if A = B then that holds forever, and you can't change A to not be equal to B. You might update A or B if they're otherwise free, but changing A would change B and vice versa

@MichaelClerx
Copy link
Contributor

Hmmm ... thinking about it again, what about this:

dx/dt = 1
a = x
reset x -> 3 at x = 3

.. so in this example x = [x], p = [a], but the reset changes x, so the value of a changes too ... so does this mean that p has changed? in which case we need to keep the p' notation?

Here x is in the set of state variables x (it defines part of the state of the model)
And a is in the set of derived variables g (its derived from x)

@MichaelClerx
Copy link
Contributor

t: Free variables, not set by the model in any way
x: States, are defined at some initial condition
p: Things that are eternally constant (including parameters, for the sake of this argument)
g: things that depend on t, x, p but are not in x themselves

@kerimoyle
Copy link
Collaborator Author

maybe we should call x: anything that you want to reset ... and then say that it must be defined with an initial condition?

@kerimoyle
Copy link
Collaborator Author

And this bit should be changed to just x now too?
image

@kerimoyle
Copy link
Collaborator Author

So if A = B then that holds forever, and you can't change A to not be equal to B. You might update A or B if they're otherwise free, but changing A would change B and vice versa

So A = B in the reset is only an assignment, not an eternal truth? As in this example:
https://cellml-specification-dev.readthedocs.io/en/i324_examples_chapter/reference/examples/resets/reset_example_3_orderofevaluation.html

@MichaelClerx
Copy link
Contributor

Not sure! I think of them as changes to apply, not eternal truths. Maybe we can come up with an example where it matters?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants