Hi
I am trying to run a model using PLECS blockset using the sim command in a script. The model runs just fine by pressing the run button, but when I try to use sim I get the following error:
Warning: “Cannot execute method ‘set’ on ‘dos_plecs/Circuit’ while simulation is running”
My script is the following
%
% Model initialization
%
fs=20e3; % Bridge/Controller switching/sampling frequency
Ts=1/fs; % Bridge/Controller switching/sampling period
L2=1e-6; % Transformer leakage inductance
N=8; % Transformer turns ratio
C3=15e-6; % Bridge bias capacitor
L1=200e-6; % Rectifier filter inductance
C2=10e-6; % Rectifier filter capacitor
R1=20; % Load
% PLECS model parameters update
plecs(‘set’, ‘dos_plecs/Circuit/L2’, ‘L’, ‘L2’);
plecs(‘set’, ‘dos_plecs/Circuit/C3’, ‘C’, ‘C3’);
plecs(‘set’, ‘dos_plecs/Circuit/Tr2’, ‘n’, ‘[1 N]’);
plecs(‘set’, ‘dos_plecs/Circuit/L1’, ‘L’, ‘L1’);
plecs(‘set’, ‘dos_plecs/Circuit/C2’, ‘C’, ‘C2’);
plecs(‘set’, ‘dos_plecs/Circuit/R1’, ‘R’, ‘R1’);
%
% Model simulation
%
mdl = plecs(‘get’,‘’,‘CurrentCircuit’)
sim(‘dos_plecs’);