Plecs { Name "function_example" Version "4.6" CircuitModel "ContStateSpace" StartTime "0.0" TimeSpan "1.0" Timeout "" Solver "auto" 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" AlgebraicLoopWithStateMachineMsg "3" AssertionAction "1" InitializationCommands "\nN=432;\nA=64;\nl=178e-6;\nRc=0.0003;\nB=0.016;\nT=" "310;\npo2=28;\nph2=9;\nz1=-0.853;\nz3=7.6*10^-5;\nz4=-1.93*10^-4;\nsi=23;\nJn" "=3e-3;\nJmax=469e-3;\n\n\n\nE_N=1.229-((0.85e-3)*(T-298.15))+((4.31*10^-5)*T*" "(log(ph2)+0.5*log(po2)));\nco2=po2/(5.08*10^6*exp(-498/T));\nz2=0.00286+0.000" "2*log(A)+(4.3*10^-5*log(co2));\n\n%Vact=-(z1+z2*T+z3*T*log(co2)+z4*T*log(ifc)" ");\n%rom=181.6*(1+0.03*(ifc/A)+0.062*(T/303)^2*(ifc/A)^2.5)/((si-0.634-3*(ifc" "/A))*exp(4.18*((T-303)/T)));\n%Rm=rom*l/A;\n%Vohmic=ifc*(Rm+Rc);\n%J=(ifc/A);" "\n%Vcon=-(B*log(1-(J/Jmax)));\n%vfc=N*abs(E_N-Vact-Vohmic-Vcon);\n" InitialState "1" SystemState "" TaskingMode "1" TaskConfigurations "" CodeGenParameterInlining "2" 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" ScriptsDialogGeometry "" ScriptsDialogSplitterPos "0" Schematic { Location [177, 297; 1010, 596] ZoomFactor 1 SliderPosition [0, 19] ShowBrowser off BrowserWidth 100 Component { Type Function Name "Vact" Show on Position [330, 100] Direction right Flipped off Frame [-20, -10; 20, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "f(u)" Value "-(z1+z2*T+z3*T*log(co2)+z4*T*log(u))" Show on } } Component { Type Constant Name "ifc" Show on Position [85, 160] Direction right Flipped off Frame [-10, -10; 10, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "Value" Value "1" Show off } Parameter { Variable "DataType" Value "10" Show off } } Component { Type Function Name "Rm" Show on Position [220, 180] Direction right Flipped off Frame [-20, -10; 20, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "f(u)" Value "181.6*(1+0.03*(u/A)+0.062*(T/303)^2*(u/A)^2.5)/((si-0.6" "34-3*(u/A))*exp(4.18*((T-303)/T)))/A" Show off } } Component { Type Function Name "Vcon" Show on Position [330, 225] Direction right Flipped off Frame [-20, -10; 20, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "f(u)" Value "-(B*log(1-((u/A)/Jmax)))" Show off } } Component { Type SignalMux Name "Mux" Show off Position [480, 165] Direction right Flipped off Parameter { Variable "Width" Value "3" Show off } } Component { Type Function Name "vfc" Show on Position [540, 165] Direction right Flipped off Frame [-20, -10; 20, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "f(u)" Value "N*abs(E_N - u[1] - u[2] - u[3])" Show off } } Component { Type Offset Name "Offset" Show on Position [275, 180] Direction right Flipped off Frame [-20, -10; 20, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "Offset" Value "Rc" Show off } Parameter { Variable "DataType" Value "10" Show off } } Component { Type Product Name "Vohmic" Show on Position [330, 165] Direction up Flipped off Parameter { Variable "IconShape" Value "1" Show off } Parameter { Variable "Inputs" Value "**" Show off } Parameter { Variable "DataType" Value "10" Show off } } Component { Type Display Name "output" Show on Position [625, 165] 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 } } Connection { Type Signal SrcComponent "ifc" SrcTerminal 1 Points [150, 160] Branch { Points [150, 100] DstComponent "Vact" DstTerminal 1 } Branch { Points [150, 180] Branch { Points [150, 225] DstComponent "Vcon" DstTerminal 1 } Branch { DstComponent "Rm" DstTerminal 1 } } Branch { DstComponent "Vohmic" DstTerminal 2 } } Connection { Type Signal SrcComponent "Mux" SrcTerminal 1 DstComponent "vfc" DstTerminal 1 } Connection { Type Signal SrcComponent "Rm" SrcTerminal 2 DstComponent "Offset" DstTerminal 1 } Connection { Type Signal SrcComponent "Offset" SrcTerminal 2 DstComponent "Vohmic" DstTerminal 3 } Connection { Type Signal SrcComponent "Vact" SrcTerminal 2 Points [460, 100; 460, 155] DstComponent "Mux" DstTerminal 2 } Connection { Type Signal SrcComponent "Vohmic" SrcTerminal 1 DstComponent "Mux" DstTerminal 3 } Connection { Type Signal SrcComponent "Vcon" SrcTerminal 2 Points [460, 225; 460, 175] DstComponent "Mux" DstTerminal 4 } Connection { Type Signal SrcComponent "vfc" SrcTerminal 2 DstComponent "output" DstTerminal 1 } } } DemoSignature "Mq03rTs2QxfaTBsavLd+TQXeHiquEb5JJN6lyYqak6s="