# Hysteresis Loop in MATLAB

1. ### vinzie

19
Hi there,

Would anyone help me in simulating hysteresis loop in MATLAB?

Thank You!

2. ### rbj

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

3. ### vinzie

19
I meant the hysteresis loop of a ferromagnetic substance

4. ### vatlychatran

23
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.