Plecs { Name "flyback_peak_current_mode_transconductance_amplifier" 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 [0, 45; 3840, 2060] ZoomFactor 1.87249 SliderPosition [0, 0] ShowBrowser off BrowserWidth 100 Component { Type From Name "From9" Show off Position [855, 670] Direction up Flipped off Parameter { Variable "Tag" Value "Ipri" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Reference SrcComponent "Components/Control/Logical/SR Flip-flop" Name "SR Flip-flop1" Show on Position [1025, 540] 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\nGenerator1" Show on Position [930, 480] 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 "Comparator1" Show on Position [925, 550] Direction right Flipped off } Component { Type Sum Name "Sum2" Show off Position [855, 625] Direction left Flipped off Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "|++" Show off } } Component { Type TriangleGenerator Name "Artifical Ramp1" Show on Position [905, 625] 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 Resistor Name "Rupper" Show on Position [140, 495] Direction up Flipped off Parameter { Variable "R" Value "Rupper" Show off } } Component { Type Resistor Name "Rbottom" Show on Position [140, 585] Direction up Flipped off Parameter { Variable "R" Value "Rbottom" Show off } } Component { Type Ground Name "Ground3" Show off Position [140, 640] Direction up Flipped off } Component { Type Voltmeter Name "Viref" Show on Position [610, 555] Direction up Flipped off } Component { Type Saturation Name "Saturation" Show on Position [670, 555] Direction right Flipped off Parameter { Variable "UpperLimit" Value "Vref_IC" Show on } Parameter { Variable "LowerLimit" Value "0" Show on } } Component { Type Saturation Name "Saturation1" Show on Position [780, 555] 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 Goto Name "Goto7" Show off Position [1085, 530] Direction right Flipped off Parameter { Variable "Tag" Value "PWM" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Resistor Name "Rz1" Show on Position [470, 580] Direction up Flipped off Parameter { Variable "R" Value "Rz_trans_cond" Show off } } Component { Type Capacitor Name "Cz1" Show on Position [470, 530] Direction up Flipped on Parameter { Variable "C" Value "Cz_trans_cond" Show off } Parameter { Variable "v_init" Value "0" Show off } } Component { Type Capacitor Name "Cp1" Show on Position [525, 560] Direction up Flipped on Parameter { Variable "C" Value "Cp_trans_cond" Show off } Parameter { Variable "v_init" Value "0" Show off } } Component { Type CurrentSource Name "I" Show on Position [415, 555] Direction down Flipped on Parameter { Variable "DiscretizationBehavior" Value "2" Show off } Parameter { Variable "StateSpaceInlining" Value "1" Show off } } Component { Type Ground Name "Ground7" Show off Position [495, 660] Direction up Flipped off } Component { Type Gain Name "gm" Show on Position [370, 555] Direction right Flipped off Parameter { Variable "K" Value "gm" Show off } Parameter { Variable "Multiplication" Value "1" Show off } } Component { Type Sum Name "Sum3" Show off Position [320, 555] Direction up Flipped off Parameter { Variable "IconShape" Value "1" Show off } Parameter { Variable "Inputs" Value "+-" Show off } } Component { Type Constant Name "Voltage \nController\nReference" Show on Position [250, 480] Direction right Flipped off Frame [-10, -10; 10, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "Value" Value "Vc_v" Show off } } Component { Type Voltmeter Name "Vfb" Show on Position [210, 560] Direction up Flipped off } Component { Type VoltageSource Name "V" Show on Position [90, 535] Direction down Flipped on Parameter { Variable "DiscretizationBehavior" Value "2" Show off } Parameter { Variable "StateSpaceInlining" Value "1" Show off } } Component { Type From Name "From" Show off Position [55, 535] Direction right Flipped off Parameter { Variable "Tag" Value "Vo" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Inductor Name "Lm" Show on Position [500, 115] 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 [720, 170] 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 [640, 65] 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 [585, 130] 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 [830, 140] Direction up Flipped on Parameter { Variable "R" Value "Rload50" Show on } } Component { Type Mosfet Name "FET1" Show off Position [170, 235] 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 [170, 330] Direction up Flipped off Parameter { Variable "R" Value "Rsense" Show on } } Component { Type Voltmeter Name "Vm1" Show off Position [255, 335] Direction up Flipped off } Component { Type DCVoltageSource Name "Vdc" Show on Position [90, 225] Direction down Flipped on Parameter { Variable "V" Value "Vinput" Show on } } Component { Type Label Name "Label3" Show off Position [830, 45] 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 [315, 335] Direction right Flipped off Parameter { Variable "Tag" Value "Ipri" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type From Name "From2" Show off Position [220, 235] 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 [830, 245] Direction up Flipped off } Component { Type Resistor Name "R7" Show off Position [940, 245] Direction down Flipped off Parameter { Variable "R" Value "Rload50" Show on } } Component { Type Switch Name "S1" Show on Position [940, 290] Direction down Flipped off Parameter { Variable "s_init" Value "0" Show off } } Component { Type PulseGenerator Name "50% to 100%" Show on Position [850, 290] 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 "Ground8" Show off Position [940, 350] Direction up Flipped off } Component { Type Resistor Name "R3" Show off Position [720, 115] Direction up Flipped on Parameter { Variable "R" Value "Cout_ESR" Show on } } Component { Type Scope Name "Scope" Show on Position [400, 285] 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 "From3" Show off Position [315, 300] 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 [1030, 170] Direction up Flipped off } Component { Type Ground Name "Ground1" Show off Position [1030, 220] Direction up Flipped off } Component { Type Goto Name "Goto2" Show off Position [1070, 170] Direction right Flipped off Parameter { Variable "Tag" Value "Vo" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Connection { Type Signal SrcComponent "Pulse\nGenerator1" SrcTerminal 1 Points [990, 480] DstComponent "SR Flip-flop1" DstTerminal 2 } Connection { Type Signal SrcComponent "Artifical Ramp1" SrcTerminal 1 DstComponent "Sum2" DstTerminal 3 } Connection { Type Signal SrcComponent "Comparator1" SrcTerminal 3 DstComponent "SR Flip-flop1" DstTerminal 1 } Connection { Type Signal SrcComponent "Sum2" SrcTerminal 1 Points [855, 545] DstComponent "Comparator1" DstTerminal 1 } Connection { Type Signal SrcComponent "Viref" SrcTerminal 3 DstComponent "Saturation" DstTerminal 1 } Connection { Type Signal SrcComponent "Saturation1" SrcTerminal 2 DstComponent "Comparator1" DstTerminal 2 } Connection { Type Signal SrcComponent "SR Flip-flop1" SrcTerminal 3 DstComponent "Goto7" DstTerminal 1 } Connection { Type Wire SrcComponent "Rz1" SrcTerminal 1 DstComponent "Cz1" DstTerminal 1 } Connection { Type Wire SrcComponent "Rz1" SrcTerminal 2 Points [470, 630] Branch { Points [495, 630] Branch { Points [525, 630] Branch { DstComponent "Cp1" DstTerminal 1 } Branch { Points [610, 630] DstComponent "Viref" DstTerminal 2 } } Branch { DstComponent "Ground7" DstTerminal 1 } } Branch { Points [415, 630] DstComponent "I" DstTerminal 1 } } Connection { Type Signal SrcComponent "gm" SrcTerminal 2 DstComponent "I" DstTerminal 3 } Connection { Type Signal SrcComponent "Sum3" SrcTerminal 1 DstComponent "gm" DstTerminal 1 } Connection { Type Signal SrcComponent "Voltage \nController\nReference" SrcTerminal 1 Points [280, 480; 280, 550] DstComponent "Sum3" DstTerminal 2 } Connection { Type Wire SrcComponent "Cz1" SrcTerminal 2 Points [470, 480] Branch { Points [525, 480] Branch { DstComponent "Cp1" DstTerminal 2 } Branch { Points [610, 480] DstComponent "Viref" DstTerminal 1 } } Branch { Points [415, 480] DstComponent "I" DstTerminal 2 } } Connection { Type Signal SrcComponent "Vfb" SrcTerminal 3 DstComponent "Sum3" DstTerminal 3 } Connection { Type Wire SrcComponent "Rupper" SrcTerminal 2 Points [140, 530] Branch { DstComponent "Rbottom" DstTerminal 1 } Branch { Points [210, 530] DstComponent "Vfb" DstTerminal 1 } } Connection { Type Wire SrcComponent "Rbottom" SrcTerminal 2 Points [140, 615] Branch { DstComponent "Ground3" DstTerminal 1 } Branch { Points [210, 615] DstComponent "Vfb" DstTerminal 2 } Branch { Points [90, 615] DstComponent "V" DstTerminal 2 } } Connection { Type Signal SrcComponent "Saturation" SrcTerminal 2 DstComponent "Saturation1" DstTerminal 1 } Connection { Type Signal SrcComponent "From" SrcTerminal 1 DstComponent "V" DstTerminal 3 } Connection { Type Wire SrcComponent "Rupper" SrcTerminal 1 Points [140, 470; 90, 470] DstComponent "V" DstTerminal 1 } Connection { Type Wire SrcComponent "D1" SrcTerminal 1 Points [600, 65; 600, 110] DstComponent "Tr3" DstTerminal 3 } Connection { Type Wire SrcComponent "C1" SrcTerminal 2 Points [720, 215] Branch { Points [830, 215] Branch { DstComponent "R2" DstTerminal 1 } Branch { DstComponent "Ground" DstTerminal 1 } } Branch { Points [595, 215] DstComponent "Tr3" DstTerminal 4 } } Connection { Type Wire SrcComponent "Rs" SrcTerminal 2 Points [170, 365] Branch { Points [90, 365] DstComponent "Vdc" DstTerminal 2 } Branch { Points [255, 365] DstComponent "Vm1" DstTerminal 2 } } Connection { Type Wire SrcComponent "D1" SrcTerminal 2 Points [720, 65] Branch { Points [830, 65] Branch { DstComponent "R2" DstTerminal 2 } Branch { DstComponent "Label3" DstTerminal 1 } Branch { Points [940, 65] Branch { DstComponent "R7" DstTerminal 2 } Branch { Points [1030, 65] DstComponent "Vo" DstTerminal 1 } } } Branch { DstComponent "R3" DstTerminal 2 } } Connection { Type Wire SrcComponent "Rs" SrcTerminal 1 Points [170, 300] Branch { DstComponent "FET1" DstTerminal 2 } Branch { Points [255, 300] DstComponent "Vm1" DstTerminal 1 } } Connection { Type Wire SrcComponent "Tr3" SrcTerminal 1 Points [570, 110; 570, 65; 500, 65] Branch { Points [90, 65] DstComponent "Vdc" DstTerminal 1 } Branch { DstComponent "Lm" DstTerminal 1 } } Connection { Type Wire SrcComponent "Lm" SrcTerminal 2 Points [500, 175] Branch { Points [170, 175] DstComponent "FET1" DstTerminal 1 } Branch { Points [570, 175; 570, 140] DstComponent "Tr3" DstTerminal 2 } } Connection { Type Signal SrcComponent "From2" SrcTerminal 1 DstComponent "FET1" DstTerminal 3 } Connection { Type Signal SrcComponent "Vm1" SrcTerminal 3 Points [280, 335] Branch { DstComponent "Goto" DstTerminal 1 } Branch { Points [280, 280] DstComponent "Scope" DstTerminal 1 } } Connection { Type Wire SrcComponent "S1" SrcTerminal 2 DstComponent "R7" DstTerminal 1 } Connection { Type Wire SrcComponent "S1" SrcTerminal 1 DstComponent "Ground8" 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 "From3" SrcTerminal 1 Points [345, 300; 345, 290] 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 "Sum2" DstTerminal 2 } } } DemoSignature "wVLGVGCjx9mwAwvHbzeJrTbTsTQ99qCqJKG/+EMFM8k="