0

For example I have been given some equations and the solution is asked in terms of y/x = only numbers and z.

w1=-x+w2+w3,
w2=(z^-1)*x+2*w3,
w3=(z^-1)*w2+(z^-1)*y,
y=2*w1

I would like to see the solution to be done like this: (y/x = some equation only in terms of z and numbers)

y/x=(-2+6*(z^-1)+2*(z^-2))/(1-8*(z^-1))

Is there a way to do this? Could be code or some function in certain programming languages like matlab.

Thanks in advance.

1 Answers1

0

MATLAB:

The isolate(eqn,expr) function will do this. The given example is, where x is isolated from a*x^2 + b*x + c == 0:

syms x a b c
eqn = a*x^2 + b*x + c == 0;
xSol = isolate(eqn, x)

Output:

xSol =
x == -(b + (b^2 - 4*a*c)^(1/2))/(2*a)

WolframAlpha:

solve(eqn,exp)

e.g. solve(a*x^2 + b*x + c = 0,x) will also re-write the same equation in terms of x.

Alteratively, a WolframAlpha widget exists to do this manually: https://www.wolframalpha.com/widgets/view.jsp?id=3d613c498715c870be91ed38004abc81

Community
  • 1
  • 1
Guy Keogh
  • 549
  • 2
  • 5
  • 15
  • I got the idea but theres something I didnt understand here, this example you shared used only 1 equation while I need to use all of the equations. And I want to isolate all of them as y/x, not x only. Could this be done with this method? – Jangaver 061 Jun 14 '20 at 22:07