4
$\begingroup$

I am trying to modify a ferromagnetic hysteresis loop to ferrimagnetic hysteresis loop. Below is the equation I used for ferromagnetic simulation :

enter image description here

Below is the code for above equation:

c[h_, b_, s_] := 1/h ArcTanh[b/s]; 
B0[h_, b_, s_, x_] := 
 s  UnitStep[x] ( (
   Tanh[1.3 c[h, b, s] (x - h)] + Tanh[1.3 h c[h, b, s]])/(
   1 + Tanh[1.3 h c[h, b, s]])); 
B1[h_, b_, s_, x_] := s  Tanh[c[h, b, s] (x + h)]; 
B2[h_, b_, s_, x_] := s  Tanh[c[h, b, s] (x - h)]
H[h_, b_, s_, \[Alpha]_] := 
 Which[-200 <= \[Alpha] <= 0, \[Alpha] + 200, 0 <= \[Alpha] < 400, 
  200 - \[Alpha], 400 <= \[Alpha] < 800, \[Alpha] - 600]
B[h_, b_, s_, \[Alpha]_] := 
 Which[-200 <= \[Alpha] <= 0, B0[h, b, s, \[Alpha] + 200], 
  0 <= \[Alpha] <= 400, B1[h, b, s, 200 - \[Alpha]], 
  400 <= \[Alpha] <= 800, B2[h, b, s, \[Alpha] - 600]]
g[h_, b_, s_, \[Alpha]_] := 
 Plot[{B0[h, b, s, x], B1[h, b, s, x], B2[h, b, s, x]}, {x, -200, 
   200}, PlotStyle -> Black, PlotRange -> {{-200, 200}, {-2, 2}}, 
  AxesLabel -> {Row[{H, "  (A/m)"}], Row[{B , "  (T)"}]}, 
  ImageSize -> {550, 250}, 
  Epilog -> 
   Inset[Graphics[{Blue, PointSize[Large], Point[{0, 0}]}], {H[h, b, 
      s, \[Alpha]], B[h, b, s, \[Alpha]]}]]

\[Theta]1[h_, b_, s_, \[Alpha]_] := 
 If[B[h, b, s, \[Alpha]] >= 0, (B[h, b, s, \[Alpha]] - 2) \[Pi]/
   2 , -B[h, b, s, \[Alpha]] \[Pi]/2];  \[Theta]2[h_, b_, 
  s_, \[Alpha]_] := 
 If[B[h, b, s, \[Alpha]] >= 0, (2 - B[h, b, s, \[Alpha]]) \[Pi]/2 , 
  2 \[Pi] + B[h, b, s, \[Alpha]] \[Pi]/2]

Manipulate[
 Column[{g[h, b, s, \[Alpha]], magnet[h, b, s, \[Alpha]]}], {{s, 1.8, 
   Style[Row[{"saturation field ", Subscript[B, S], "  (T)"}]]}, 1.6, 
  2.0, Appearance -> "Labeled"}, {{h, 35, 
   Style[Row[{"coercivity ", Subscript[H, C], "  (A/m)"}]]}, 20, 50, 
  Appearance -> "Labeled"},
 {{b, 1.2, Style[Row[{"remanence ", Subscript[B, R], "  (T)"}]]}, 1, 
  1.5, Appearance -> "Labeled"},
 {{\[Alpha], -200, "cycle magnetic field"}, -200, 795, 1}, 
 TrackedSymbols :> {h, b, s, \[Alpha]}, SaveDefinitions -> True]

I am trying to add additional term to this equation .Below is the modified equation:

enter image description here

I am trying to add the chi term to the manipulate function but not winning. I really appreciate any assistance. Thank you in advance

$\endgroup$

1 Answer 1

5
$\begingroup$

One thing you can do is to modify your definition of the function g[ ]:

g[h_, b_, s_, \[Alpha]_, chi_] := 
Plot[{B0[h, b, s, x] + chi, B1[h, b, s, x] + chi, 
   B2[h, b, s, x] + chi}, {x, -200, 200}, PlotStyle -> Black, 
   PlotRange -> {{-200, 200}, {-3, 3}}, 
   AxesLabel -> {Row[{H, "  (A/m)"}], Row[{B, "  (T)"}]}, 
   ImageSize -> {550, 250}, 
   Epilog -> Inset[Graphics[{Blue, PointSize[Large], 
  Point[{0, 0}]}], {H[h, b, s, \[Alpha]] + chi, B[h, b, s, \[Alpha]] + chi}]]

and then the Manipulate becomes:

Manipulate[g[h, b, s, \[Alpha], chi], 
 {{s, 1.8, Style[Row[{"saturation field ", Subscript[B, S], "  (T)"}]]}, 1.6, 2.0, Appearance -> "Labeled"}, 
{{h, 35,  Style[Row[{"coercivity ", Subscript[H, C], "  (A/m)"}]]}, 20, 50, Appearance -> "Labeled"}, 
{{b, 1.2, tyle[Row[{"remanence ", Subscript[B, R], "  (T)"}]]}, 1, 1.5, Appearance -> "Labeled"}, 
{{\[Alpha], -200, "cycle magnetic field"}, -200, 795, 1}, {chi, -1, 1}]
$\endgroup$
2
  • $\begingroup$ This worked .Thank you for your help. Really appreciate your assistance $\endgroup$ Commented Aug 22, 2022 at 9:02
  • $\begingroup$ Sorry to intrude, do you have an idea for this one? $\endgroup$
    – user21
    Commented Aug 24, 2022 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.