Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to solve numericaly with arbitrary precision

Hello,

I want to solve a numerical equation for which I can only access by a lambda function, the M matrix is to big for the determinant to be computed on the symbolic ring.

f = lambda om: RRR(M.subs({omega:om}).change_ring(RRR).det())

But , find-root solve in the built in float type of Python which is lacking the precision I need. Is there a way in sage to solve numericaly with arbitrary precision?

Thank you

Regards

sage: x=var('x')

sage: RRR = RealField(200)

sage:y = find_root(x**5-RRR(1),-100,100)

0.9999999999999886

sage: type(y)
<class 'float'>

How to solve numericaly with arbitrary precision

Hello,

I want to solve a numerical equation for which I can only access by a lambda function, the M matrix is to big for the determinant to be computed on the symbolic ring.

f = lambda om: RRR(M.subs({omega:om}).change_ring(RRR).det())

But , find-root solve in the built in float type of Python which is lacking the precision I need. Is there a way in sage to solve numericaly with arbitrary precision?

Thank you

RegardsRegards (edited with example more in line with what I am trying to achieve)

sage: x=var('x')
 sage: M= Matrix(SR,[[cos(x),cosh(x)],[sin(x),sinh(x)]])
sage: RRR = RealField(200)

sage:y sage: f = find_root(x**5-RRR(1),-100,100)

0.9999999999999886

lambda om: M.subs({x:om}).change_ring(RRR).det()
sage: type(y)
<class 'float'>
find_root(f,1,2)

How to solve numericaly with arbitrary precision

Hello,

I want to solve a numerical equation for which I can only access by a lambda function, the M matrix is to big for the determinant to be computed on the symbolic ring.

f = lambda om: RRR(M.subs({omega:om}).change_ring(RRR).det())

But , find-root solve in the built in float type of Python which is lacking the precision I need. Is there a way in sage to solve numericaly with arbitrary precision?

Thank you

Regards Regards

(edited with example more in line with what I am trying to achieve)

sage: x=var('x')
sage: M= Matrix(SR,[[cos(x),cosh(x)],[sin(x),sinh(x)]])
sage: RRR = RealField(200)
sage: f = lambda om: M.subs({x:om}).change_ring(RRR).det()
sage: find_root(f,1,2)