SHARE
TWEET

Untitled

a guest Jun 20th, 2019 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Modsq[z_] := ComplexExpand[Re[z]]^2 + ComplexExpand[Im[z]]^2;
  2. SHGfit[A_, P_, B_, [Phi]_] := Modsq[A*P + B*Exp[I*[Phi]]]
  3. P[T_, B_, Tc_] := 1/(T - Tc)^B
  4.  
  5. data={{22, 8325.33}, {75, 6112.66}, {125, 4495.},
  6.   {175, 2948.66}, {225, 1847.66}, {275, 798.33},
  7.    {300, 504.}, {325, 357.}, {350, 279.66}, {375, 223.}, {395, 192.}}
  8.  
  9. g = NonlinearModelFit[data, {SHGfit[A, P[t, [Gamma], Tc], B, [Phi]], [Gamma] < 0, Tc > 300},
  10.     {{A, -0.7}, {[Gamma], -0.8}, {[Phi], 2.29}, {Tc, 379}, {B, -34.8}}, t,
  11.     WorkingPrecision -> 25];
  12. Show[Plot[g[t], {t, 20, 500}, PlotRange -> All, PlotStyle -> {Red, Thickness[0.01]},
  13.    AxesStyle -> {{Thick, Black}, {Thick, Black}},
  14.    TicksStyle -> {{Large, Black}, {Large, Black}},
  15.    AxesLabel -> {Style["Temperature", Bold, 16],
  16.      Style["!(*SubscriptBox[(I), (SHG)])", Bold, 16]}, ImageSize -> Large],
  17.   ListPlot[data, PlotStyle -> {PointSize[0.02], Black}]]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top