-
Notifications
You must be signed in to change notification settings - Fork 19
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
Update to use ModelingToolkit #79
Conversation
README.md
Outdated
|
||
The Van Der Pol oscillator is a simple problem with two equations | ||
and two unknowns: | ||
|
||
``` julia | ||
function Vanderpol() | ||
y = Unknown(1.0, "y") # The 1.0 is the initial value. "y" is for plotting. | ||
x = Unknown("x") # The initial value is zero if not given. | ||
@variables x(t) y(t) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@variables x(t) y(t) | |
@variables x(t) y(t) = 1.0 |
can be allowed now that there's the metadata @YingboMa?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. A knew metadata was coming, but I haven't seen examples. Initial values in variables would be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any hints on how to programatically create a variable that has an initial value? I am currently using Num(Variable{ModelingToolkit.FnType{Tuple{Any},Real}}(gensym("i")))(t)
, and I also see setmetadata
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to allow interpolating into the macros, i.e . x = @variables $y = 1.0
No description provided.