Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Modsq[z_] := ComplexExpand[Re[z]]^2 + ComplexExpand[Im[z]]^2;
- SHGfit[A_, P_, B_, [Phi]_] := Modsq[A*P + B*Exp[I*[Phi]]]
- P[T_, B_, Tc_] := 1/(T - Tc)^B
- data={{22, 8325.33}, {75, 6112.66}, {125, 4495.},
- {175, 2948.66}, {225, 1847.66}, {275, 798.33},
- {300, 504.}, {325, 357.}, {350, 279.66}, {375, 223.}, {395, 192.}}
- g = NonlinearModelFit[data, {SHGfit[A, P[t, [Gamma], Tc], B, [Phi]], [Gamma] < 0, Tc > 300},
- {{A, -0.7}, {[Gamma], -0.8}, {[Phi], 2.29}, {Tc, 379}, {B, -34.8}}, t,
- WorkingPrecision -> 25];
- Show[Plot[g[t], {t, 20, 500}, PlotRange -> All, PlotStyle -> {Red, Thickness[0.01]},
- AxesStyle -> {{Thick, Black}, {Thick, Black}},
- TicksStyle -> {{Large, Black}, {Large, Black}},
- AxesLabel -> {Style["Temperature", Bold, 16],
- Style["!(*SubscriptBox[(I), (SHG)])", Bold, 16]}, ImageSize -> Large],
- ListPlot[data, PlotStyle -> {PointSize[0.02], Black}]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement