Julia equivalent for python scipy.optimize.fsolve

There are various packages for symbolic manipulations, but that’s probably overkill for this application.

I am curious about the context here. If one is talking about a single linear system, it is trivial to transcribe it to a matrix form. If, on the other hand, one needs to solve a lot of linear systems, it is hard to imagine that they come in the general form and not as a matrix equation.

julia> A = [3 5 2;
       2 5 -4;
       4 -1 5];

julia> b = [12, 9, -3];

julia> Rational.(A) \ Rational.(b)
3-element Array{Rational{Int64},1}:
 -33//37
  99//37
  24//37

You may want to use Rational{BigInt} in general though.

That said, I am wondering if you misunderstand what Julia is for: while various packages address this, Julia in general is not a CAS like Maple, Mathematica, or Maxima.

5 Likes