Plecs { Name "fsol_finding_x1_x2" Version "4.0" CircuitModel "ContStateSpace" StartTime "0.0" StopTime "1.0" Solver "dopri" MaxStep "1e-3" InitStep "-1" FixedStep "1e-3" Refine "1" ZCStepSize "1e-9" RelTol "1e-3" AbsTol "-1" TurnOnThreshold "0" SyncFixedStepTasks "2" UseSingleCommonBaseRate "2" LossVariableLimitExceededMsg "3" NegativeSwitchLossMsg "3" DivisionByZeroMsg "3" StiffnessDetectionMsg "2" MaxConsecutiveZCs "1000" AssertionAction "1" InitializationCommands "input=1000;" InitialState "1" SystemState "" CodeGenParameterInlining "2" CodeGenInliningExceptions "AAAACwAAAAAA" CodeGenFloatingPointFormat "2" CodeGenIntegerWordSize "32" CodeGenAbsTimeUsageMsg "3" CodeGenBaseName "" CodeGenOutputDir "" CodeGenExtraOpts "" CodeGenTarget "Generic" CodeGenTargetSettings "" ExtendedMatrixPrecision "1" MatrixSignificanceCheck "2" ExternalModeSettings "" Schematic { Location [369, 164; 1701, 719] ZoomFactor 1 SliderPosition [0, 0] ShowBrowser off BrowserWidth 100 Component { Type CScript Name "finding x1 x2" Show on Position [460, 480] Direction up Flipped off Parameter { Variable "NumInputs" Value "1" Show off } Parameter { Variable "NumOutputs" Value "1" Show off } Parameter { Variable "NumContStates" Value "4" 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]" Show off } Parameter { Variable "Parameters" Value "" Show off } Parameter { Variable "LangStandard" Value "2" Show off } Parameter { Variable "RuntimeCheck" Value "2" Show off } Parameter { Variable "Declarations" Value "#include\t\n#include \n#include \n\n//#define x0 ([0 0]);\ndouble x1;\ndouble x2;\n#define x0 InputSignal" "(0,0)\n\n" Show off } Parameter { Variable "StartFcn" Value "" Show off } Parameter { Variable "OutputFcn" Value "\n\n//options = optimoptions('fsolve','Algorithm','trus" "t-region-reflective');\n[y,fval] = fsolve(@(x) [2*x(1)-x(2)-exp(-x(1)); -x(1)" "+2*x(2)-exp(-x(2))],x0);\n\n//x1=t(1);\n//x2=t(2);\n\n" Show off } Parameter { Variable "UpdateFcn" Value "" Show off } Parameter { Variable "DerivativeFcn" Value "" Show off } Parameter { Variable "TerminateFcn" Value "" Show off } } Component { Type Constant Name "'x0'" Show on Position [330, 480] Direction right Flipped off Frame [-20, -10; 20, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "Value" Value "[0 0]" Show off } } Component { Type Display Name "Display1" Show on Position [575, 480] Direction up Flipped off Frame [-31, -11; 31, 11] LabelPosition [0, 14] LabelAlign up Parameter { Variable "Notation" Value "1" Show off } Parameter { Variable "Precision" Value "4" Show off } } Component { Type Subsystem Name "find x1 & x2" Show on Position [445, 265] Direction up Flipped off Frame [-60, -20; 60, 20] LabelPosition [0, 23] LabelAlign up SampleTime "-1" CodeGenTarget "Generic" MaskIconFrame on MaskIconOpaque off MaskIconRotates on MaskInit "\n\n%V=Vdc*2;\n\n\n%options = optimoptions('fsolve','Algo" "rithm','trust-region-reflective');\n[y,fval] = fsolve(@(x) [2*x(1)-x(2)-exp(-" "x(1)); -x(1)+2*x(2)-exp(-x(2))],x0);\n\nx1=y(1);\nx2=y(2);\n\n\n" Parameter { Variable "x0" Prompt "x0" Type FreeText Value "I don't want read them from here " Show off Tunable off TabName "" } Terminal { Type Input Position [-60, -10] Direction left } Terminal { Type Output Position [64, 10] Direction right } Terminal { Type Output Position [64, -10] Direction right } Schematic { Location [485, 316; 1765, 1277] ZoomFactor 1 SliderPosition [257, 0] ShowBrowser off BrowserWidth 100 Component { Type Input Name "x0" Show on Position [275, 170] Direction right Flipped off Parameter { Variable "Index" Value "1" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Output Name "x1" Show on Position [525, 130] Direction right Flipped off Parameter { Variable "Index" Value "2" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Function Name "I0(T)2" Show on Position [390, 130] Direction right Flipped off Frame [-20, -10; 20, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "f(u)" Value "x1" Show on } } Component { Type Function Name "I0(T)1" Show on Position [395, 205] Direction right Flipped off Frame [-20, -10; 20, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "f(u)" Value "x2" Show on } } Component { Type Output Name "x2" Show on Position [525, 205] Direction right Flipped off Parameter { Variable "Index" Value "3" Show on } Parameter { Variable "Width" Value "-1" Show off } } Connection { Type Signal SrcComponent "I0(T)2" SrcTerminal 2 DstComponent "x1" DstTerminal 1 } Connection { Type Signal SrcComponent "x0" SrcTerminal 1 Points [320, 170] } Connection { Type Signal SrcComponent "I0(T)1" SrcTerminal 2 DstComponent "x2" DstTerminal 1 } } } Component { Type Constant Name "x0" Show on Position [295, 255] Direction right Flipped off Frame [-20, -10; 20, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "Value" Value "[-5 -5]" Show off } } Component { Type Display Name "Display" Show on Position [590, 265] Direction up Flipped off Frame [-31, -11; 31, 11] LabelPosition [0, 14] LabelAlign up Parameter { Variable "Notation" Value "1" Show off } Parameter { Variable "Precision" Value "4" Show off } } Component { Type SignalMux Name "Mux" Show off Position [530, 265] Direction right Flipped off Parameter { Variable "Width" Value "2" Show off } } Connection { Type Signal SrcComponent "'x0'" SrcTerminal 1 DstComponent "finding x1 x2" DstTerminal 1 } Connection { Type Signal SrcComponent "finding x1 x2" SrcTerminal 2 DstComponent "Display1" DstTerminal 1 } Connection { Type Signal SrcComponent "x0" SrcTerminal 1 DstComponent "find x1 & x2" DstTerminal 1 } Connection { Type Signal SrcComponent "find x1 & x2" SrcTerminal 3 Points [515, 255] DstComponent "Mux" DstTerminal 2 } Connection { Type Signal SrcComponent "find x1 & x2" SrcTerminal 2 Points [515, 275] DstComponent "Mux" DstTerminal 3 } Connection { Type Signal SrcComponent "Mux" SrcTerminal 1 DstComponent "Display" DstTerminal 1 } Annotation { Name "I want to read them from here" Position [290, 230] } Annotation { Name "I want to read them from here" Position [320, 445] } Annotation { Name "OR" Position [180, 365] } } }