I need to integrate the simulation of a circuit in a MATLAB optimization algorithm. The optimization operates on the value of an inductor, changing it before running the simulation. However, this value is also used inside the initialization script to compute several other components values.
If I set it via ModelVars the initialization script fails. I understand this is because ModelVars are evaluated AFTER the initialization scripts.
Is there any other way to set such variable BEFORE the initialization script?
Thank you!!