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

Update to use ModelingToolkit #79

Merged
merged 16 commits into from
May 2, 2021
Merged

Update to use ModelingToolkit #79

merged 16 commits into from
May 2, 2021

Conversation

tshort
Copy link
Owner

@tshort tshort commented Apr 12, 2021

No description provided.

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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@variables x(t) y(t)
@variables x(t) y(t) = 1.0

can be allowed now that there's the metadata @YingboMa?

Copy link
Owner Author

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.

Copy link
Owner Author

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.

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

@tshort tshort changed the title WIP: Update to use ModelingToolkit Update to use ModelingToolkit May 2, 2021
@tshort tshort merged commit 227ee63 into master May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants