Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func[var_] := Module[{x = var},
- gamma = 176;
- alphag = 0.01;
- alphajConstant = 0.00603;
- p = {Cos[Pi/6], 0, Sin[Pi/6]};
- current[t_] := Simplify`PWToUnitStep@Piecewise[{{3, t <= x}, {(5 - 3)/(150 - x) (t - x) + 3, x < t < 150}, {5, t >= 150}}];
- Beff[t_] := {0, 0, 1.5 - 0.8*(m[t].{0, 0, 1})};
- cons[t_] := -gamma*Cross[m[t], Beff[t]];
- tGilbdamp[t_] := alphag*Cross[m[t], cons[t]];
- tSlondamp[t_] :=
- current[t]*alphajConstant*gamma*Cross[m[t], Cross[m[t], p]];
- equ= {m'[t] == cons[t] + tGilbdamp[t] + tSlondamp[t], m[0] == {0, 0, 1}};
- sol1 = NDSolve[equ, {m}, {t, 0, 200}, MaxSteps -> [Infinity]];
- mm[t_] = m[t] /. sol1[[1]];
- Print[Plot[mm[t][[1]], {t, 0, 200}]];];
- LaunchKernels[2]
- ParallelEvaluate[func[50], Kernels[][[1]]]
- ParallelEvaluate[func[100], Kernels[][[2]]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement