I tried this on a simpler RC filter circuit:
using ModelingToolkitStandardLibrary.Electrical
using ModelingToolkit, Plots
using ControlSystems
using ModelingToolkit: t_nounits as t
R = 1.0
C = 1.0
V = 1.0
@named resistor = Resistor(R = R)
@named capacitor = Capacitor(C = C, v = 0.0)
@named ground = Ground()
@named filter_input = Voltage()
@named filter_output = Voltage()
#= input ---- [resistor] -----|---------- output
_________
capacitor
---------
|
ground
=#
filt_ckt = [connect(filter_input.p, resistor.p)
connect(resistor.n, capacitor.p)
connect(capacitor.n, ground.g)
connect(capacitor.p, filter_output.p)
]
@named filt_ckt = ODESystem(filt_ckt, t,
systems = [resistor, capacitor, filter_input, filter_output, ground])
linearize(filt_ckt, [filter_input.v],[filter_output.v])
linearize
errored out:
julia> linearize(filt_ckt, [filter_input.v],[filter_output.v])
ERROR: Some parameters are missing from the variable map.
Please provide a value or default for the following variables:
Any[filter_input₊v(t)]
Stacktrace:
[1] ModelingToolkit.MTKParameters(sys::ODESystem, p::Dict{…}, u0::Dict{…}; tofloat::Bool, use_union::Bool, eval_expression::Bool, eval_module::Module)
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/7em8Z/src/systems/parameter_buffer.jl:91
[2] linearization_function(sys::ODESystem, inputs::Vector{…}, outputs::Vector{…}; simplify::Bool, initialize::Bool, op::Dict{…}, p::SciMLBase.NullParameters, zero_dummy_der::Bool, initialization_solver_alg::NonlinearSolve.GeneralizedFirstOrderAlgorithm{…}, eval_expression::Bool, eval_module::Module, warn_initialize_determined::Bool, kwargs::@Kwargs{})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/7em8Z/src/systems/abstractsystem.jl:2027
[3] linearization_function
@ ~/.julia/packages/ModelingToolkit/7em8Z/src/systems/abstractsystem.jl:1978 [inlined]
[4] linearize(sys::ODESystem, inputs::Vector{…}, outputs::Vector{…}; op::Dict{…}, t::Float64, allow_input_derivatives::Bool, zero_dummy_der::Bool, kwargs::@Kwargs{})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/7em8Z/src/systems/abstractsystem.jl:2429
[5] linearize(sys::ODESystem, inputs::Vector{Num}, outputs::Vector{Num})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/7em8Z/src/systems/abstractsystem.jl:2425
[6] top-level scope
@ ~/pcb123/new_receiver/Notebooks/power_emi_filter.jl:35
Some type information was truncated. Use `show(err)` to see complete types.