### Run Python 3 PLECS Standalone Simulation Script Source: https://docs.plexim.com/plecs-demos/power-supplies/buck-converter-with-parameter-sweep Executes a Python 3 script for PLECS Standalone simulations. Requires the RPC interface to be enabled in PLECS preferences on port 1080. PLECS must be started manually before running the script. The simulation type (sequential/parallel) can be adjusted within the script. ```bash python3 parameter_sweep_script.py ``` -------------------------------- ### Octave Script: Sequential Parameter Sweep for Buck Converter Source: https://docs.plexim.com/plecs-demos/power-supplies/buck-converter-with-parameter-sweep This Octave script performs a sequential parameter sweep for the inductor L1 in a buck converter model. It iterates through predefined inductor values, updates the model parameters, runs simulations sequentially, and displays results in the scope. It also prints the peak current to the console. Dependencies include the PLECS Octave interface. ```octave % create simStruct with field 'ModelVars' mdlVars = struct('varL', 50e-6); simStruct = struct('ModelVars', mdlVars); % clear all previous traces in scope 'Scope' in the current model plecs('scope', './Scope', 'ClearTraces'); % parametric values to be swept inductorValues = [40:20:220]; % in uH for ix = 1:length(inductorValues) % set value for L1 simStruct.ModelVars.varL = inductorValues(ix) * 1e-6; simStruct.SolverOpts.OutputTimes = 0.001:0.2e-5:0.002; % start simulation, return probed signal values in 'out' out = plecs('simulate', simStruct); % hold and label trace plecs('scope', './Scope', 'HoldTrace', ['L=' mat2str(inductorValues(ix)) 'uH']); % find maximum current value and index [maxv, maxidx] = max(out.Values(1,:)); % Output maximum current values to Octave console printf('Max current for L=%duH: %fA at %fs\n', inductorValues(ix), maxv, out.Time(maxidx)); end ```