The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Integrating the Langevin formula
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Labog

1 Posts

Posted - 09/18/2013 :  12:00:39 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin):
Operating System:

Hi

I would like to fit some measured magnetisation data using an integral of the Langevin formula multiplied by log normal. I am new to writing functions to fit, so I wanted to try by just re-writing the Langevin formula but I can't even get this to work!

I want to use something of the form
M = Ms*((cosh(A*r*H)/sinh(A*r*H))-1/A*r*H)
where H is the dependent variable and r is varied to give the best fit to the data. I have defined Ms=4.8E5, A=6.1E20, r = 9e(-9). When I try to evaluate this in the function builder it doesn't give me a value, and when fitting it does not produce a fit that converges.

Please help!

Hideo Fujii

USA
1582 Posts

Posted - 09/23/2013 :  12:33:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Labog,

The definition itself seems correct. I don't know the range of H (which is, I guess, an independent variable, not dependent, and M is), but for example, when H=1e-50, your function returns 8.7431693989071E42 .

Sinh may easily overflow such that:
sinh(700)=5.071160273675E303
sinh(750)=--
using tanh might help to avoid overflowing.

Hope this helps.

--Hideo Fujii
OriginLab
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000