Function: vpasolve (e)
Function: vpasolve (e, x)
Function: vpasolve (e, x, x0)

Numerical solution of a symbolic equation.

Variable-precision numerical solution of the equation e for variable x using initial guess of x0.

Example:

syms x
eqn = exp(x) == x + 2;
vpasolve(eqn, x, 0.1)
  ⇒ (sym) 1.1461932206205825852370610285214

Systems of equations are supported:

syms x y
eqns = [y*exp(x) == 16; x^5 == x + x*y^2]
  ⇒ eqns = (sym 2×1 matrix)

      ⎡     x       ⎤
      ⎢  y⋅ℯ  = 16  ⎥
      ⎢             ⎥
      ⎢ 5      2    ⎥
      ⎣x  = x⋅y  + x⎦

vpasolve(eqns, [x; y], [1; 1])
  ⇒ (sym 2×1 matrix)

      ⎡1.7324062670465659633407456995303⎤
      ⎢                                 ⎥
      ⎣2.8297332667835974266598942031498⎦

Complex roots can be found but you must provide a complex initial guess:

vpasolve(x^2 + 2 == 0, x, 1i)
  ⇒ (sym) 1.4142135623730950488016887242097⋅ⅈ

See also: vpa.

Package: symbolic