I read some of the journals but most of them has a given Lm or Xm value but from my understanding Lm is not constant when it is loaded. How should I calculate Lm? If so how to do it in MATLAB?
I think you may be looking for a simple explanation . Hope following helps
1 Plot say phase Vm vs Im ( either max or rms ie saturation curve ). (test or calculate) .
2 For desired rated voltage find Im and corresponding average XM = Vmdesired / Im from sat curve.
3 Set Xm (from2 )= Xc and compute cap
4 Intuitive theory from eqvt circuit simplified say xm with series voltage vserfrom rem magnetism )in parallel with rr/s . slip s = 0 at no load so we get only vser. With capacitor on no load we have to match vterminal = imXc with Im*(Xm +vser).
5 To see 4 plot vc= Ic *Xc st line on saturation curve . The intersection point will fetch you the operating point. If you have lag load this will have to be supplied with additional cap value.
There are a host of assumptions and simplifications in the model ie ignoring Hysteresis, Harmonics eddy effects etc only the fundamental is considered and saturation. Note flux linkage lambda vs i (current ) is nonlinear . We can have incremental inductance at an operating point or average (here LM as given by Vm/Im for fundamental). If you intend to simulate steady state using phase eqt cct represent the xm branch as Vm=f(Im) saturation curve. You can see then at Vm=240v we get Im and then Xm=Vm/Im,A dq transient model is a little more complicated.