diff --git a/src/macros.jl b/src/macros.jl index 7f3c3a2d..6978fa00 100644 --- a/src/macros.jl +++ b/src/macros.jl @@ -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 @@ -900,6 +905,8 @@ macro system(expr...) end end + + """ ivp(expr...)