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

WIP - Parse second order systems #225

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,13 @@ ConstrainedBlackBoxControlDiscreteSystem{typeof(f),BallInf{Float64,Array{Float64
macro system(expr...)
try
dyn_eq, AT, constr, state, input, noise, dim, x0 = _parse_system(expr)
sys_type, var_names = _get_system_type(dyn_eq, AT, constr, state, input, noise, dim)
sys = Expr(:call, :($sys_type), :($(var_names...)))
if @capture(expr[1], (M_*x_'' + C_*x_' + K_*x_ = 0))
variableNames = :(M, C, K)
sys = Expr(:call, SecondOrderLinearContinuousSystem, :($variableNames...))
else
sys_type, var_names = _get_system_type(dyn_eq, AT, constr, state, input, noise, dim)
sys = Expr(:call, :($sys_type), :($(var_names...)))
end
if x0 == nothing
return esc(sys)
else
Expand All @@ -900,6 +905,8 @@ macro system(expr...)
end
end



"""
ivp(expr...)

Expand Down