findroot in mpmath

30 views
Skip to first unread message

Vickram Ratnam

unread,
Jul 27, 2022, 9:47:43 AM7/27/22
to mpmath

I have a function taking in a Matrix and a number as such:

def rada(a,s):
ast=[ ]
for k in range(0, int(s)):
ite = 0
for i in range(0, int(s)):
e = 0
for j in range(0, int(s)):
e += a[ite] * c[j]k
ite += 1
ast.append(e - (c[i]
(k+1)) /(k+1))
return ast

s = 3
the a should then have s x s elements if in matrix form or s*s if in vector form

I need to find root for it as such:
a = [ ]
for i in range(s*s):
a.append(0)

findroot(lambda a: rada(a,s), a)

Can someone please help me out?

Reply all
Reply to author
Forward
0 new messages