Hi Michael,
On 5 Jun., 18:26, Michael Friedman <
ois3...@gmail.com> wrote:
> I'm pretty new to Sage, so I'm sorry in advance for the trivial
> question.
> I have a set of (non-linear) equations, and I need to find the
> multiplicity of each solution. How do I do it?
First of all, solving a nonlinear eqution is not a trivial question
IMHO.
There are various useful ways of getting help from Sage. One is
"search_def". When I did
sage: search_def('multiplicities')
I got three replies, two of them in the module
sage.symbolic.expression: There is a multiplicity option for the
methods "roots" and "solve".
So, you could define some symbolic expression and apply the solve
method, e.g.:
sage: z = var('z')
sage: E=(z^3-1)^3
sage: E.solve(z, multiplicities=True)
([z == (sqrt(3)*I - 1)/2, z == (-sqrt(3)*I - 1)/2, z == 1], [1, 1,
3])
sage: E.roots(z, multiplicities=True)
[((sqrt(3)*I - 1)/2, 1), ((-sqrt(3)*I - 1)/2, 1), (1, 3)]
Apparently the "multiplicities" parameter is also available in the
"solve" function:
sage: solve(E==0,multiplicities=True)
([z == (sqrt(3)*I - 1)/2, z == (-sqrt(3)*I - 1)/2, z == 1], [1, 1,
3])
I hope the multiplicities 1, 1 and 3 are correct (didn't think about
it, but it seems a bit odd to me).
Unfortunately that option seems to be not documented in the "solve"
function. But, if you want to see the documentation, do
sage: solve?
Best regards,
Simon