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

Comment on terminology: parameter vs. (independent) variable t #564

Closed
hurak opened this issue Aug 27, 2020 · 3 comments
Closed

Comment on terminology: parameter vs. (independent) variable t #564

hurak opened this issue Aug 27, 2020 · 3 comments
Labels

Comments

@hurak
Copy link
Contributor

hurak commented Aug 27, 2020

Reading the docs for ODESystem, I am somewhat puzzled by the use of the term parameter for time t. In the "hello world" example

using ModelingToolkit

@parameters t σ ρ β
@variables x(t) y(t) z(t)
@derivatives D'~t

eqs = [D(x) ~ σ*(y-x),
       D(y) ~ x*-z)-y,
       D(z) ~ x*y - β*z]

de = ODESystem(eqs,t,[x,y,z],[σ,ρ,β])

the time t is defined as a parameter (using @parameter), and yet in the documentation for ODESystem(), the second input argument is named as

  • iv independent variable.

Do I understand it correctly that we use @parameters for true "physical" parameters (such as σ, ρ, β that do not change during simulation) AND the independent variable (perhaps mostly time t in ODEs), and we use @variables for the dependent variables (functions of the independent variable)?

EDIT: Now I see that the independent variable (time) t is cast as a variable in the section on Derivatives.

@variables t
@derivatives D'~t

This is indeed somewhat confusing. Many thanks for clarification.

@ChrisRackauckas
Copy link
Member

t can be a variable. It's just for the automated system definition, i.e. de = ODESystem(eqs), and could possibly be removed since it's one of the archaic things that hasn't really added much value in any recent versions.

@ChrisRackauckas ChrisRackauckas added enhancement New feature or request good first issue Good for newcomers labels Mar 11, 2021
@ChrisRackauckas
Copy link
Member

using ModelingToolkit

@variables t x(t) y(t) z(t)
@parameters σ ρ β
@derivatives D'~t

eqs = [D(x) ~ σ*(y-x),
       D(y) ~ x*-z)-y,
       D(z) ~ x*y - β*z]

de = ODESystem(eqs)

Works, so I'll call this a documentation issue. We should probably just move it over as I agree it's a bit confusing.

@ChrisRackauckas
Copy link
Member

Just use using ModelingToolkit: t_nounits as t, D_nounits as D

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