Dear plexim team
In the attached simulation (“buck-boost converter.plecs”) I would like to vary the parameters “Rload” and “Lload”. For each parameter set at the end of the simulation (t = 0.1s) the currentripple should be saved in a .csv file. When I start the simulation script, currently only the value of the last simulation is saved, all other values are overwritten. The .csv file should be formatted correctly at best, (e.g. column values: Lload and row values: Rload) means per row and column combination one value of the currentripple.
I would be very happy about a solution.
Kind regards,
Raphael Baumeler
buck-boost converter.plecs (25.9 KB)
You did not attach a model.
You are right, thanks for the hint. I’ve attach it now.
The “To File” block prints the simulation output to a file. Using the “To File” block generally isn’t appropriate for parameter sweeps unless you want to store the results of each simulation (which also requires changing the name of the output file for each parameter set).
What’s more appropriate here is to use the approach taken in the “Buck Converter with Parameter Sweep” demo model. Specifically, the use of a Signal Outport at the top level schematic so that the plecs(‘simulate’) command returns simulation data (see the help excerpt below). Then one would manage the results and any file IO in the simulation script. That demo also illustrates how to run the simulation in parallel (if you have PLECS 4.6).
Attached is a modified version of your model. I assume you’ll want to restructure the output, add headers, etc. but all of that is basic Octave file IO for which there are plenty of resources available.
buck-boost converter_bl.plecs (24.7 KB)
Thanks a lot this is exactly what i wanted.
Best regards,
Raphael