Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Piman9

Pages: [1]
1
I'm using the inverse matrix to solve a 365 variable system of equations.  The cells do follow a sort of patter but the pattern is long. I'm not exactly sure what you mean.

2
Maybe distributing a constant across the matrix? Help?

3

I am trying to take the inverse of a 365x365 matrix. Some of the values get as large as 365**365 and so they are converted to long numbers. I don't know if the linalg.matrix_power() function can handle long numbers. I know the problem comes from this (because of the error message and because my program works just fine for smaller matrices) but I am not sure if there is a way around this. The code needs to work for a NxN matrix. Here's my code:
Code: [Select]
item=0
for i in xlist:
    xtotal.append(arrayit.arrayit(xlist[item],len(xlist)))
    item=item+1
print xtotal
xinverted=numpy.linalg.matrix_power(xtotal,-1)
coeff=numpy.dot(xinverted,ylist)
arrayit.arrayit:
Code: [Select]
def arrayit(number, length):
    newarray=[]
    import decimal
    i=0
    while i!=(length):
        newarray.insert(0,decimal.Decimal(number**i))
        i=i+1
    return newarray;
The program is taking x,y coordinates from a list (list of x's and list of y's) and makes a function. Thanks!

4
Introduce Yourself! / Hi. I'm Piman9
« on: February 05, 2015, 09:28:49 pm »
Hi. I don't personally program on any calculator except for a HP 33-S yet, but I want I start on TI soon. I need to get a TI-84 first :P. I program mainly on Python.

Pages: [1]