# Question:Re: Substituting an expression (different)

## Question:Re: Substituting an expression (different)

Maple 2023

Hello there,

This is another issue, associated with substitution. In the following Maple expressions, I tried to substitutte the denominator of 'eq_K1_m4' in order to make it as 'eq_K1_m4_desired', but did not get any success (yet).

Therefore, would you have a look at this issue to see if the intended goal can be achieved?

 > restart;
 > with(LinearAlgebra):
 > with(DynamicSystems):
 > interface(imaginaryunit=j):
 > eq_K1_m4 := K__1 = E__q0*(R__T*E__B*sin(delta) + X__Td*E__B*cos(delta))/(L__aqs*L__l + L__aqs*X__E + L__aqs*L__ads_p + L__l^2 + 2*L__l*X__E + L__l*L__ads_p + R__E^2 + 2*R__E*R__a + R__a^2 + X__E^2 + X__E*L__ads_p) + (X__q - X__dp)*i__q0*(X__Tq*E__B*sin(delta) - R__T*E__B*cos(delta))/(L__aqs*L__l + L__aqs*X__E + L__aqs*L__ads_p + L__l^2 + 2*L__l*X__E + L__l*L__ads_p + R__E^2 + 2*R__E*R__a + R__a^2 + X__E^2 + X__E*L__ads_p);
 (1)
 > eq_K1_m4_desired := K__1 = E__q0*(R__T*E__B*sin(delta) + X__Td*E__B*cos(delta))/Dx + (X__q - X__dp)*i__q0*(X__Tq*E__B*sin(delta) - R__T*E__B*cos(delta))/Dx;
 (2)
 > eq_Dx := Dx = L__aqs*L__l + L__aqs*X__E + L__aqs*L__ads_p + L__l^2 + 2*L__l*X__E + L__l*L__ads_p + R__E^2 + 2*R__E*R__a + R__a^2 + X__E^2 + X__E*L__ads_p;
 (3)
 > denom(op(1, rhs(eq_K1_m4))) - rhs(eq_Dx); # checking to see if the denominator expression is the same as the expression of Dx
 (4)
 > denom(op(2, rhs(eq_K1_m4))) - rhs(eq_Dx); # checking to see if the denominator expression is the same as the expression of Dx
 (5)
 > # 1
 > map2(applyrule, eq_Dx, eq_K1_m4); # did not work.
 (6)
 > # 2
 > subs(eq_Dx, eq_K1_m4); # did not work.
 (7)
 > # 3
 > simplify(eq_K1_m4, {Dx = L__aqs*L__l + L__aqs*X__E + L__aqs*L__ads_p + L__l^2 + 2*L__l*X__E + L__l*L__ads_p + R__E^2 + 2*R__E*R__a + R__a^2 + X__E^2 + X__E*L__ads_p}, [Dx]); # did not work.
 (8)
 > # 4
 > algsubs(eq_Dx, eq_K1_m4); # did not work.
 (9)
 > # 5
 > applyrule(L__aqs*L__l + L__aqs*X__E + L__aqs*L__ads_p + L__l^2 + 2*L__l*X__E + L__l*L__ads_p + R__E^2 + 2*R__E*R__a + R__a^2 + X__E^2 + X__E*L__ads_p = Dx, eq_K1_m4); # did not work.
 (10)
 >