Plecs { Name "BuckParamSweep_withObtainingLastValue" Version "4.1" CircuitModel "ContStateSpace" StartTime "0.0" StopTime "0.002" Timeout "" Solver "dopri" MaxStep "1e-3" InitStep "-1" FixedStep "1e-3" Refine "1" ZCStepSize "1e-9" RelTol "1e-3" AbsTol "-1" TurnOnThreshold "0" SyncFixedStepTasks "2" UseSingleCommonBaseRate "2" LossVariableLimitExceededMsg "3" NegativeSwitchLossMsg "3" DivisionByZeroMsg "2" StiffnessDetectionMsg "2" MaxConsecutiveZCs "1000" AssertionAction "1" InitializationCommands "varL=50e-6;\n" InitialState "1" SystemState "" CodeGenParameterInlining "2" CodeGenInliningExceptions "AAAACwAAAAAA" CodeGenFloatingPointFormat "2" CodeGenIntegerWordSize "32" CodeGenAbsTimeUsageMsg "3" CodeGenBaseName "" CodeGenOutputDir "" CodeGenExtraOpts "" CodeGenTarget "Generic" CodeGenTargetSettings "" ExtendedMatrixPrecision "1" MatrixSignificanceCheck "2" EnableStateSpaceSplitting "2" DisplayStateSpaceSplitting "1" DiscretizationMethod "2" ExternalModeSettings "" AlgebraicLoopMethod "1" AlgebraicLoopTolerance "1e-6" Terminal { Type Output Index "1" } Schematic { Location [1584, 128; 2035, 639] ZoomFactor 1 SliderPosition [0, 0] ShowBrowser off BrowserWidth 100 Component { Type DCVoltageSource Name "V_dc" Show off Position [45, 190] Direction down Flipped on Parameter { Variable "V" Value "28" Show on } } Component { Type Diode Name "D1" Show off Position [150, 185] Direction up Flipped on Parameter { Variable "Vf" Value "0" Show off } Parameter { Variable "Ron" Value "0" Show off } Parameter { Variable "thermal" Value "" Show off } Parameter { Variable "T_init" Value "0" Show off } } Component { Type Mosfet Name "T1" Show off Position [100, 145] Direction right Flipped on Parameter { Variable "Ron" Value "0" Show off } Parameter { Variable "s_init" Value "0" Show off } Parameter { Variable "thermal" Value "" Show off } Parameter { Variable "T_init" Value "0" Show off } } Component { Type Inductor Name "L1" Show on Position [215, 145] Direction left Flipped off Parameter { Variable "L" Value "varL" Show on } Parameter { Variable "i_init" Value "0" Show off } } Component { Type Resistor Name "R" Show off Position [375, 190] Direction down Flipped off Parameter { Variable "R" Value "6" Show on } } Component { Type Capacitor Name "C1" Show off Position [275, 190] Direction down Flipped on Parameter { Variable "C" Value "500e-6" Show on } Parameter { Variable "v_init" Value "12" Show off } } Component { Type Resistor Name "R1" Show off Position [325, 260] Direction down Flipped off Parameter { Variable "R" Value "11e3" Show on } } Component { Type Capacitor Name "C2" Show off Position [365, 320] Direction up Flipped off Parameter { Variable "C" Value "1.1e-9" Show on } Parameter { Variable "v_init" Value "0" Show off } } Component { Type Capacitor Name "C3" Show off Position [290, 355] Direction left Flipped off Parameter { Variable "C" Value "2.7e-9" Show on } Parameter { Variable "v_init" Value "0" Show off } } Component { Type DCVoltageSource Name "V_ref" Show off Position [365, 430] Direction down Flipped on Parameter { Variable "V" Value "5" Show on } } Component { Type Resistor Name "R2" Show off Position [325, 320] Direction down Flipped off Parameter { Variable "R" Value "85e3" Show on } } Component { Type Resistor Name "R3" Show off Position [235, 355] Direction left Flipped off Parameter { Variable "R" Value "120e3" Show on } } Component { Type Ground Name "Ground1" Show off Position [325, 485] Direction up Flipped off } Component { Type Resistor Name "R4" Show off Position [325, 440] Direction down Flipped off Parameter { Variable "R" Value "47e3" Show on } } Component { Type Ground Name "Ground2" Show off Position [150, 250] Direction up Flipped off } Component { Type Voltmeter Name "Vm2" Show off Position [205, 430] Direction down Flipped on } Component { Type Resistor Name "R5" Show off Position [420, 190] Direction down Flipped off Parameter { Variable "R" Value "1" Show on } } Component { Type Switch Name "S1" Show on Position [400, 145] Direction left Flipped on Parameter { Variable "s_init" Value "0" Show off } } Component { Type Gain Name "Gain" Show off Position [160, 430] Direction right Flipped on Parameter { Variable "K" Value ".25" Show off } Parameter { Variable "Multiplication" Value "1" Show off } } Component { Type Saturation Name "Saturation" Show off Position [105, 430] Direction right Flipped on Parameter { Variable "UpperLimit" Value "0.9" Show on } Parameter { Variable "LowerLimit" Value "0.1" Show on } } Component { Type TriangleGenerator Name "Sawtooth\nGenerator" Show off Position [105, 370] Direction right Flipped on Parameter { Variable "Min" Value "0" Show off } Parameter { Variable "Max" Value "1" Show off } Parameter { Variable "f" Value "100e3" Show on } Parameter { Variable "DutyCycle" Value "1" Show off } Parameter { Variable "Delay" Value "0" Show off } } Component { Type RelationalOperator Name "Relational\nOperator" Show off Position [45, 425] Direction right Flipped on Parameter { Variable "Operator" Value "3" Show off } } Component { Type Step Name "Step" Show off Position [365, 100] Direction right Flipped off Parameter { Variable "Time" Value "1e-3" Show on } Parameter { Variable "Before" Value "0" Show off } Parameter { Variable "After" Value "1" Show off } } Component { Type PlecsProbe Name "Probe" Show on Position [90, 290] Direction right Flipped off } Component { Type Scope Name "Scope" Show on Position [170, 290] Direction up Flipped off Location [653, 44; 1406, 736] State "AAAA/wAAAAD9AAAAAgAAAAEAAACWAAACzvwCAAAABPsAAAAQAFoAbwBvA" "G0AQQByAGUAYQAAAAAA/////wAAAG4A////+wAAABQAUwBhAHYAZQBkAFYAaQBlAHcAcwAAAAAA//" "///wAAAH4A////+wAAABwAUwBpAG0AdQBsAGEAdABpAG8AbgBSAHUAbgBzAQAAAAAAAAK9AAAAAAA" "AAAD7AAAADABUAHIAYQBjAGUAcwEAAAA4AAACzgAAAH4A////AAAAAwAAA60AAABv/AEAAAAB+wAA" "ABQARABhAHQAYQBXAGkAZABnAGUAdAEAAAAAAAADrQAAAFsA////AAADEgAAAs4AAAAEAAAABAAAA" "AgAAAAI/AAAAAEAAAACAAAAAQAAAA4AVABvAG8AbABCAGEAcgEAAAAA/////wAAAAAAAAAA" SavedViews "AAAAAgAAAAA=" HeaderState "AAAA/wAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAL+AMAAAAHAAAAC" "AAAAGQAAAAJAAAAZAAAAAYAAABkAAAABwAAAGQAAAAEAAAAZAAAAAUAAABkAAAAAwAAAGQAAAOtAA" "AACwEAAAEAAAAAAAAAAAAAAABk/////wAAAIEAAAAAAAAACwAAAIUAAAABAAAAAAAAAGQAAAABAAA" "AAAAAAGQAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAB" "AAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAmAAAAABAAAAAAAAA+gA" PlotPalettes "AAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAA" "AEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" Axes "2" TimeRange "0.0" ScrollingMode "1" SingleTimeAxis "1" Open "1" Ts "-1" SampleLimit "0" XAxisLabel "" Axis { Name "Inductor current" AutoScale 1 MinValue 0 MaxValue 1 Signals {} SignalTypes [ ] Untangle 0 KeepBaseline off BaselineValue 0 } Axis { Name "Load voltage" AutoScale 1 MinValue 0 MaxValue 1 Signals {} SignalTypes [ ] Untangle 0 KeepBaseline off BaselineValue 0 } Fourier { SingleXAxis on AxisLabel "Frequency" Scaling 0 PhaseDisplay 0 Axis { Name "" AutoScale 1 MinValue 0 MaxValue 1 Signals {} Untangle 0 KeepBaseline off BaselineValue 0 } Axis { Name "" AutoScale 1 MinValue 0 MaxValue 1 Signals {} Untangle 0 KeepBaseline off BaselineValue 0 } } } Component { Type Output Name "Out1" Show on Position [170, 340] Direction right Flipped off Parameter { Variable "Index" Value "1" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Reference SrcComponent "Components/Electrical/Electronics/Op-Amp" Name "Op-Amp" Show off Position [270, 400] Direction down Flipped on Frame [-20, -20; 20, 20] LabelPosition [0, -23] LabelAlign down Parameter { Variable "A" Value "1e6" Show off } Terminal { Type Port Position [-25, -10] Direction left } Terminal { Type Port Position [-25, 10] Direction left } Terminal { Type Port Position [25, 0] Direction right } Terminal { Type Port Position [0, 15] Direction down } } Component { Type SignalDemux Name "Demux" Show off Position [140, 290] Direction right Flipped on Parameter { Variable "Width" Value "2" Show off } } Connection { Type Wire SrcComponent "T1" SrcTerminal 2 Points [150, 145] Branch { DstComponent "L1" DstTerminal 1 } Branch { DstComponent "D1" DstTerminal 2 } } Connection { Type Wire SrcComponent "D1" SrcTerminal 1 Points [150, 230] Branch { Points [275, 230] Branch { Points [375, 230] Branch { DstComponent "R" DstTerminal 1 } Branch { Points [420, 230] DstComponent "R5" DstTerminal 1 } } Branch { DstComponent "C1" DstTerminal 2 } } Branch { Points [45, 230] DstComponent "V_dc" DstTerminal 2 } Branch { DstComponent "Ground2" DstTerminal 1 } } Connection { Type Wire SrcComponent "T1" SrcTerminal 1 Points [45, 145] DstComponent "V_dc" DstTerminal 1 } Connection { Type Wire SrcComponent "R1" SrcTerminal 1 Points [325, 290] Branch { DstComponent "R2" DstTerminal 2 } Branch { Points [365, 290] DstComponent "C2" DstTerminal 1 } } Connection { Type Wire SrcComponent "R4" SrcTerminal 2 Points [325, 410] Branch { DstComponent "Op-Amp" DstTerminal 2 } Branch { Points [325, 355] Branch { DstComponent "R2" DstTerminal 1 } Branch { DstComponent "C3" DstTerminal 2 } Branch { Points [365, 355] DstComponent "C2" DstTerminal 2 } } } Connection { Type Wire SrcComponent "Ground1" SrcTerminal 1 Points [325, 465] Branch { DstComponent "R4" DstTerminal 1 } Branch { Points [365, 465] DstComponent "V_ref" DstTerminal 2 } Branch { Points [270, 465] Branch { Points [205, 465] DstComponent "Vm2" DstTerminal 2 } Branch { DstComponent "Op-Amp" DstTerminal 4 } } } Connection { Type Wire SrcComponent "Op-Amp" SrcTerminal 1 Points [365, 390] DstComponent "V_ref" DstTerminal 1 } Connection { Type Wire SrcComponent "R1" SrcTerminal 2 Points [325, 145] Branch { Points [375, 145] Branch { DstComponent "R" DstTerminal 2 } Branch { DstComponent "S1" DstTerminal 2 } } Branch { Points [275, 145] Branch { DstComponent "C1" DstTerminal 1 } Branch { DstComponent "L1" DstTerminal 2 } } } Connection { Type Wire SrcComponent "Op-Amp" SrcTerminal 3 Points [205, 400] Branch { Points [205, 355] DstComponent "R3" DstTerminal 1 } Branch { DstComponent "Vm2" DstTerminal 1 } } Connection { Type Wire SrcComponent "S1" SrcTerminal 1 DstComponent "R5" DstTerminal 2 } Connection { Type Signal SrcComponent "Step" SrcTerminal 1 Points [400, 100] DstComponent "S1" DstTerminal 3 } Connection { Type Signal SrcComponent "Vm2" SrcTerminal 3 DstComponent "Gain" DstTerminal 1 } Connection { Type Wire SrcComponent "R3" SrcTerminal 2 DstComponent "C3" DstTerminal 1 } Connection { Type Signal SrcComponent "Gain" SrcTerminal 2 DstComponent "Saturation" DstTerminal 1 } Connection { Type Signal SrcComponent "Sawtooth\nGenerator" SrcTerminal 1 Points [75, 370] DstComponent "Relational\nOperator" DstTerminal 1 } Connection { Type Signal SrcComponent "Saturation" SrcTerminal 2 DstComponent "Relational\nOperator" DstTerminal 2 } Connection { Type Signal SrcComponent "Relational\nOperator" SrcTerminal 3 Points [20, 425; 20, 110] DstComponent "T1" DstTerminal 3 } Connection { Type Signal SrcComponent "Demux" SrcTerminal 3 DstComponent "Scope" DstTerminal 2 } Connection { Type Signal SrcComponent "Demux" SrcTerminal 2 DstComponent "Scope" DstTerminal 1 } Connection { Type Signal SrcComponent "Probe" SrcTerminal 1 Points [120, 290] Branch { Points [120, 340] DstComponent "Out1" DstTerminal 1 } Branch { DstComponent "Demux" DstTerminal 1 } } Annotation { Name "Buck converter with parameter sweep\n\nRun the simulation" " script \"Parameter Sweep\" (from the Simulation menu)\nto simulate the model" " with three different values for inductor L1.\nThe peak current through L1 is" " printed in the Octave console." Position [15, 40] HorizontalAlignment "left" } } ProbeBlock { Tag "BuckParamSweep_withObtainingLastValue/Probe" Probe { Component "L1" Path "" Signals {"Inductor current"} } Probe { Component "C1" Path "" Signals {"Capacitor voltage"} } } Script { Name "Parameter Sweep" Script base64 "JSBjcmVhdGUgc2ltU3RydWN0IHdpdGggZmllbGQgJ01vZGVsVmFy" "cycKbWRsVmFycyA9IHN0cnVjdCgndmFyTCcsIDUwZS02KTsKc2ltU3RydW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