Plecs {
Name "Jiles Atherton trial"
Version "4.1"
CircuitModel "ContStateSpace"
StartTime "0.0"
StopTime "0.02"
Timeout ""
Solver "dopri"
MaxStep "1e-6"
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 ""
InitialState "1"
SystemState ""
CodeGenParameterInlining "2"
CodeGenInliningExceptions "AAAACwAAAAAA"
CodeGenFloatingPointFormat "2"
CodeGenIntegerWordSize "32"
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 [126, 387; 712, 702]
ZoomFactor 1
SliderPosition [0, 0]
ShowBrowser off
BrowserWidth 100
Component {
Type CScript
Name "C-Script"
Show on
Position [235, 105]
Direction up
Flipped off
Parameter {
Variable "NumInputs"
Value "2"
Show off
}
Parameter {
Variable "NumOutputs"
Value "2"
Show off
}
Parameter {
Variable "NumContStates"
Value "0"
Show off
}
Parameter {
Variable "NumDiscStates"
Value "3"
Show off
}
Parameter {
Variable "NumZCSignals"
Value "1"
Show off
}
Parameter {
Variable "DirectFeedthrough"
Value "1"
Show off
}
Parameter {
Variable "Ts"
Value "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\n#include\n\n#define f 50\n#d"
"efine Ms 4.0481e5\n#define a 17.7019\n#define alpha 2e-5\n#define c 0.3210\n"
"#define k 12.5882\n#define Mu 1.256e-6;\n\n#define M_OUT DiscState(0)\n#defin"
"e B_OUT DiscState(1)\n#define H_OUT DiscState(2)\n\n#define H Input(0)\n#defi"
"ne dH Input(1)\n#define B Output(0)\n\n\nstatic double dt;\nstatic double len"
";\nstatic double Mirr;\nstatic double M;\nstatic double Man;\nstatic double l"
"astHe;\nstatic double delta;\nstatic double He;\nstatic double dHe;\nstatic d"
"ouble dMan;\nstatic double dM;\nstatic double dMirr;\n"
Show off
}
Parameter {
Variable "StartFcn"
Value "dt = 1/(f*1000);\nlen = round(2/(f*dt));\nMirr = 0;\nM "
"= 0;\nMan = 0;\nlastHe = 0;\nif (dH>0)\n\tdelta = 1;\nelse\n\tdelta = -1;\nHe"
" = H+alpha*Man;\ndHe = H-lastHe;\nMan = Ms*(1/tanh((H+alpha*Man)/a)-a/(H+alph"
"a*Man));\ndMan = Ms*dHe*(1-(1/pow(tanh((H+alpha*Man)/a),2))+pow((a/(H+alpha*M"
"an)),2))/a;\ndM = ((1-c)*(Man-M)*dH+c*delta*k*dMan)/(delta*k-alpha*(1-c)*(Man"
"-M));\ndMirr = (dM-c*dMirr)/(1-c);\nMirr = Mirr+dMirr;\nM = c*Man+(1-c)*Mirr;"
"\nlastHe = He;\n\n"
Show off
}
Parameter {
Variable "OutputFcn"
Value "B = B_OUT;\nOutputSignal(0,1) = H_OUT;\n\t\n\t\n\t\n\t"
"\n\t\n\t\n\t\n"
Show off
}
Parameter {
Variable "UpdateFcn"
Value "B_OUT = 1.256e-6*(M + H);\nH_OUT = H;\nM_OUT = M;"
Show off
}
Parameter {
Variable "DerivativeFcn"
Value ""
Show off
}
Parameter {
Variable "TerminateFcn"
Value ""
Show off
}
}
Component {
Type CScript
Name "Derivative"
Show on
Position [120, 110]
Direction up
Flipped off
Parameter {
Variable "NumInputs"
Value "1"
Show off
}
Parameter {
Variable "NumOutputs"
Value "1"
Show off
}
Parameter {
Variable "NumContStates"
Value "0"
Show off
}
Parameter {
Variable "NumDiscStates"
Value "2"
Show off
}
Parameter {
Variable "NumZCSignals"
Value "0"
Show off
}
Parameter {
Variable "DirectFeedthrough"
Value "1"
Show off
}
Parameter {
Variable "Ts"
Value "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 "#define lastTime DiscState(0)\n#define lastInput DiscSt"
"ate(1)\n"
Show off
}
Parameter {
Variable "StartFcn"
Value "lastTime = CurrentTime;\n"
Show off
}
Parameter {
Variable "OutputFcn"
Value "if (lastTime != CurrentTime)\n{\n Output(0) = (Input(0"
") - lastInput)/(CurrentTime - lastTime);\n}\n"
Show off
}
Parameter {
Variable "UpdateFcn"
Value "lastTime = CurrentTime;\nlastInput = Input(0);\n"
Show off
}
Parameter {
Variable "DerivativeFcn"
Value ""
Show off
}
Parameter {
Variable "TerminateFcn"
Value ""
Show off
}
}
Component {
Type SineGenerator
Name "Sine Wave"
Show on
Position [30, 110]
Direction right
Flipped off
Parameter {
Variable "Amplitude"
Value "10"
Show off
}
Parameter {
Variable "Bias"
Value "0"
Show off
}
Parameter {
Variable "Frequency"
Value "50"
Show off
}
Parameter {
Variable "Phase"
Value "0"
Show off
}
Parameter {
Variable "Units"
Value "3"
Show off
}
}
Component {
Type SignalMux
Name "Mux1"
Show off
Position [175, 105]
Direction right
Flipped off
Parameter {
Variable "Width"
Value "2"
Show off
}
}
Component {
Type Scope
Name "Scope3"
Show on
Position [250, 45]
Direction up
Flipped off
Location [0, 26; 1536, 807]
State "AAAA/wAAAAD9AAAAAgAAAAEAAAAAAAAAAPwCAAAAA/sAAAAQAFoAbwBvA"
"G0AQQByAGUAYQAAAAAA/////wAAAD8A////+wAAABQAUwBhAHYAZQBkAFYAaQBlAHcAcwAAAAAA//"
"///wAAAH4A////+wAAAAwAVAByAGEAYwBlAHMAAAAAAP////8AAAB+AP///wAAAAMAAAAAAAAAAPw"
"BAAAAAfsAAAAUAEQAYQB0AGEAVwBpAGQAZwBlAHQAAAAAAP////8AAABbAP///wAAB4AAAAOxAAAA"
"BAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAEAAAAOAFQAbwBvAGwAQgBhAHIBAAAAAP////8AAAAAA"
"AAAAA=="
SavedViews "AAAAAgAAAAA="
HeaderState "AAAA/wAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAL/gMAAAAJAAAAC"
"QAAAH0AAAAIAAAAfQAAAAUAAAB9AAAABAAAAH0AAAAHAAAAfQAAAAYAAAB9AAAAAQAAAH0AAAADAA"
"AAfQAAAAIAAAB9AAAAtwAAAAsBAAABAAAAAAAAAAAAAAAAff////8AAACBAAAAAAAAAAsAAACGAAA"
"AAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAA"
"AAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAA"
"AAxAAAAAQAAAAAAAAPoAA=="
PlotPalettes "AAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
Axes "1"
TimeRange "0.0"
ScrollingMode "1"
SingleTimeAxis "1"
Open "0"
Ts "-1"
SampleLimit "0"
XAxisLabel ""
Axis {
Name ""
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
}
}
}
Component {
Type Scope
Name "Scope2"
Show on
Position [390, 105]
Direction up
Flipped off
Location [512, 220; 1166, 709]
State "AAAA/wAAAAD9AAAAAgAAAAEAAAAAAAAAAPwCAAAAA/sAAAAQAFoAbwBvA"
"G0AQQByAGUAYQAAAAAA/////wAAAG4A////+wAAABQAUwBhAHYAZQBkAFYAaQBlAHcAcwAAAAAA//"
"///wAAAH4A////+wAAAAwAVAByAGEAYwBlAHMAAAAAAP////8AAAB+AP///wAAAAMAAAAAAAAAAPw"
"BAAAAAfsAAAAUAEQAYQB0AGEAVwBpAGQAZwBlAHQAAAAAAP////8AAABbAP///wAAAzIAAAJEAAAA"
"BAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAEAAAAOAFQAbwBvAGwAQgBhAHIBAAAAAP////8AAAAAA"
"AAAAA=="
SavedViews "AAAAAgAAAAA="
HeaderState "AAAA/wAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAL/gMAAAAJAAAAC"
"QAAAH0AAAAIAAAAfQAAAAUAAAB9AAAABAAAAH0AAAAHAAAAfQAAAAYAAAB9AAAAAQAAAH0AAAADAA"
"AAfQAAAAIAAAB9AAAAswAAAAsBAAABAAAAAAAAAAAAAAAAff////8AAACBAAAAAAAAAAsAAACCAAA"
"AAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAA"
"AAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAA"
"AAxAAAAAQAAAAAAAAPoAA=="
PlotPalettes "AAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAA"
"AEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
Axes "2"
TimeRange "0"
ScrollingMode "1"
SingleTimeAxis "1"
Open "0"
Ts "-1"
SampleLimit "0"
XAxisLabel ""
Axis {
Name ""
AutoScale 1
MinValue 0
MaxValue 1
Signals {}
SignalTypes [ ]
Untangle 0
KeepBaseline off
BaselineValue 0
}
Axis {
Name ""
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 SignalDemux
Name "Demux"
Show off
Position [300, 105]
Direction right
Flipped on
Parameter {
Variable "Width"
Value "2"
Show off
}
}
Component {
Type Scope
Name "Scope4"
Show on
Position [210, 175]
Direction up
Flipped off
Location [512, 220; 862, 445]
State "AAAA/wAAAAD9AAAAAgAAAAEAAAAAAAAAAPwCAAAAA/sAAAAQAFoAbwBvA"
"G0AQQByAGUAYQAAAAAA/////wAAAD8A////+wAAABQAUwBhAHYAZQBkAFYAaQBlAHcAcwAAAAAA//"
"///wAAAH4A////+wAAAAwAVAByAGEAYwBlAHMAAAAAAP////8AAAB+AP///wAAAAMAAAAAAAAAAPw"
"BAAAAAfsAAAAUAEQAYQB0AGEAVwBpAGQAZwBlAHQAAAAAAP////8AAABbAP///wAAAbYAAAD6AAAA"
"BAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAEAAAAOAFQAbwBvAGwAQgBhAHIBAAAAAP////8AAAAAA"
"AAAAA=="
SavedViews "AAAAAgAAAAA="
HeaderState "AAAA/wAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAL/gMAAAAJAAAAC"
"QAAAH0AAAAIAAAAfQAAAAUAAAB9AAAABAAAAH0AAAAHAAAAfQAAAAYAAAB9AAAAAQAAAH0AAAADAA"
"AAfQAAAAIAAAB9AAAAtAAAAAsBAAABAAAAAAAAAAAAAAAAff////8AAACBAAAAAAAAAAsAAACDAAA"
"AAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAA"
"AAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAA"
"AAxAAAAAQAAAAAAAAPoAA=="
PlotPalettes "AAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
Axes "1"
TimeRange "0.0"
ScrollingMode "1"
SingleTimeAxis "1"
Open "0"
Ts "-1"
SampleLimit "0"
XAxisLabel ""
Axis {
Name ""
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
}
}
}
Connection {
Type Signal
SrcComponent "Mux1"
SrcTerminal 1
DstComponent "C-Script"
DstTerminal 1
}
Connection {
Type Signal
SrcComponent "Derivative"
SrcTerminal 2
Points [155, 110]
Branch {
DstComponent "Mux1"
DstTerminal 3
}
Branch {
Points [155, 175]
DstComponent "Scope4"
DstTerminal 1
}
}
Connection {
Type Signal
SrcComponent "Sine Wave"
SrcTerminal 1
Points [75, 110]
Branch {
Points [75, 50; 155, 50]
Branch {
Points [155, 100]
DstComponent "Mux1"
DstTerminal 2
}
Branch {
Points [155, 45]
DstComponent "Scope3"
DstTerminal 1
}
}
Branch {
DstComponent "Derivative"
DstTerminal 1
}
}
Connection {
Type Signal
SrcComponent "C-Script"
SrcTerminal 2
DstComponent "Demux"
DstTerminal 1
}
Connection {
Type Signal
SrcComponent "Demux"
SrcTerminal 2
DstComponent "Scope2"
DstTerminal 1
}
Connection {
Type Signal
SrcComponent "Demux"
SrcTerminal 3
DstComponent "Scope2"
DstTerminal 2
}
}
}
DemoSignature "xhMTiqAxwYt9YoqVBhjwWgw/g0YSxueoZdfJJz+jm2Y="