clear; // *** 鉄の実験値 *** XFe = fscanfMat("ReducedFe.txt"); plot(XFe(:,1), XFe(:,2), '.r'); // *** ニッケルの実験値 *** XNi = fscanfMat("ReducedNi.txt"); plot(XNi(:,1), XNi(:,2), '.g'); // *** コバルトの実験値 *** XCo = fscanfMat("ReducedCo.txt"); plot(XCo(:,1), XCo(:,2),'.b'); // *** 物性 *** // 磁気モーメント m0 = 1; // キュリー温度 tc = 1; // 還元温度 t = T/Tc t_vec = tc ./ (linspace(0, 1.2 * tc) + %eps); // *** 磁気モーメントの温度依存性 *** function y = func2(M) y = tanh(M * t) - M endfunction for i = 1:length(t_vec) t = t_vec(i); M0 = 1; M(i) = fsolve(M0, func2); end // *** グラフのプロット *** plot(tc * 1 ./ t_vec, m0 * M, '--k'); // グラフの装飾 xlabel("Temperature"); ylabel("Magnetic Moment"); zoom_rect([0, 0, 1.2 * tc, 1.2 * m0]); xgrid(color("gray")); legend(["Iron", "Nickel", "Cobalt", "Mean field approximation"], 3);