Plecs { Name "HVDC_400_losses" Version "4.2" CircuitModel "ContStateSpace" StartTime "0.0" StopTime "0.3" Timeout "" Solver "dopri" MaxStep "1e-3" InitStep "-1" FixedStep "1e-3" Refine "1" ZCStepSize "1e-9" RelTol "1e-6" AbsTol "-1" TurnOnThreshold "0" SyncFixedStepTasks "2" UseSingleCommonBaseRate "2" LossVariableLimitExceededMsg "3" NegativeSwitchLossMsg "1" DivisionByZeroMsg "1" StiffnessDetectionMsg "2" MaxConsecutiveZCs "1000" AlgebraicLoopWithStateMachineMsg "2" AssertionAction "1" InitializationCommands "V_gpeak = 320e3/sqrt(3)*sqrt(2); % peak grid phase v" "oltage (V)\nf_g = 50; % grid frequency (Hz)\n\nV_dc = 640e3; % DC bus referen" "ce voltage sum (V)\nnum_sm = 400; % number of series cells\nnum_smuno=num_sm-" "1;\nvectorswitch=(1:num_sm);\nvectorswitchuno=vectorswitch(:,2:end);\nV_sm = " "V_dc/num_sm; % DC capacitor initial voltage (V)\nC_sm = 8e-3; % DC bus capaci" "tance (F)\nC_sm_vector = C_sm * ones(1, num_sm); % DC bus capacitance vector " "(F)\n C_sm_vectoruno= C_sm_vector(:,2:end);\nV_sm_vector = V_sm * ones(1, num" "_sm); % DC capacitor initial voltage vector (V)\nV_sm_vectoruno=V_sm_vector(:" ",2:end);\ncarrier_min = [0:1/num_sm:(1 - 1/num_sm)]; % Minimum carrier signal" " values\ncarrier_max = [1/num_sm:1/num_sm:1]; % Maximum carrier signal values" "\nL_arm = 0.1239; % Filter indutance (Henries)\nR_arm = 1.9468; % Filter wind" "ing resistance (ohms)\nL_g = 0.062; % Grid equivalent inductance (Henries)\nR" "_g = 1.9468; % Grid equivalent resitance (ohms)\nL_s = 0.031; % Transformer e" "quivalent inductance (Henries)\n\nf_sw = 1000; % Triangle carrier wave freque" "ncy (Hz)\n\n% Equivalent parameters for current control calculations\nL_f = L" "_g + L_s + L_arm/2;\nR_f = R_g + R_arm/2;\n\n% Limitation\nI_f_max = 10000; %" " maximum current (A)\n\n% Current control\nalpha_f = 100; % cut off frequency" " of the PI controller\nR_res_a = 1e-3; % Active damping resistance for resona" "nce elimitation\nR_gc_a = alpha_f*L_f - R_f; % active damping coefficient\nK_" "gc_pd = alpha_f*L_f; % propotional gain for d-axis\nK_gc_id = alpha_f*(R_f + " "R_gc_a); % integral gain for d-axis\nK_gc_pq = alpha_f*L_f; % proportional ga" "in for q-axis\nK_gc_iq = alpha_f*(R_f+R_gc_a); % integral gain for q-axis\n\n" "% DC-link voltage control\nK_gc_pW = 0.001; % proportional gain\nK_gc_iW = 1;" " % integral gain\nK_gc_b = 10; % anti-windup\n\nT_HIL = 1/f_sw/100; % discret" "ization step-size" InitialState "1" SystemState "AAAACAAAAAADAAAAEgBUAGkAbQBlAFMAdABhAG0AcAAAABAAACV+tQMOQusBA" "AAAFgBTAHQAYQB0AGUAVgBlAGMAdABvAHIAAAB/AAAAABlQbGVjc0FycmF5OjpEb3VibGVWZWN0b3" "IAAAACF8CGK6ghGxbPwHdf5v4LHvbAdPdpRCsOrkCjYsdx6Bc5wKb4yk3DQvhAtS3I39WtHMCjMoj" "8glQRQKSKG5qjpFLAs95SS5L8LUDQQ5iRFlb7QNBDgzeFdAtA0D54pYroN0DQRNjOxvCwQNBQ07be" "wL9A0ESeCtquz0DQRG2/NXp1QNBRoDoPsStA0FGRpD215EDQT87WTDVPQNBRP3XklQRA0EQyNBpmn" "UDQUNknBgxJQNBE6wsiKT5A0ESTP1MP60DQRHIAyKraQNBEvf2h4dxA0FDX2FJ7d0DQQ5xyOwfiQN" "BFHyWg+7lA0FFyVh+9WUDQQ4d7ArHyQNBPwj3aoB5A0EeC9mWlW0DQQ5S6+45pQNBPsxnnNmdA0EO" "susNYqUDQQ0pCDhOLQNBE5klu48BA0EUaIJRqoUDQS5MU/hG+QNBQ5U6PvTJA0E/KTQuK4EDQQPpK" "ZEl9QNBE+0vb20NA0ETYPjGbAkDQUP0P2noSQNBEZILT9K5A0OANvR/t00DQ2/OTVEBGQN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rXWpskHNA0LsbojJqFkDQu4d0OA1IQNC6057xeIpA0LLi" "FvMegUDQu0+hvNdnAAAADgBDAG8AbQBtAGUAbgB0AAAACgAAAAAiADAALgAzAHMAIABzAHQAZQBhA" "GQAeQAgAHMAdABhAHQAZQ==" CodeGenParameterInlining "2" CodeGenInliningExceptions "AAAACwAAAAAA" CodeGenFloatingPointFormat "2" CodeGenAbsTimeUsageMsg "3" CodeGenBaseName "" CodeGenOutputDir "" CodeGenExtraOpts "" CodeGenTarget "Generic" CodeGenTargetSettings "" ExtendedMatrixPrecision "1" MatrixSignificanceCheck "2" EnableStateSpaceSplitting "2" DisplayStateSpaceSplitting "1" DiscretizationMethod "2" ExternalModeSettings "" AlgebraicLoopMethod "1" AlgebraicLoopTolerance "1e-6" Schematic { Location [0, 27; 1920, 995] ZoomFactor 1 SliderPosition [-1, 0] ShowBrowser off BrowserWidth 100 Component { Type Subsystem Name "Controller AC System I" Show on Position [130, 305] Direction up Flipped off Frame [-45, -30; 45, 30] LabelPosition [0, 33] LabelAlign up SampleTime "-1" CodeGenTarget "Generic" MaskIconFrame on MaskIconOpaque off MaskIconRotates on Terminal { Type Input Position [45, -15] Direction right } Terminal { Type Input Position [45, 0] Direction right } Terminal { Type Input Position [45, 15] Direction right } Terminal { Type Output Position [-49, 0] Direction left } Schematic { Location [453, 689; 1130, 957] ZoomFactor 1 SliderPosition [0, 1] ShowBrowser off BrowserWidth 100 Component { Type SignalMux Name "Mux4" Show off Position [255, 140] Direction left Flipped off Parameter { Variable "Width" Value "2" Show off } } Component { Type Constant Name "I_fq*" Show on Position [395, 40] Direction left Flipped off Frame [-10, -10; 10, 10] LabelPosition [0, -13] LabelAlign down Parameter { Variable "Value" Value "0" Show off } Parameter { Variable "DataType" Value "10" Show off } } Component { Type Subsystem Name "Measurements\ntransformation" Show on Position [460, 90] Direction down Flipped off Frame [-35, -40; 35, 40] LabelPosition [0, -43] LabelAlign down SampleTime "-1" CodeGenTarget "Generic" MaskIconFrame on MaskIconOpaque off MaskIconRotates on Terminal { Type Output Position [39, -10] Direction right } Terminal { Type Output Position [39, 10] Direction right } Terminal { Type Output Position [39, -30] Direction right } Terminal { Type Input Position [-35, 20] Direction left } Terminal { Type Input Position [-35, -20] Direction left } Terminal { Type Output Position [39, 30] Direction right } Schematic { Location [1560, 333; 2420, 617] ZoomFactor 1 SliderPosition [0, 1] ShowBrowser off BrowserWidth 100 Component { Type Reference SrcComponent "Components/Control/Transformations/3ph->RRF" Name "3ph->RRF" Show on Position [250, 45] Direction up Flipped off Frame [-15, -15; 15, 15] LabelPosition [0, 18] LabelAlign up Terminal { Type Input Position [-15, -5] Direction left } Terminal { Type Output Position [19, 0] Direction right } Terminal { Type Input Position [-15, 5] Direction left } } Component { Type Output Name "I_fdq" Show on Position [320, 45] Direction right Flipped off Parameter { Variable "Index" Value "1" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Output Name "E_fdq" Show on Position [320, 105] Direction right Flipped off Parameter { Variable "Index" Value "2" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Output Name "theta_f" Show on Position [320, 165] Direction right Flipped off Parameter { Variable "Index" Value "3" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Input Name "E_f" Show on Position [55, 100] Direction right Flipped off Parameter { Variable "Index" Value "4" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Input Name "I_f" Show on Position [55, 40] Direction right Flipped off Parameter { Variable "Index" Value "5" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Output Name "w_f" Show on Position [320, 220] Direction right Flipped off Parameter { Variable "Index" Value "6" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Constant Name "w" Show on Position [240, 220] Direction right Flipped off Frame [-10, -10; 10, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "Value" Value "2*pi*f_g" Show off } Parameter { Variable "DataType" Value "10" Show off } } Component { Type Subsystem Name "PLL" Show on Position [145, 165] Direction up Flipped off Frame [-20, -10; 20, 10] LabelPosition [0, 13] LabelAlign up SampleTime "-1" CodeGenTarget "Generic" MaskType "PLL" MaskDescription "This block models a Phase Locked Loop and gener" "ates a ramp signal synchronized to the first element of the 3-phase input sig" "nal.\n\nParameters are initial state and proportional and integral gain of th" "e frequency controller." MaskIconFrame on MaskIconOpaque off MaskIconRotates on Parameter { Variable "f0" Prompt "Initial frequency [Hz]" Type FreeText Value "50" Show off Tunable off TabName "" } Parameter { Variable "kp" Prompt "Proportional gain" Type FreeText Value "5" Show off Tunable off TabName "" } Parameter { Variable "ki" Prompt "Integral gain" Type FreeText Value "10" Show off Tunable off TabName "" } Terminal { Type Input Position [-20, 0] Direction left } Terminal { Type Output Position [24, 0] Direction right } Schematic { Location [1106, 643; 1672, 876] ZoomFactor 1 SliderPosition [-1, 0] ShowBrowser off BrowserWidth 100 Component { Type Reference SrcComponent "Components/Control/Transformations/3ph->SRF" Name "3ph->SRF" Show on Position [115, 70] Direction up Flipped off Frame [-15, -15; 15, 15] LabelPosition [0, 18] LabelAlign up Terminal { Type Input Position [-15, 0] Direction left } Terminal { Type Output Position [19, 0] Direction right } } Component { Type Input Name "3ph" Show on Position [40, 70] Direction right Flipped off Parameter { Variable "Index" Value "1" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Product Name "Product" Show off Position [190, 75] Direction up Flipped off Parameter { Variable "Inputs" Value "2" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Sum Name "Sum" Show off Position [250, 75] Direction up Flipped off Parameter { Variable "IconShape" Value "1" Show off } Parameter { Variable "Inputs" Value "+" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type SignalMux Name "Mux" Show off Position [150, 145] Direction right Flipped off Parameter { Variable "Width" Value "2" Show off } } Component { Type Trigonometry Name "Trigonometric\nFunction" Show off Position [115, 160] Direction right Flipped off Parameter { Variable "Operator" Value "2" Show off } Parameter { Variable "Unit" Value "1" Show off } } Component { Type Trigonometry Name "Trigonometric\nFunction1" Show off Position [115, 130] Direction right Flipped off Parameter { Variable "Operator" Value "1" Show off } Parameter { Variable "Unit" Value "1" Show off } } Component { Type Subsystem Name "Frequency\nController" Show on Position [325, 75] Direction up Flipped off Frame [-25, -20; 25, 20] LabelPosition [0, 23] LabelAlign up SampleTime "-1" CodeGenTarget "Generic" MaskIconFrame on MaskIconOpaque off MaskIconRotates on Parameter { Variable "f0" Prompt "Initial frequency" Type FreeText Value "f0" Show off Tunable off TabName "" } Parameter { Variable "kp" Prompt "Proportional gain" Type FreeText Value "kp" Show off Tunable off TabName "" } Parameter { Variable "ki" Prompt "Integral gain" Type FreeText Value "ki" Show off Tunable off TabName "" } Terminal { Type Input Position [-25, 0] Direction left } Terminal { Type Output Position [29, 0] Direction right } Schematic { Location [553, 124; 985, 304] ZoomFactor 1 SliderPosition [0, 0] ShowBrowser off BrowserWidth 100 Component { Type Input Name "error" Show on Position [50, 85] Direction right Flipped off Parameter { Variable "Index" Value "1" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Output Name "w" Show on Position [385, 85] Direction right Flipped off Parameter { Variable "Index" Value "2" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Gain Name "kp" Show off Position [165, 45] Direction right Flipped off Parameter { Variable "K" Value "kp" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Gain Name "ki" Show off Position [165, 125] Direction right Flipped off Parameter { Variable "K" Value "ki" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Integrator Name "Integrator" Show off Position [225, 125] Direction right Flipped off Parameter { Variable "ExternalReset" Value "1" Show off } Parameter { Variable "InitialConditionSource" Value "1" Show off } Parameter { Variable "x0" Value "0" Show off } Parameter { Variable "ShowStatePort" Value "1" Show off } Parameter { Variable "UpperLimit" Value "inf" Show off } Parameter { Variable "LowerLimit" Value "-inf" Show off } } Component { Type Sum Name "Sum" Show off Position [330, 85] Direction up Flipped off Parameter { Variable "IconShape" Value "1" Show off } Parameter { Variable "Inputs" Value "+++" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Constant Name "w0" Show on Position [265, 85] Direction right Flipped off Frame [-10, -10; 10, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "Value" Value "2*pi*f0" Show off } Parameter { Variable "DataType" Value "10" Show off } } Connection { Type Signal SrcComponent "ki" SrcTerminal 2 DstComponent "Integrator" DstTerminal 1 } Connection { Type Signal SrcComponent "kp" SrcTerminal 2 Points [290, 45; 290, 75] DstComponent "Sum" DstTerminal 2 } Connection { Type Signal SrcComponent "Integrator" SrcTerminal 2 Points [290, 125; 290, 95] DstComponent "Sum" DstTerminal 4 } Connection { Type Signal SrcComponent "Sum" SrcTerminal 1 DstComponent "w" DstTerminal 1 } Connection { Type Signal SrcComponent "w0" SrcTerminal 1 DstComponent "Sum" DstTerminal 3 } Connection { Type Signal SrcComponent "error" SrcTerminal 1 Points [90, 85] Branch { Points [90, 45] DstComponent "kp" DstTerminal 1 } Branch { Points [90, 125] DstComponent "ki" DstTerminal 1 } } } } Component { Type CScript Name "Wrapping\nIntegrator" Show on Position [420, 75] Direction up Flipped off Parameter { Variable "NumInputs" Value "1" Show off } Parameter { Variable "NumOutputs" Value "1" Show off } Parameter { Variable "NumContStates" Value "1" Show off } Parameter { Variable "NumDiscStates" Value "0" Show off } Parameter { Variable "NumZCSignals" Value "2" Show off } Parameter { Variable "DirectFeedthrough" Value "0" Show off } Parameter { Variable "Ts" Value "0" Show off } Parameter { Variable "Parameters" Value "0, 2*pi" Show off } Parameter { Variable "LangStandard" Value "2" Show off } Parameter { Variable "GnuExtensions" Value "1" Show off } Parameter { Variable "RuntimeCheck" Value "1" Show off } Parameter { Variable "Declarations" Value "#define LOWER_LIMIT ParamRealData(0, 0)\n#d" "efine UPPER_LIMIT ParamRealData(1, 0)" Show off } Parameter { Variable "StartFcn" Value "ContState(0) = 0;" Show off } Parameter { Variable "OutputFcn" Value "if (IsMajorStep)\n{\n while (ContState(0) " "> UPPER_LIMIT)\n ContState(0) -= UPPER_LIMIT-LOWER_LIMIT;\n while (ContSt" "ate(0) < LOWER_LIMIT)\n ContState(0) += UPPER_LIMIT-LOWER_LIMIT;\n}\n\nZCS" "ignal(0) = ContState(0)-UPPER_LIMIT;\nZCSignal(1) = ContState(0)-LOWER_LIMIT;" "\n\nOutput(0) = ContState(0);" Show off } Parameter { Variable "UpdateFcn" Value "" Show off } Parameter { Variable "DerivativeFcn" Value "ContDeriv(0) = Input(0);" Show off } Parameter { Variable "TerminateFcn" Value "" Show off } } Component { Type Output Name "phi" Show on Position [510, 75] Direction right Flipped off Parameter { Variable "Index" Value "2" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Gain Name "Gain" Show on Position [70, 160] Direction right Flipped off Parameter { Variable "K" Value "-1" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Gain Name "Gain1" Show on Position [70, 130] Direction right Flipped off Parameter { Variable "K" Value "-1" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Connection { Type Signal SrcComponent "3ph" SrcTerminal 1 DstComponent "3ph->SRF" DstTerminal 1 } Connection { Type Signal SrcComponent "3ph->SRF" SrcTerminal 2 DstComponent "Product" DstTerminal 2 } Connection { Type Signal SrcComponent "Product" SrcTerminal 1 DstComponent "Sum" DstTerminal 2 } Connection { Type Signal SrcComponent "Mux" SrcTerminal 1 DstComponent "Product" DstTerminal 3 } Connection { Type Signal SrcComponent "Sum" SrcTerminal 1 DstComponent "Frequency\nController" DstTerminal 1 } Connection { Type Signal SrcComponent "Frequency\nController" SrcTerminal 2 DstComponent "Wrapping\nIntegrator" DstTerminal 1 } Connection { Type Signal SrcComponent "Wrapping\nIntegrator" SrcTerminal 2 Points [470, 75] Branch { Points [470, 190; 35, 190; 35, 160] Branch { Points [35, 130] DstComponent "Gain1" DstTerminal 1 } Branch { DstComponent "Gain" DstTerminal 1 } } Branch { DstComponent "phi" DstTerminal 1 } } Connection { Type Signal SrcComponent "Trigonometric\nFunction1" SrcTerminal 2 DstComponent "Mux" DstTerminal 2 } Connection { Type Signal SrcComponent "Trigonometric\nFunction" SrcTerminal 2 DstComponent "Mux" DstTerminal 3 } Connection { Type Signal SrcComponent "Gain" SrcTerminal 2 DstComponent "Trigonometric\nFunction" DstTerminal 1 } Connection { Type Signal SrcComponent "Gain1" SrcTerminal 2 DstComponent "Trigonometric\nFunction1" DstTerminal 1 } } } Component { Type Reference SrcComponent "Components/Control/Transformations/3ph->RRF" Name "3ph->RRF1" Show on Position [250, 105] Direction up Flipped off Frame [-15, -15; 15, 15] LabelPosition [0, 18] LabelAlign up Terminal { Type Input Position [-15, -5] Direction left } Terminal { Type Output Position [19, 0] Direction right } Terminal { Type Input Position [-15, 5] Direction left } } Connection { Type Signal SrcComponent "w" SrcTerminal 1 DstComponent "w_f" DstTerminal 1 } Connection { Type Signal SrcComponent "PLL" SrcTerminal 2 Points [200, 165] Branch { DstComponent "theta_f" DstTerminal 1 } Branch { Points [200, 110] Branch { DstComponent "3ph->RRF1" DstTerminal 3 } Branch { Points [200, 50] DstComponent "3ph->RRF" DstTerminal 3 } } } Connection { Type Signal SrcComponent "3ph->RRF" SrcTerminal 2 DstComponent "I_fdq" DstTerminal 1 } Connection { Type Signal SrcComponent "E_f" SrcTerminal 1 Points [100, 100] Branch { DstComponent "3ph->RRF1" DstTerminal 1 } Branch { Points [100, 165] DstComponent "PLL" DstTerminal 1 } } Connection { Type Signal SrcComponent "I_f" SrcTerminal 1 DstComponent "3ph->RRF" DstTerminal 1 } Connection { Type Signal SrcComponent "3ph->RRF1" SrcTerminal 2 DstComponent "E_fdq" DstTerminal 1 } } } Component { Type Subsystem Name "id controller" Show on Position [330, 170] Direction down Flipped off Frame [-35, -40; 35, 40] LabelPosition [0, 43] LabelAlign up SampleTime "-1" CodeGenTarget "Generic" MaskIconFrame on MaskIconOpaque off MaskIconRotates on Terminal { Type Output Position [39, 0] Direction right } Terminal { Type Input Position [-35, 30] Direction left } Terminal { Type Input Position [-35, -10] Direction left } Terminal { Type Input Position [-35, -30] Direction left } Terminal { Type Input Position [-35, 10] Direction left } Schematic { Location [572, 308; 1076, 626] ZoomFactor 1 SliderPosition [-2, 0] ShowBrowser off BrowserWidth 100 Component { Type Sum Name "Sum" Show off Position [160, 115] Direction up Flipped off Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "+-|" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Integrator Name "Integrator" Show off Position [315, 145] Direction left Flipped on Parameter { Variable "ExternalReset" Value "1" Show off } Parameter { Variable "InitialConditionSource" Value "1" Show off } Parameter { Variable "x0" Value "0" Show off } Parameter { Variable "ShowStatePort" Value "1" Show off } Parameter { Variable "UpperLimit" Value "inf" Show off } Parameter { Variable "LowerLimit" Value "-inf" Show off } } Component { Type Sum Name "Sum2" Show off Position [355, 115] Direction up Flipped on Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "+|+" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Gain Name "Gain" Show off Position [255, 145] Direction left Flipped on Parameter { Variable "K" Value "K_gc_id" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Gain Name "Gain1" Show off Position [255, 85] Direction right Flipped off Parameter { Variable "K" Value "K_gc_pd" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Sum Name "Sum7" Show off Position [410, 115] Direction up Flipped off Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "+++" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Gain Name "Gain6" Show off Position [215, 175] Direction right Flipped off Parameter { Variable "K" Value "-R_gc_a" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Gain Name "Gain7" Show off Position [215, 255] Direction right Flipped off Parameter { Variable "K" Value "-L_f" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Sum Name "Sum9" Show off Position [280, 215] Direction up Flipped on Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "++" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Product Name "Product2" Show on Position [155, 255] Direction up Flipped off Parameter { Variable "Inputs" Value "2" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Output Name "V_fd*" Show on Position [455, 115] Direction right Flipped off Parameter { Variable "Index" Value "1" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Input Name "w_f" Show on Position [50, 260] Direction right Flipped off Parameter { Variable "Index" Value "2" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Input Name "I_fdq" Show on Position [50, 120] Direction right Flipped off Parameter { Variable "Index" Value "3" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Input Name "I_fd*" Show on Position [50, 80] Direction right Flipped off Parameter { Variable "Index" Value "4" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Input Name "E_fdq" Show on Position [50, 45] Direction right Flipped off Parameter { Variable "Index" Value "5" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type SignalDemux Name "Demux" Show off Position [95, 120] Direction right Flipped on Parameter { Variable "Width" Value "2" Show off } } Component { Type SignalDemux Name "Demux1" Show off Position [100, 45] Direction right Flipped on Parameter { Variable "Width" Value "2" Show off } } Connection { Type Signal SrcComponent "Sum" SrcTerminal 1 Points [205, 115] Branch { Points [205, 145] DstComponent "Gain" DstTerminal 1 } Branch { Points [205, 85] DstComponent "Gain1" DstTerminal 1 } } Connection { Type Signal SrcComponent "Gain" SrcTerminal 2 DstComponent "Integrator" DstTerminal 1 } Connection { Type Signal SrcComponent "Integrator" SrcTerminal 2 Points [355, 145] DstComponent "Sum2" DstTerminal 2 } Connection { Type Signal SrcComponent "Sum2" SrcTerminal 1 DstComponent "Sum7" DstTerminal 3 } Connection { Type Signal SrcComponent "Gain1" SrcTerminal 2 Points [355, 85] DstComponent "Sum2" DstTerminal 3 } Connection { Type Signal SrcComponent "Product2" SrcTerminal 1 DstComponent "Gain7" DstTerminal 1 } Connection { Type Signal SrcComponent "Gain7" SrcTerminal 2 Points [280, 255] DstComponent "Sum9" DstTerminal 2 } Connection { Type Signal SrcComponent "Sum7" SrcTerminal 1 DstComponent "V_fd*" DstTerminal 1 } Connection { Type Signal SrcComponent "w_f" SrcTerminal 1 DstComponent "Product2" DstTerminal 3 } Connection { Type Signal SrcComponent "I_fd*" SrcTerminal 1 Points [160, 80] DstComponent "Sum" DstTerminal 2 } Connection { Type Signal SrcComponent "Sum9" SrcTerminal 1 Points [410, 215] DstComponent "Sum7" DstTerminal 4 } Connection { Type Signal SrcComponent "I_fdq" SrcTerminal 1 DstComponent "Demux" DstTerminal 1 } Connection { Type Signal SrcComponent "Demux" SrcTerminal 2 Points [125, 115] Branch { DstComponent "Sum" DstTerminal 3 } Branch { Points [125, 175] DstComponent "Gain6" DstTerminal 1 } } Connection { Type Signal SrcComponent "Demux" SrcTerminal 3 Points [110, 125; 110, 250] DstComponent "Product2" DstTerminal 2 } Connection { Type Signal SrcComponent "E_fdq" SrcTerminal 1 DstComponent "Demux1" DstTerminal 1 } Connection { Type Signal SrcComponent "Demux1" SrcTerminal 2 Points [410, 40] DstComponent "Sum7" DstTerminal 2 } Connection { Type Signal SrcComponent "Gain6" SrcTerminal 2 Points [280, 175] DstComponent "Sum9" DstTerminal 3 } } } Component { Type Subsystem Name "iq controller" Show on Position [330, 70] Direction down Flipped off Frame [-35, -40; 35, 40] LabelPosition [0, -43] LabelAlign down SampleTime "-1" CodeGenTarget "Generic" MaskIconFrame on MaskIconOpaque off MaskIconRotates on Terminal { Type Output Position [39, 10] Direction right } Terminal { Type Input Position [-35, 10] Direction left } Terminal { Type Input Position [-35, -30] Direction left } Terminal { Type Input Position [-35, 30] Direction left } Terminal { Type Input Position [-35, -10] Direction left } Schematic { Location [571, 306; 1077, 624] ZoomFactor 1 SliderPosition [1, 0] ShowBrowser off BrowserWidth 100 Component { Type Sum Name "Sum1" Show off Position [160, 110] Direction up Flipped off Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "+-|" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Integrator Name "Integrator1" Show off Position [315, 140] Direction left Flipped on Parameter { Variable "ExternalReset" Value "1" Show off } Parameter { Variable "InitialConditionSource" Value "1" Show off } Parameter { Variable "x0" Value "0" Show off } Parameter { Variable "ShowStatePort" Value "1" Show off } Parameter { Variable "UpperLimit" Value "inf" Show off } Parameter { Variable "LowerLimit" Value "-inf" Show off } } Component { Type Sum Name "Sum3" Show off Position [355, 110] Direction up Flipped on Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "+|+" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Gain Name "Gain2" Show off Position [255, 140] Direction left Flipped on Parameter { Variable "K" Value "K_gc_iq" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Gain Name "Gain3" Show off Position [255, 80] Direction right Flipped off Parameter { Variable "K" Value "K_gc_pq" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Sum Name "Sum4" Show off Position [410, 110] Direction up Flipped off Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "+++" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Gain Name "Gain4" Show off Position [210, 180] Direction right Flipped off Parameter { Variable "K" Value "-R_gc_a" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Gain Name "Gain5" Show off Position [210, 260] Direction right Flipped off Parameter { Variable "K" Value "L_f" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Sum Name "Sum5" Show off Position [255, 220] Direction up Flipped on Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "++" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Product Name "Product1" Show on Position [150, 260] Direction up Flipped off Parameter { Variable "Inputs" Value "2" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Output Name "V_fq*" Show on Position [455, 110] Direction right Flipped off Parameter { Variable "Index" Value "1" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Input Name "w_f" Show on Position [50, 265] Direction right Flipped off Parameter { Variable "Index" Value "2" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Input Name "I_fdq" Show on Position [50, 115] Direction right Flipped off Parameter { Variable "Index" Value "3" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Input Name "I_fq*" Show on Position [50, 75] Direction right Flipped off Parameter { Variable "Index" Value "4" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Input Name "E_fdq" Show on Position [50, 40] Direction right Flipped off Parameter { Variable "Index" Value "5" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type SignalDemux Name "Demux" Show off Position [130, 40] Direction right Flipped on Parameter { Variable "Width" Value "2" Show off } } Component { Type SignalDemux Name "Demux1" Show off Position [90, 115] Direction left Flipped off Parameter { Variable "Width" Value "2" Show off } } Connection { Type Signal SrcComponent "Sum1" SrcTerminal 1 Points [205, 110] Branch { Points [205, 140] DstComponent "Gain2" DstTerminal 1 } Branch { Points [205, 80] DstComponent "Gain3" DstTerminal 1 } } Connection { Type Signal SrcComponent "Gain2" SrcTerminal 2 DstComponent "Integrator1" DstTerminal 1 } Connection { Type Signal SrcComponent "Integrator1" SrcTerminal 2 Points [355, 140] DstComponent "Sum3" DstTerminal 2 } Connection { Type Signal SrcComponent "Sum3" SrcTerminal 1 DstComponent "Sum4" DstTerminal 3 } Connection { Type Signal SrcComponent "Gain3" SrcTerminal 2 Points [355, 80] DstComponent "Sum3" DstTerminal 3 } Connection { Type Signal SrcComponent "Product1" SrcTerminal 1 DstComponent "Gain5" DstTerminal 1 } Connection { Type Signal SrcComponent "Gain5" SrcTerminal 2 Points [255, 260] DstComponent "Sum5" DstTerminal 2 } Connection { Type Signal SrcComponent "Sum4" SrcTerminal 1 DstComponent "V_fq*" DstTerminal 1 } Connection { Type Signal SrcComponent "w_f" SrcTerminal 1 DstComponent "Product1" DstTerminal 3 } Connection { Type Signal SrcComponent "I_fq*" SrcTerminal 1 Points [160, 75] DstComponent "Sum1" DstTerminal 2 } Connection { Type Signal SrcComponent "Sum5" SrcTerminal 1 Points [410, 220] DstComponent "Sum4" DstTerminal 4 } Connection { Type Signal SrcComponent "E_fdq" SrcTerminal 1 DstComponent "Demux" DstTerminal 1 } Connection { Type Signal SrcComponent "Demux" SrcTerminal 3 Points [410, 45] DstComponent "Sum4" DstTerminal 2 } Connection { Type Signal SrcComponent "Demux1" SrcTerminal 3 Points [125, 110] Branch { DstComponent "Sum1" DstTerminal 3 } Branch { Points [125, 180] DstComponent "Gain4" DstTerminal 1 } } Connection { Type Signal SrcComponent "I_fdq" SrcTerminal 1 DstComponent "Demux1" DstTerminal 1 } Connection { Type Signal SrcComponent "Demux1" SrcTerminal 2 Points [110, 120; 110, 255] DstComponent "Product1" DstTerminal 2 } Connection { Type Signal SrcComponent "Gain4" SrcTerminal 2 Points [255, 180] DstComponent "Sum5" DstTerminal 3 } } } Component { Type Reference SrcComponent "Components/Control/Transformations/RRF->3ph" Name "RRF->3ph" Show off Position [205, 125] Direction down Flipped off Frame [-15, -15; 15, 15] LabelPosition [0, -18] LabelAlign down Terminal { Type Input Position [-15, -5] Direction left } Terminal { Type Output Position [19, 0] Direction right } Terminal { Type Input Position [-15, 5] Direction left } } Component { Type Input Name "Eg" Show on Position [640, 70] Direction left Flipped off Parameter { Variable "Index" Value "1" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Input Name "Ig" Show on Position [640, 110] Direction left Flipped off Parameter { Variable "Index" Value "2" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Input Name "Vdc" Show on Position [640, 190] Direction left Flipped off Parameter { Variable "Index" Value "3" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Product Name "Divide" Show off Position [140, 130] Direction down Flipped on Parameter { Variable "Inputs" Value "*/" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Saturation Name "Saturation" Show off Position [90, 130] Direction right Flipped on Parameter { Variable "UpperLimit" Value "0.5" Show off } Parameter { Variable "LowerLimit" Value "-0.5" Show off } } Component { Type Subsystem Name "Voltage\ncontroller" Show on Position [460, 200] Direction down Flipped off Frame [-35, -20; 35, 20] LabelPosition [0, -23] LabelAlign down SampleTime "-1" CodeGenTarget "Generic" MaskIconFrame on MaskIconOpaque off MaskIconRotates on Terminal { Type Output Position [39, 0] Direction right } Terminal { Type Input Position [-35, 10] Direction left } Terminal { Type Input Position [-35, -10] Direction left } Schematic { Location [695, 248; 1283, 450] ZoomFactor 1 SliderPosition [0, 1] ShowBrowser off BrowserWidth 100 Component { Type Output Name "I_fd*" Show on Position [545, 85] Direction right Flipped off Parameter { Variable "Index" Value "1" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Input Name "V_dc" Show on Position [40, 85] Direction right Flipped off Parameter { Variable "Index" Value "2" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Input Name "V_dc*" Show on Position [40, 30] Direction right Flipped off Parameter { Variable "Index" Value "3" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Sum Name "Sum" Show off Position [95, 85] Direction up Flipped off Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "+-|" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Integrator Name "Integrator" Show off Position [345, 115] Direction left Flipped on Parameter { Variable "ExternalReset" Value "1" Show off } Parameter { Variable "InitialConditionSource" Value "1" Show off } Parameter { Variable "x0" Value "-500" Show off } Parameter { Variable "ShowStatePort" Value "1" Show off } Parameter { Variable "UpperLimit" Value "inf" Show off } Parameter { Variable "LowerLimit" Value "-inf" Show off } } Component { Type Sum Name "Sum2" Show off Position [385, 85] Direction up Flipped on Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "+|+" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Gain Name "Gain1" Show off Position [235, 55] Direction right Flipped off Parameter { Variable "K" Value "K_gc_pW" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Saturation Name "Saturation" Show off Position [460, 85] Direction right Flipped off Parameter { Variable "UpperLimit" Value "I_f_max" Show off } Parameter { Variable "LowerLimit" Value "-I_f_max" Show off } } Component { Type Sum Name "Sum3" Show off Position [415, 160] Direction down Flipped off Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "|+-" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Gain Name "Gain3" Show off Position [345, 160] Direction right Flipped on Parameter { Variable "K" Value "K_gc_b" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Sum Name "Sum4" Show off Position [290, 115] Direction up Flipped off Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "|++" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Gain Name "Gain" Show off Position [235, 115] Direction left Flipped on Parameter { Variable "K" Value "K_gc_iW" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type Gain Name "Gain2" Show off Position [150, 85] Direction right Flipped off Parameter { Variable "K" Value "-1" Show off } Parameter { Variable "Multiplication" Value "1" Show off } Parameter { Variable "DataType" Value "11" Show off } } Connection { Type Signal SrcComponent "Integrator" SrcTerminal 2 Points [385, 115] DstComponent "Sum2" DstTerminal 2 } Connection { Type Signal SrcComponent "Gain1" SrcTerminal 2 Points [385, 55] DstComponent "Sum2" DstTerminal 3 } Connection { Type Signal SrcComponent "Sum3" SrcTerminal 1 DstComponent "Gain3" DstTerminal 1 } Connection { Type Signal SrcComponent "Gain3" SrcTerminal 2 Points [290, 160] DstComponent "Sum4" DstTerminal 3 } Connection { Type Signal SrcComponent "Gain" SrcTerminal 2 DstComponent "Sum4" DstTerminal 2 } Connection { Type Signal SrcComponent "Sum4" SrcTerminal 1 DstComponent "Integrator" DstTerminal 1 } Connection { Type Signal SrcComponent "Sum2" SrcTerminal 1 Points [415, 85] Branch { DstComponent "Saturation" DstTerminal 1 } Branch { DstComponent "Sum3" DstTerminal 3 } } Connection { Type Signal SrcComponent "Sum" SrcTerminal 1 DstComponent "Gain2" DstTerminal 1 } Connection { Type Signal SrcComponent "Gain2" SrcTerminal 2 Points [190, 85] Branch { Points [190, 55] DstComponent "Gain1" DstTerminal 1 } Branch { Points [190, 115] DstComponent "Gain" DstTerminal 1 } } Connection { Type Signal SrcComponent "V_dc*" SrcTerminal 1 Points [95, 30] DstComponent "Sum" DstTerminal 2 } Connection { Type Signal SrcComponent "V_dc" SrcTerminal 1 DstComponent "Sum" DstTerminal 3 } Connection { Type Signal SrcComponent "Saturation" SrcTerminal 2 Points [500, 85] Branch { DstComponent "I_fd*" DstTerminal 1 } Branch { Points [500, 160] DstComponent "Sum3" DstTerminal 2 } } } } Component { Type Constant Name "V_dc*" Show on Position [540, 210] Direction right Flipped on Frame [-10, -10; 10, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "Value" Value "V_dc" Show off } Parameter { Variable "DataType" Value "10" Show off } } Component { Type Output Name "Vabc*" Show on Position [35, 130] Direction right Flipped on Parameter { Variable "Index" Value "4" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Reference SrcComponent "Components/Control/Filters/Periodic Average" Name "Periodic Average" Show off Position [590, 70] Direction down Flipped on Frame [-15, -15; 15, 15] LabelPosition [0, 18] LabelAlign up Parameter { Variable "T_average" Value "1/f_sw/num_sm" Show off } Terminal { Type Output Position [19, 0] Direction right } Terminal { Type Input Position [-15, 0] Direction left } } Component { Type Reference SrcComponent "Components/Control/Filters/Periodic Average" Name "Periodic Average1" Show off Position [590, 110] Direction down Flipped on Frame [-15, -15; 15, 15] LabelPosition [0, 18] LabelAlign up Parameter { Variable "T_average" Value "1/f_sw/num_sm" Show off } Terminal { Type Output Position [19, 0] Direction right } Terminal { Type Input Position [-15, 0] Direction left } } Component { Type Reference SrcComponent "Components/Control/Filters/Periodic Average" Name "Periodic Average2" Show off Position [590, 190] Direction down Flipped on Frame [-15, -15; 15, 15] LabelPosition [0, 18] LabelAlign up Parameter { Variable "T_average" Value "1/f_sw" Show off } Terminal { Type Output Position [19, 0] Direction right } Terminal { Type Input Position [-15, 0] Direction left } } Connection { Type Signal SrcComponent "id controller" SrcTerminal 1 Points [280, 170; 280, 145] DstComponent "Mux4" DstTerminal 2 } Connection { Type Signal SrcComponent "iq controller" SrcTerminal 1 Points [280, 60; 280, 135] DstComponent "Mux4" DstTerminal 3 } Connection { Type Signal SrcComponent "I_fq*" SrcTerminal 1 DstComponent "iq controller" DstTerminal 4 } Connection { Type Signal SrcComponent "Measurements\ntransformation" SrcTerminal 1 Points [405, 100] Branch { DstComponent "iq controller" DstTerminal 3 } Branch { Points [405, 180] DstComponent "id controller" DstTerminal 3 } } Connection { Type Signal SrcComponent "Measurements\ntransformation" SrcTerminal 2 Points [395, 80] Branch { Points [395, 160] DstComponent "id controller" DstTerminal 5 } Branch { DstComponent "iq controller" DstTerminal 5 } } Connection { Type Signal SrcComponent "Measurements\ntransformation" SrcTerminal 6 Points [385, 60] Branch { Points [385, 140] DstComponent "id controller" DstTerminal 2 } Branch { DstComponent "iq controller" DstTerminal 2 } } Connection { Type Signal SrcComponent "RRF->3ph" SrcTerminal 2 DstComponent "Divide" DstTerminal 2 } Connection { Type Signal SrcComponent "Divide" SrcTerminal 1 DstComponent "Saturation" DstTerminal 1 } Connection { Type Signal SrcComponent "Mux4" SrcTerminal 1 Points [240, 140; 240, 130] DstComponent "RRF->3ph" DstTerminal 1 } Connection { Type Signal SrcComponent "V_dc*" SrcTerminal 1 DstComponent "Voltage\ncontroller" DstTerminal 3 } Connection { Type Signal SrcComponent "Voltage\ncontroller" SrcTerminal 1 DstComponent "id controller" DstTerminal 4 } Connection { Type Signal SrcComponent "Eg" SrcTerminal 1 DstComponent "Periodic Average" DstTerminal 2 } Connection { Type Signal SrcComponent "Periodic Average" SrcTerminal 1 DstComponent "Measurements\ntransformation" DstTerminal 4 } Connection { Type Signal SrcComponent "Ig" SrcTerminal 1 DstComponent "Periodic Average1" DstTerminal 2 } Connection { Type Signal SrcComponent "Periodic Average1" SrcTerminal 1 DstComponent "Measurements\ntransformation" DstTerminal 5 } Connection { Type Signal SrcComponent "Vdc" SrcTerminal 1 DstComponent "Periodic Average2" DstTerminal 2 } Connection { Type Signal SrcComponent "Periodic Average2" SrcTerminal 1 Points [565, 190] Branch { DstComponent "Voltage\ncontroller" DstTerminal 2 } Branch { Points [565, 245; 175, 245; 175, 135] DstComponent "Divide" DstTerminal 3 } } Connection { Type Signal SrcComponent "Saturation" SrcTerminal 2 DstComponent "Vabc*" DstTerminal 1 } Connection { Type Signal SrcComponent "Measurements\ntransformation" SrcTerminal 3 DstComponent "RRF->3ph" DstTerminal 3 } } } Component { Type Subsystem Name "HVDC" Show on Position [130, 110] Direction up Flipped off Frame [-45, -65; 45, 65] LabelPosition [0, 68] LabelAlign up SampleTime "-1" CodeGenSampleTime "T_HIL" CodeGenTarget "Generic" CodeGenAbsTimeUsageMsg "1" MaskIconFrame on MaskIconOpaque off MaskIconRotates on Terminal { Type Output Position [49, -40] Direction right } Terminal { Type Output Position [49, -55] Direction right } Terminal { Type Output Position [49, -25] Direction right } Terminal { Type Input Position [-45, -20] Direction left } Terminal { Type Output Position [49, -10] Direction right } Terminal { Type Output Position [49, 5] Direction right } Schematic { Location [0, 31; 1920, 996] ZoomFactor 0.5625 SliderPosition [0, 0] ShowBrowser off BrowserWidth 100 Component { Type Inductor Name "LA+ I" Show on Position [375, 540] Direction up Flipped off Parameter { Variable "L" Value "L_arm" Show off } Parameter { Variable "i_init" Value "0" Show off } } Component { Type Inductor Name "LA- I" Show on Position [375, 700] Direction up Flipped off Parameter { Variable "L" Value "L_arm" Show off } Parameter { Variable "i_init" Value "0" Show off } } Component { Type Inductor Name "LgA I" Show on Position [165, 590] Direction left Flipped on Parameter { Variable "L" Value "L_g" Show off } Parameter { Variable "i_init" Value "0" Show off } } Component { Type Inductor Name "LB+ I" Show on Position [775, 540] Direction up Flipped off Parameter { Variable "L" Value "L_arm" Show off } Parameter { Variable "i_init" Value "0" Show off } } Component { Type Inductor Name "LB- I" Show on Position [775, 700] Direction up Flipped off Parameter { Variable "L" Value "L_arm" Show off } Parameter { Variable "i_init" Value "0" Show off } } Component { Type Inductor Name "LgB I" Show on Position [165, 620] Direction left Flipped on Parameter { Variable "L" Value "L_g" Show off } Parameter { Variable "i_init" Value "0" Show off } } Component { Type Inductor Name "LC+ I" Show on Position [1310, 540] Direction up Flipped off Parameter { Variable "L" Value "L_arm" Show off } Parameter { Variable "i_init" Value "0" Show off } } Component { Type Inductor Name "LC- I" Show on Position [1310, 700] Direction up Flipped off Parameter { Variable "L" Value "L_arm" Show off } Parameter { Variable "i_init" Value "0" Show off } } Component { Type Inductor Name "LgC I" Show on Position [165, 650] Direction left Flipped on Parameter { Variable "L" Value "L_g" Show off } Parameter { Variable "i_init" Value "0" Show off } } Component { Type Resistor Name "RA+ I" Show on Position [375, 585] Direction up Flipped off Parameter { Variable "R" Value "R_arm" Show off } } Component { Type Resistor Name "RB+ I" Show on Position [775, 585] Direction up Flipped off Parameter { Variable "R" Value "R_arm" Show off } } Component { Type Resistor Name "RC+ I" Show on Position [1310, 585] Direction up Flipped off Parameter { Variable "R" Value "R_arm" Show off } } Component { Type Resistor Name "RA- I" Show on Position [375, 655] Direction up Flipped off Parameter { Variable "R" Value "R_arm" Show off } } Component { Type Resistor Name "RB- I" Show on Position [775, 655] Direction up Flipped off Parameter { Variable "R" Value "R_arm" Show off } } Component { Type Resistor Name "RC- I" Show on Position [1310, 655] Direction up Flipped off Parameter { Variable "R" Value "R_arm" Show off } } Component { Type Resistor Name "RgA I" Show on Position [205, 590] Direction left Flipped on Parameter { Variable "R" Value "R_g" Show off } } Component { Type Resistor Name "RgB I" Show on Position [205, 620] Direction left Flipped on Parameter { Variable "R" Value "R_g" Show off } } Component { Type Resistor Name "RgC I" Show on Position [205, 650] Direction left Flipped on Parameter { Variable "R" Value "R_g" Show off } } Component { Type Output Name "Ig I" Show on Position [80, 575] Direction right Flipped on Parameter { Variable "Index" Value "1" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Output Name "Eg I" Show on Position [80, 540] Direction right Flipped on Parameter { Variable "Index" Value "2" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Output Name "Vdc I" Show on Position [1600, 590] Direction right Flipped on Parameter { Variable "Index" Value "3" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Capacitor Name "CA- I" Show on Position [435, 1045] Direction down Flipped on Parameter { Variable "C" Value "C_sm_vectoruno" Show off } Parameter { Variable "v_init" Value "V_sm_vectoruno" Show off } } Component { Type Voltmeter Name "Vm1" Show off Position [465, 1065] Direction up Flipped off } Component { Type SignalDemux Name "Demux" Show off Position [135, 415] Direction right Flipped on Parameter { Variable "Width" Value "[num_sm num_sm]" Show off } } Component { Type Capacitor Name "CA+ I" Show on Position [445, 415] Direction down Flipped on Parameter { Variable "C" Value "C_sm_vectoruno" Show off } Parameter { Variable "v_init" Value "V_sm_vectoruno" Show off } } Component { Type Voltmeter Name "Vm2" Show off Position [480, 400] Direction up Flipped off } Component { Type SignalDemux Name "Demux1" Show off Position [235, 1045] Direction right Flipped on Parameter { Variable "Width" Value "[num_sm num_sm]" Show off } } Component { Type SignalDemux Name "Demux2" Show off Position [650, 420] Direction right Flipped on Parameter { Variable "Width" Value "[num_sm num_sm]" Show off } } Component { Type Capacitor Name "CB+ I" Show on Position [835, 420] Direction down Flipped on Parameter { Variable "C" Value "C_sm_vectoruno" Show off } Parameter { Variable "v_init" Value "V_sm_vectoruno" Show off } } Component { Type Voltmeter Name "Vm3" Show off Position [855, 400] Direction up Flipped off } Component { Type SignalDemux Name "Demux3" Show off Position [670, 1045] Direction right Flipped on Parameter { Variable "Width" Value "[num_sm num_sm]" Show off } } Component { Type Capacitor Name "CB- I" Show on Position [835, 1045] Direction down Flipped on Parameter { Variable "C" Value "C_sm_vectoruno" Show off } Parameter { Variable "v_init" Value "V_sm_vectoruno" Show off } } Component { Type Voltmeter Name "Vm4" Show off Position [855, 1065] Direction up Flipped off } Component { Type SignalDemux Name "Demux4" Show off Position [1190, 425] Direction right Flipped on Parameter { Variable "Width" Value "[num_sm num_sm]" Show off } } Component { Type Capacitor Name "CC+ I" Show on Position [1370, 425] Direction down Flipped on Parameter { Variable "C" Value "C_sm_vectoruno" Show off } Parameter { Variable "v_init" Value "V_sm_vectoruno" Show off } } Component { Type Voltmeter Name "Vm5" Show off Position [1390, 405] Direction up Flipped off } Component { Type SignalDemux Name "Demux5" Show off Position [1195, 1045] Direction right Flipped on Parameter { Variable "Width" Value "[num_sm num_sm]" Show off } } Component { Type Capacitor Name "CC- I" Show on Position [1370, 1045] Direction down Flipped on Parameter { Variable "C" Value "C_sm_vectoruno" Show off } Parameter { Variable "v_init" Value "V_sm_vectoruno" Show off } } Component { Type Voltmeter Name "Vm6" Show off Position [1390, 1065] Direction up Flipped off } Component { Type Ammeter Name "Am1" Show off Position [375, 80] Direction down Flipped on } Component { Type Ammeter Name "Am2" Show off Position [375, 1120] Direction down Flipped on } Component { Type Ammeter Name "Am3" Show off Position [775, 75] Direction down Flipped on } Component { Type Ammeter Name "Am4" Show off Position [775, 1120] Direction down Flipped on } Component { Type Ammeter Name "Am5" Show off Position [1310, 75] Direction down Flipped on } Component { Type Ammeter Name "Am6" Show off Position [1310, 1120] Direction down Flipped on } Component { Type From Name "From1" Show off Position [85, 65] Direction right Flipped off Parameter { Variable "Tag" Value "IarmA+" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type SignalMux Name "Mux2" Show off Position [110, 90] Direction right Flipped off Parameter { Variable "Width" Value "6" Show off } } Component { Type From Name "From2" Show off Position [45, 75] Direction right Flipped off Parameter { Variable "Tag" Value "IarmA-" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type From Name "From3" Show off Position [85, 85] Direction right Flipped off Parameter { Variable "Tag" Value "IarmB+" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type From Name "From4" Show off Position [45, 95] Direction right Flipped off Parameter { Variable "Tag" Value "IarmB-" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type From Name "From5" Show off Position [85, 105] Direction right Flipped off Parameter { Variable "Tag" Value "IarmC+" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type From Name "From6" Show off Position [45, 115] Direction right Flipped off Parameter { Variable "Tag" Value "IarmC-" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type From Name "From7" Show off Position [85, 150] Direction right Flipped off Parameter { Variable "Tag" Value "VcA+" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type SignalMux Name "Mux3" Show off Position [110, 175] Direction right Flipped off Parameter { Variable "Width" Value "[num_sm num_sm num_sm num_sm num_sm num_sm]" Show off } } Component { Type From Name "From8" Show off Position [50, 160] Direction right Flipped off Parameter { Variable "Tag" Value "VcA-" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type From Name "From9" Show off Position [85, 170] Direction right Flipped off Parameter { Variable "Tag" Value "VcB+" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type From Name "From10" Show off Position [50, 180] Direction right Flipped off Parameter { Variable "Tag" Value "VcB-" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type From Name "From11" Show off Position [85, 190] Direction right Flipped off Parameter { Variable "Tag" Value "VcC+" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type From Name "From12" Show off Position [50, 200] Direction right Flipped off Parameter { Variable "Tag" Value "VcC-" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type Goto Name "Goto" Show off Position [345, 80] Direction right Flipped on Parameter { Variable "Tag" Value "IarmA+" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type Goto Name "Goto1" Show off Position [615, 350] Direction right Flipped off Parameter { Variable "Tag" Value "VcA+" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type Goto Name "Goto2" Show off Position [340, 1120] Direction right Flipped on Parameter { Variable "Tag" Value "IarmA-" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type Goto Name "Goto4" Show off Position [725, 75] Direction right Flipped on Parameter { Variable "Tag" Value "IarmB+" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type Goto Name "Goto6" Show off Position [740, 1120] Direction right Flipped on Parameter { Variable "Tag" Value "IarmB-" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type Goto Name "Goto8" Show off Position [1275, 75] Direction right Flipped on Parameter { Variable "Tag" Value "IarmC+" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type Goto Name "Goto10" Show off Position [1275, 1120] Direction right Flipped on Parameter { Variable "Tag" Value "IarmC-" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type Voltmeter Name "Vm7" Show off Position [1645, 590] Direction down Flipped on } Component { Type ThreePhaseVoltageSource Name "AC System I" Show on Position [80, 620] Direction up Flipped off Parameter { Variable "V" Value "V_gpeak" Show off } Parameter { Variable "w" Value "f_g" Show off } Parameter { Variable "phi" Value "0" Show off } Parameter { Variable "neutral" Value "1" Show off } } Component { Type Subsystem Name "Modulator\nVc Balance" Show on Position [190, 90] Direction down Flipped on Frame [-40, -50; 40, 50] LabelPosition [0, -53] LabelAlign down SampleTime "-1" CodeGenTarget "Generic" MaskIconFrame on MaskIconOpaque off MaskIconRotates on Terminal { Type Output Position [-44, -40] Direction left } Terminal { Type Output Position [-44, -25] Direction left } Terminal { Type Output Position [-44, -10] Direction left } Terminal { Type Output Position [-44, 5] Direction left } Terminal { Type Output Position [-44, 20] Direction left } Terminal { Type Output Position [-44, 35] Direction left } Terminal { Type Input Position [40, -35] Direction right } Terminal { Type Input Position [40, 35] Direction right } Terminal { Type Input Position [40, 0] Direction right } Schematic { Location [697, 44; 1320, 554] ZoomFactor 1 SliderPosition [-1, 0] ShowBrowser off BrowserWidth 100 Component { Type Output Name "SwA+" Show on Position [50, 55] Direction left Flipped off Parameter { Variable "Index" Value "1" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Subsystem Name "PWMa1" Show on Position [230, 55] Direction down Flipped off Frame [-30, -20; 30, 20] LabelPosition [0, -23] LabelAlign down SampleTime "-1" CodeGenTarget "Generic" MaskIconFrame on MaskIconOpaque off MaskIconRotates on Terminal { Type Output Position [34, 0] Direction right } Terminal { Type Input Position [-30, -10] Direction left } Terminal { Type Input Position [-30, 0] Direction left } Terminal { Type Input Position [-30, 10] Direction left } Schematic { Location [801, 617; 1280, 779] ZoomFactor 1 SliderPosition [0, 6] ShowBrowser off BrowserWidth 100 Component { Type TriangleGenerator Name "Triangular Wave6" Show off Position [210, 95] Direction left Flipped on Parameter { Variable "Min" Value "carrier_min" Show off } Parameter { Variable "Max" Value "carrier_max" Show off } Parameter { Variable "f" Value "f_sw" Show off } Parameter { Variable "DutyCycle" Value "0.5" Show off } Parameter { Variable "Delay" Value "0" Show off } } Component { Type RelationalOperator Name "Relational\nOperator6" Show off Position [270, 70] Direction right Flipped off Parameter { Variable "Operator" Value "5" Show off } } Component { Type Constant Name "Constant" Show off Position [195, 35] Direction left Flipped on Frame [-10, -10; 10, 10] LabelPosition [0, -13] LabelAlign down Parameter { Variable "Value" Value "0.5" Show off } Parameter { Variable "DataType" Value "10" Show off } } Component { Type Sum Name "Sum" Show off Position [215, 65] Direction up Flipped on Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "|++" Show off } Parameter { Variable "DataType" Value "11" Show off } } Component { Type SignalSelector Name "Cont\nSelector" Show off Position [170, 65] Direction right Flipped off Parameter { Variable "InputWidth" Value "1" Show off } Parameter { Variable "OutputIndices" Value "ones(1, num_sm)" Show off } } Component { Type ZeroOrderHold Name "Zero-Order\nHold" Show off Position [120, 65] Direction right Flipped off Parameter { Variable "Ts" Value "1/f_sw" Show off } } Component { Type ConfigurableSubsystem Name "Vc balance" Show on Position [345, 80] Direction up Flipped off Frame [-20, -20; 20, 20] LabelPosition [0, -23] LabelAlign down SampleTime "-1" CodeGenTarget "Generic" MaskIconFrame on MaskIconOpaque off MaskIconRotates on Parameter { Variable "f_sw" Prompt "Sample frequency [Hz]" Type FreeText Value "f_sw" Show off Tunable off TabName "" } Parameter { Variable "num_module" Prompt "Numer of modules" Type FreeText Value "num_sm" Show off Tunable off TabName "" } Terminal { Type Input Position [-20, -10] Direction left } Terminal { Type Output Position [24, 0] Direction right } Terminal { Type Input Position [-20, 0] Direction left } Terminal { Type Input Position [-20, 10] Direction left } TerminalNames { "PWM", "Out", "Vc", "Ic" } Location [492, 615; 794, 795] ZoomFactor 1 SliderPosition [0, 0] ShowBrowser off BrowserWidth 100 Configurations { Name "Sorting" Schematic { Component { Type Input Name "PWM" Show on Position [60, 50] Direction right Flipped off Parameter { Variable "Index" Value "1" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Output Name "Out" Show on Position [245, 80] Direction right Flipped off Parameter { Variable "Index" Value "2" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type CScript Name "Sorting" Show on Position [175, 80] Direction up Flipped off Parameter { Variable "NumInputs" Value "2*num_module+1" Show off } Parameter { Variable "NumOutputs" Value "num_module" Show off } Parameter { Variable "NumContStates" Value "0" Show off } Parameter { Variable "NumDiscStates" Value "0" Show off } Parameter { Variable "NumZCSignals" Value "0" Show off } Parameter { Variable "DirectFeedthrough" Value "1" Show off } Parameter { Variable "Ts" Value "[0, 0; 1/f_sw, 0]" Show off } Parameter { Variable "Parameters" Value "num_module" Show off } Parameter { Variable "LangStandard" Value "2" Show off } Parameter { Variable "GnuExtensions" Value "1" Show off } Parameter { Variable "RuntimeCheck" Value "2" Show off } Parameter { Variable "Declarations" Value "#include \n#include \n#include \n\ntypedef struct\n{\n\tint index_cap;\n double v_cap" ";\n} module;\n\nstatic int num_module;\nstatic module *module_array = NULL;\n" "static int *output_index_array;" Show off } Parameter { Variable "StartFcn" Value "num_module = ParamRealData(0,0);\n\nm" "odule_array = (module*) malloc(num_module*sizeof(module));\noutput_index_arra" "y = (int*) malloc(num_module*sizeof(int));\n\nfor(int index=0; index=0)\n\t\t{\n\t\t\tf" "or(int index_a=0; index_a module_array[index_a].v_cap)\n\t\t\t\t\t{\n\t\t\t\t\t\tmodule" " module_temp;\n\t\t\t\t\t\tmodule_temp.index_cap = module_array[index_b].inde" "x_cap;\n\t\t\t\t\t\tmodule_temp.v_cap = module_array[index_b].v_cap;\n\t\t\t" "\t\t\n\t\t\t\t\t\tmodule_array[index_b].index_cap = module_array[index_a].ind" "ex_cap;\n\t\t\t\t\t\tmodule_array[index_b].v_cap = module_array[index_a].v_ca" "p;\n\t\t\t\t\t\n\t\t\t\t\t\tmodule_array[index_a].index_cap = module_temp.ind" "ex_cap;\n\t\t\t\t\t\tmodule_array[index_a].v_cap = module_temp.v_cap;\n\t\t\t" "\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\tfor(int index = 0;index\n#include \n#include \n\ntypedef struct\n{\n\tint index_cap;\n double v_cap" ";\n} module;\n\nstatic int num_module;\nstatic module *module_array = NULL;\n" "static int *output_index_array;" Show off } Parameter { Variable "StartFcn" Value "num_module = ParamRealData(0,0);\n\nm" "odule_array = (module*) malloc(num_module*sizeof(module));\noutput_index_arra" "y = (int*) malloc(num_module*sizeof(int));\n\nfor(int index=0; index=0)\n\t\t{\n\t\t\tf" "or(int index_a=0; index_a module_array[index_a].v_cap)\n\t\t\t\t\t{\n\t\t\t\t\t\tmodule" " module_temp;\n\t\t\t\t\t\tmodule_temp.index_cap = module_array[index_b].inde" "x_cap;\n\t\t\t\t\t\tmodule_temp.v_cap = module_array[index_b].v_cap;\n\t\t\t" "\t\t\n\t\t\t\t\t\tmodule_array[index_b].index_cap = module_array[index_a].ind" "ex_cap;\n\t\t\t\t\t\tmodule_array[index_b].v_cap = module_array[index_a].v_ca" "p;\n\t\t\t\t\t\n\t\t\t\t\t\tmodule_array[index_a].index_cap = module_temp.ind" "ex_cap;\n\t\t\t\t\t\tmodule_array[index_a].v_cap = module_temp.v_cap;\n\t\t\t" "\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\tfor(int index = 0;index\n#include \n#include \n\ntypedef struct\n{\n\tint index_cap;\n double v_cap" ";\n} module;\n\nstatic int num_module;\nstatic module *module_array = NULL;\n" "static int *output_index_array;" Show off } Parameter { Variable "StartFcn" Value "num_module = ParamRealData(0,0);\n\nm" "odule_array = (module*) malloc(num_module*sizeof(module));\noutput_index_arra" "y = (int*) malloc(num_module*sizeof(int));\n\nfor(int index=0; index=0)\n\t\t{\n\t\t\tf" "or(int index_a=0; index_a module_array[index_a].v_cap)\n\t\t\t\t\t{\n\t\t\t\t\t\tmodule" " module_temp;\n\t\t\t\t\t\tmodule_temp.index_cap = module_array[index_b].inde" "x_cap;\n\t\t\t\t\t\tmodule_temp.v_cap = module_array[index_b].v_cap;\n\t\t\t" "\t\t\n\t\t\t\t\t\tmodule_array[index_b].index_cap = module_array[index_a].ind" "ex_cap;\n\t\t\t\t\t\tmodule_array[index_b].v_cap = module_array[index_a].v_ca" "p;\n\t\t\t\t\t\n\t\t\t\t\t\tmodule_array[index_a].index_cap = module_temp.ind" "ex_cap;\n\t\t\t\t\t\tmodule_array[index_a].v_cap = module_temp.v_cap;\n\t\t\t" "\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\tfor(int index = 0;index\n#include \n#include \n\ntypedef struct\n{\n\tint index_cap;\n double v_cap" ";\n} module;\n\nstatic int num_module;\nstatic module *module_array = NULL;\n" "static int *output_index_array;" Show off } Parameter { Variable "StartFcn" Value "num_module = ParamRealData(0,0);\n\nm" "odule_array = (module*) malloc(num_module*sizeof(module));\noutput_index_arra" "y = (int*) malloc(num_module*sizeof(int));\n\nfor(int index=0; index=0)\n\t\t{\n\t\t\tf" "or(int index_a=0; index_a module_array[index_a].v_cap)\n\t\t\t\t\t{\n\t\t\t\t\t\tmodule" " module_temp;\n\t\t\t\t\t\tmodule_temp.index_cap = module_array[index_b].inde" "x_cap;\n\t\t\t\t\t\tmodule_temp.v_cap = module_array[index_b].v_cap;\n\t\t\t" "\t\t\n\t\t\t\t\t\tmodule_array[index_b].index_cap = module_array[index_a].ind" "ex_cap;\n\t\t\t\t\t\tmodule_array[index_b].v_cap = module_array[index_a].v_ca" "p;\n\t\t\t\t\t\n\t\t\t\t\t\tmodule_array[index_a].index_cap = module_temp.ind" "ex_cap;\n\t\t\t\t\t\tmodule_array[index_a].v_cap = module_temp.v_cap;\n\t\t\t" "\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\tfor(int index = 0;index\n#include \n#include \n\ntypedef struct\n{\n\tint index_cap;\n double v_cap" ";\n} module;\n\nstatic int num_module;\nstatic module *module_array = NULL;\n" "static int *output_index_array;" Show off } Parameter { Variable "StartFcn" Value "num_module = ParamRealData(0,0);\n\nm" "odule_array = (module*) malloc(num_module*sizeof(module));\noutput_index_arra" "y = (int*) malloc(num_module*sizeof(int));\n\nfor(int index=0; index=0)\n\t\t{\n\t\t\tf" "or(int index_a=0; index_a module_array[index_a].v_cap)\n\t\t\t\t\t{\n\t\t\t\t\t\tmodule" " module_temp;\n\t\t\t\t\t\tmodule_temp.index_cap = module_array[index_b].inde" "x_cap;\n\t\t\t\t\t\tmodule_temp.v_cap = module_array[index_b].v_cap;\n\t\t\t" "\t\t\n\t\t\t\t\t\tmodule_array[index_b].index_cap = module_array[index_a].ind" "ex_cap;\n\t\t\t\t\t\tmodule_array[index_b].v_cap = module_array[index_a].v_ca" "p;\n\t\t\t\t\t\n\t\t\t\t\t\tmodule_array[index_a].index_cap = module_temp.ind" "ex_cap;\n\t\t\t\t\t\tmodule_array[index_a].v_cap = module_temp.v_cap;\n\t\t\t" "\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\tfor(int index = 0;index\n#include \n#include \n\ntypedef struct\n{\n\tint index_cap;\n double v_cap" ";\n} module;\n\nstatic int num_module;\nstatic module *module_array = NULL;\n" "static int *output_index_array;" Show off } Parameter { Variable "StartFcn" Value "num_module = ParamRealData(0,0);\n\nm" "odule_array = (module*) malloc(num_module*sizeof(module));\noutput_index_arra" "y = (int*) malloc(num_module*sizeof(int));\n\nfor(int index=0; index=0)\n\t\t{\n\t\t\tf" "or(int index_a=0; index_a module_array[index_a].v_cap)\n\t\t\t\t\t{\n\t\t\t\t\t\tmodule" " module_temp;\n\t\t\t\t\t\tmodule_temp.index_cap = module_array[index_b].inde" "x_cap;\n\t\t\t\t\t\tmodule_temp.v_cap = module_array[index_b].v_cap;\n\t\t\t" "\t\t\n\t\t\t\t\t\tmodule_array[index_b].index_cap = module_array[index_a].ind" "ex_cap;\n\t\t\t\t\t\tmodule_array[index_b].v_cap = module_array[index_a].v_ca" "p;\n\t\t\t\t\t\n\t\t\t\t\t\tmodule_array[index_a].index_cap = module_temp.ind" "ex_cap;\n\t\t\t\t\t\tmodule_array[index_a].v_cap = module_temp.v_cap;\n\t\t\t" "\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\tfor(int index = 0;index