Plecs { Name "flyback_peak_current_mode_S_domain" Version "3.7" CircuitModel "ContStateSpace" StartTime "0.0" StopTime "simuation_total_time" Solver "radau" MaxStep "1e-3" InitStep "-1" FixedStep "1e-3" Refine "1" ZCStepSize "1e-9" RelTol "1e-3" AbsTol "-1" TurnOnThreshold "0" SyncFixedStepTasks "2" UseSingleCommonBaseRate "1" LossVariableLimitExceededMsg "3" NegativeSwitchLossMsg "3" DivisionByZeroMsg "2" StiffnessDetectionMsg "2" MaxConsecutiveZCs "1000" AssertionAction "1" InitializationCommands "fid = fopen(\"myfile.txt\");\n\nfor i = 1:100\n\tfli" "ne = fgetl(fid);\n\t\n\tif(fline == -1)\n\t\tbreak;\n\tend\n\n\tdisp(fline);" "\n\teval(fline);\n\t\t\n\t\nend\n\nfclose(fid)" InitialState "1" SystemState "" CodeGenTopologies "[]" CodeGenSwitchingAlgorithm "1" CodeGenMatrixCodingStyle "1" CodeGenParameterInlining "2" CodeGenInliningExceptions "AAAACwAAAAAA" CodeGenIntegerWordSize "32" CodeGenAbsTimeUsageMsg "3" CodeGenBaseName "" CodeGenOutputDir "" CodeGenExtraOpts "" ExtendedMatrixPrecision "1" MatrixSignificanceCheck "2" Schematic { Location [1922, 87; 3840, 2090] ZoomFactor 1.87249 SliderPosition [0, 0] ShowBrowser off BrowserWidth 100 Component { Type Constant Name "Voltage \nController\nReference" Show on Position [155, 540] Direction right Flipped off Frame [-10, -10; 10, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "Value" Value "Vc_v" Show off } } Component { Type Goto Name "Goto6" Show off Position [740, 515] Direction right Flipped off Parameter { Variable "Tag" Value "PWM" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type TransferFunction Name "Transfer Fcn Vo" Show on Position [295, 540] Direction right Flipped off Frame [-30, -15; 30, 15] LabelPosition [0, 18] LabelAlign up Parameter { Variable "Numerator" Value "[b2s_v b1s_v b0s_v]" Show off } Parameter { Variable "Denominator" Value "[a2s_v a1s_v a0s_v]" Show off } Parameter { Variable "X0" Value "0" Show off } } Component { Type Sum Name "Sum" Show off Position [220, 540] Direction up Flipped off Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "|+-" Show off } } Component { Type Reference SrcComponent "Components/Control/Logical/SR Flip-flop" Name "SR Flip-flop" Show on Position [695, 525] Direction up Flipped off Frame [-20, -20; 20, 20] LabelPosition [0, 23] LabelAlign up Parameter { Variable "x_init" Value "0" Show off } Terminal { Type Input Position [-20, 10] Direction left } Terminal { Type Input Position [-20, -10] Direction left } Terminal { Type Output Position [24, -10] Direction right } Terminal { Type Output Position [24, 10] Direction right } } Component { Type PulseGenerator Name "Pulse\nGenerator" Show on Position [545, 465] Direction right Flipped off Parameter { Variable "Hi" Value "1" Show off } Parameter { Variable "Lo" Value "0" Show off } Parameter { Variable "f" Value "fsw" Show off } Parameter { Variable "DutyCycle" Value "0.01" Show off } Parameter { Variable "Delay" Value "0" Show off } } Component { Type Comparator Name "Comparator" Show on Position [540, 535] Direction right Flipped off } Component { Type Sum Name "Sum1" Show off Position [470, 620] Direction left Flipped off Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "|++" Show off } } Component { Type TriangleGenerator Name "Artifical Ramp" Show on Position [520, 620] Direction left Flipped off Parameter { Variable "Min" Value "0" Show off } Parameter { Variable "Max" Value "Va" Show off } Parameter { Variable "f" Value "fsw" Show off } Parameter { Variable "DutyCycle" Value "0.99" Show off } Parameter { Variable "Delay" Value "0" Show off } } Component { Type Saturation Name "Saturation" Show on Position [390, 540] Direction right Flipped off Parameter { Variable "UpperLimit" Value "VM_i*0.99" Show on } Parameter { Variable "LowerLimit" Value "VM_i*0.01" Show on } } Component { Type Gain Name "Voltage \nSensor Gain" Show on Position [220, 615] Direction up Flipped off Parameter { Variable "K" Value "Hs_v" Show off } Parameter { Variable "Multiplication" Value "1" Show off } } Component { Type From Name "From9" Show off Position [470, 665] Direction up Flipped off Parameter { Variable "Tag" Value "Ipri" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type From Name "From11" Show off Position [220, 665] Direction up Flipped off Parameter { Variable "Tag" Value "Vo" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Inductor Name "Lm" Show on Position [470, 140] Direction up Flipped off Parameter { Variable "L" Value "Lm" Show on } Parameter { Variable "i_init" Value "0" Show off } } Component { Type Capacitor Name "C1" Show on Position [690, 195] Direction down Flipped on Parameter { Variable "C" Value "Cout" Show on } Parameter { Variable "v_init" Value "Vout" Show on } } Component { Type Diode Name "D1" Show off Position [610, 90] Direction right Flipped on Parameter { Variable "Vf" Value "0.6" Show off } Parameter { Variable "Ron" Value "0.04" Show off } Parameter { Variable "thermal" Value "" Show off } Parameter { Variable "T_init" Value "0" Show off } } Component { Type Transformer Name "Tr3" Show on Position [555, 155] Direction right Flipped on Parameter { Variable "Windings" Value "[1 1]" Show off } Parameter { Variable "n" Value "[primary_turns_number -secondary_turns_number]" Show off } Parameter { Variable "Polarity" Value "+" Show off } Parameter { Variable "Lm" Value "inf" Show off } Parameter { Variable "im0" Value "0" Show off } } Component { Type Resistor Name "R2" Show off Position [800, 165] Direction up Flipped on Parameter { Variable "R" Value "Rload50" Show on } } Component { Type Mosfet Name "FET1" Show off Position [140, 260] Direction down Flipped on Parameter { Variable "Ron" Value "1" 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 Resistor Name "Rs" Show on Position [140, 355] Direction up Flipped off Parameter { Variable "R" Value "Rsense" Show on } } Component { Type Voltmeter Name "Vm1" Show off Position [225, 360] Direction up Flipped off } Component { Type DCVoltageSource Name "Vdc" Show on Position [60, 250] Direction down Flipped on Parameter { Variable "V" Value "Vinput" Show on } } Component { Type Label Name "Label3" Show off Position [800, 70] Direction up Flipped off Parameter { Variable "Tag" Value "Vout" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Goto Name "Goto" Show off Position [285, 360] Direction right Flipped off Parameter { Variable "Tag" Value "Ipri" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type From Name "From1" Show off Position [190, 260] Direction left Flipped off Parameter { Variable "Tag" Value "PWM" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Ground Name "Ground" Show off Position [800, 270] Direction up Flipped off } Component { Type Resistor Name "R4" Show off Position [910, 270] Direction down Flipped off Parameter { Variable "R" Value "Rload50" Show on } } Component { Type Switch Name "S1" Show on Position [910, 315] Direction down Flipped off Parameter { Variable "s_init" Value "0" Show off } } Component { Type PulseGenerator Name "50% to 100%" Show on Position [820, 315] Direction right Flipped off Parameter { Variable "Hi" Value "1" Show off } Parameter { Variable "Lo" Value "0" Show off } Parameter { Variable "f" Value "fdisturbance" Show off } Parameter { Variable "DutyCycle" Value "0.5" Show off } Parameter { Variable "Delay" Value "0" Show off } } Component { Type Ground Name "Ground6" Show off Position [910, 375] Direction up Flipped off } Component { Type Resistor Name "R3" Show off Position [690, 140] Direction up Flipped on Parameter { Variable "R" Value "Cout_ESR" Show on } } Component { Type Scope Name "Scope" Show on Position [370, 310] Direction up Flipped off Location [0, 0; 0, 0] State "" SavedViews "" HeaderState "" PlotPalettes "" Axes "2" TimeRange "0" ScrollingMode "1" SingleTimeAxis "1" Open "0" Ts "-1" SampleLimit "0" XAxisLabel "" Axis { Name "Ipri" AutoScale 1 MinValue 0 MaxValue 1 Signals {} SignalTypes [ ] Untangle 0 KeepBaseline off BaselineValue 0 } Axis { Name "Vout" 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 From Name "From2" Show off Position [285, 325] Direction right Flipped off Parameter { Variable "Tag" Value "Vo" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Voltmeter Name "Vo" Show on Position [1000, 195] Direction up Flipped off } Component { Type Ground Name "Ground1" Show off Position [1000, 245] Direction up Flipped off } Component { Type Goto Name "Goto2" Show off Position [1040, 195] Direction right Flipped off Parameter { Variable "Tag" Value "Vo" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Connection { Type Signal SrcComponent "Sum" SrcTerminal 1 DstComponent "Transfer Fcn Vo" DstTerminal 1 } Connection { Type Signal SrcComponent "Pulse\nGenerator" SrcTerminal 1 Points [570, 465; 570, 515] DstComponent "SR Flip-flop" DstTerminal 2 } Connection { Type Signal SrcComponent "Artifical Ramp" SrcTerminal 1 DstComponent "Sum1" DstTerminal 3 } Connection { Type Signal SrcComponent "Comparator" SrcTerminal 3 DstComponent "SR Flip-flop" DstTerminal 1 } Connection { Type Signal SrcComponent "Sum1" SrcTerminal 1 Points [470, 530] DstComponent "Comparator" DstTerminal 1 } Connection { Type Signal SrcComponent "Transfer Fcn Vo" SrcTerminal 2 DstComponent "Saturation" DstTerminal 1 } Connection { Type Signal SrcComponent "Saturation" SrcTerminal 2 DstComponent "Comparator" DstTerminal 2 } Connection { Type Signal SrcComponent "Voltage \nController\nReference" SrcTerminal 1 DstComponent "Sum" DstTerminal 2 } Connection { Type Signal SrcComponent "From11" SrcTerminal 1 DstComponent "Voltage \nSensor Gain" DstTerminal 1 } Connection { Type Signal SrcComponent "Voltage \nSensor Gain" SrcTerminal 2 DstComponent "Sum" DstTerminal 3 } Connection { Type Signal SrcComponent "SR Flip-flop" SrcTerminal 3 DstComponent "Goto6" DstTerminal 1 } Connection { Type Wire SrcComponent "D1" SrcTerminal 1 Points [570, 90; 570, 135] DstComponent "Tr3" DstTerminal 3 } Connection { Type Wire SrcComponent "C1" SrcTerminal 2 Points [690, 240] Branch { Points [800, 240] Branch { DstComponent "R2" DstTerminal 1 } Branch { DstComponent "Ground" DstTerminal 1 } } Branch { Points [565, 240] DstComponent "Tr3" DstTerminal 4 } } Connection { Type Wire SrcComponent "Rs" SrcTerminal 2 Points [140, 390] Branch { Points [60, 390] DstComponent "Vdc" DstTerminal 2 } Branch { Points [225, 390] DstComponent "Vm1" DstTerminal 2 } } Connection { Type Wire SrcComponent "D1" SrcTerminal 2 Points [690, 90] Branch { Points [800, 90] Branch { DstComponent "R2" DstTerminal 2 } Branch { DstComponent "Label3" DstTerminal 1 } Branch { Points [910, 90] Branch { DstComponent "R4" DstTerminal 2 } Branch { Points [1000, 90] DstComponent "Vo" DstTerminal 1 } } } Branch { DstComponent "R3" DstTerminal 2 } } Connection { Type Wire SrcComponent "Rs" SrcTerminal 1 Points [140, 325] Branch { DstComponent "FET1" DstTerminal 2 } Branch { Points [225, 325] DstComponent "Vm1" DstTerminal 1 } } Connection { Type Wire SrcComponent "Tr3" SrcTerminal 1 Points [540, 135; 540, 90; 470, 90] Branch { Points [60, 90] DstComponent "Vdc" DstTerminal 1 } Branch { DstComponent "Lm" DstTerminal 1 } } Connection { Type Wire SrcComponent "Lm" SrcTerminal 2 Points [470, 200] Branch { Points [140, 200] DstComponent "FET1" DstTerminal 1 } Branch { Points [540, 200; 540, 165] DstComponent "Tr3" DstTerminal 2 } } Connection { Type Signal SrcComponent "From1" SrcTerminal 1 DstComponent "FET1" DstTerminal 3 } Connection { Type Signal SrcComponent "Vm1" SrcTerminal 3 Points [250, 360] Branch { DstComponent "Goto" DstTerminal 1 } Branch { Points [250, 305] DstComponent "Scope" DstTerminal 1 } } Connection { Type Wire SrcComponent "S1" SrcTerminal 2 DstComponent "R4" DstTerminal 1 } Connection { Type Wire SrcComponent "S1" SrcTerminal 1 DstComponent "Ground6" DstTerminal 1 } Connection { Type Signal SrcComponent "50% to 100%" SrcTerminal 1 DstComponent "S1" DstTerminal 3 } Connection { Type Wire SrcComponent "R3" SrcTerminal 1 DstComponent "C1" DstTerminal 1 } Connection { Type Signal SrcComponent "From2" SrcTerminal 1 Points [315, 325; 315, 315] DstComponent "Scope" DstTerminal 2 } Connection { Type Wire SrcComponent "Vo" SrcTerminal 2 DstComponent "Ground1" DstTerminal 1 } Connection { Type Signal SrcComponent "Vo" SrcTerminal 3 DstComponent "Goto2" DstTerminal 1 } Connection { Type Signal SrcComponent "From9" SrcTerminal 1 DstComponent "Sum1" DstTerminal 2 } } } DemoSignature "S1EuNjzI7xF82HpIyp41cEMaPUaRv3UuJwLBSG1+RmU="