I’m trying to extract the state space of a filter containing an op-amp and I’m consistently getting a state space that is equivalent in offset but with a smaller amplitude. I used the state_space_matrices example to set up the script to get the A, B, C, D matrices. I copied these and corrected their syntax to paste into their appropriate fields in the State Space block. I separated the pre-filter and extracted its state space matrices to verify I was extracting the state space correctly, as well as to verify the error stems from the Op-Amp portion of the physical circuit.
The first thing I find odd is the inclusion of “VAMCin” and “VAMCout” in the state space. Especially since the Op-Amp block has a similar internal setup. I would’ve expected these blocks to be omitted the same as the Op-Amp internals.
The second thing I find odd is the gain block “AMC1301” is ignored by plecs('get', modelName, 'Topology'). The state space blocks required the gain block to be included externally, where I would’ve expected the gain to be incorporated into the matrix element values.
I’ve attached the schematic for reference. There are three systems being compared:
- The physical circuit, which is isolated using “VAMCin”, “AMC1301”, and “VAMCout”.
- The state space block “Full State Space” which contains the topology output, starting from controlled voltage source “V” and ending at voltmeter “Vo”. The output state for “VAMCin” is looped back through “AMC1301” to the input state for “VAMCout”.
- Two state space blocks “Pre-Amp” and “OpAmp” which was made by extracting the topology of the isolated circuit elements separately. “Pre-Amp” passes through “AMC1301” before arriving to “OpAmp”.
- Both (2) and (3) use the constant block “[Vos Vref]” which contains the values of the constant voltage sources “Vos” and “Vref” respectively. These fill the additional inputs of the extracted state spaces.
What am I doing wrong? Should I be adjusting my script in some way? Should I be approaching this extraction differently with my schematic layout?
Voltmeter Van_TF Extract.plecs (62.6 KB)