Question: How to replace a part of an equation with another expression

Hello all, 

Would you tell me how to replace a part of an equation with another expression?

I tried to replace the expression '(1-Lm^2/(Ls*Lr))' in the equation below ('LD') with an expression 'sigma', but no success. 

restart;

LD := Lambda_ds = (-Lm^2/Lr + Ls)*i_ds + Lm*Lambda_dr/Lr;

Lambda_ds = (-Lm^2/Lr+Ls)*i_ds+Lm*Lambda_dr/Lr

(1)

sigma := (1-Lm^2/(Ls*Lr));

1-Lm^2/(Ls*Lr)

(2)

algsubs(1-Lm^2/(Ls*Lr)=ss,LD);

Lambda_ds = (-Lm^2/Lr+Ls)*i_ds+Lm*Lambda_dr/Lr

(3)

subs({(1-Lm^2/(Ls*Lr)) = sigma}, (3));

Lambda_ds = (-Lm^2/Lr+Ls)*i_ds+Lm*Lambda_dr/Lr

(4)

 


 

Download question20200618.mw

Please Wait...