# Hysteresis Loop in MATLAB

1. Jun 20, 2013

### vinzie

Hi there,

Would anyone help me in simulating hysteresis loop in MATLAB?

Thank You!

2. Jun 20, 2013

### rbj

like a transformer hysteresis loop? without the hysteresis, what does the curve look like?

3. Jun 22, 2013

### vinzie

I meant the hysteresis loop of a ferromagnetic substance

4. Jul 30, 2013

### vatlychatran

You can use Langevin function to describe a hysteresis loop. Exact form of Langervin function you can find out in many textbooks on magnetism.

$M(H)=M_s.[\cosh(c(H+\alpha M))-\dfrac{1}{c(H+αM)}]$

or use this

$M(H)=M_s.\tanh(c(H+\alpha M))$

For the code, It is extremely easy, in ten lines, so try it.