Use Sympy solver on a list of equations that contain multiple variables

Viewed 213

I need to solve for a list (because there are two of values for each variable that are zipped in the proper order) of exmax, eymax, exymax and Nxmax given that all of these variables are some combination of the others.

I have the issue that the type is coming back as a 'finiteset' and it won't let me iterate properly as a result.

import math 
import numpy as np 
from astropy.table import QTable, Table, Column
from collections import Counter
import operator

from sympy import *
exmax= symbols('exmax')
eymax= symbols('eymax')
exymax= symbols('exymax')
Nxmax=symbols('Nxmax')

Stiffnessofplies=list(1,1) #This isn't the actual value, but it is important to have a len of two #here for later on

Nxmax=[78.4613527541947*exmax + 8.06201746514537e-15*exymax + 4.07395485454472*eymax,
 69.4081197440953*exmax + 1.35798495151491*eymax]

exmax= [{(-1.0275144618526e-16*exymax - 0.0519230769230769*eymax,)},
 {(-0.0195652173913043*eymax,)}]

eymax = [{(-0.0284210526315789*exmax + 8.11515424209734e-19*exymax,)},
 {(-0.299999999999999*exmax,)}]

exymax = [{(-7.78938885521292e-17*exmax + 1.12391245013323e-18*eymax,)}, {(0,)}]

exmax2=[]
for i in emax:
    for j in i:
        exmax2.append(j)
eymax2=[]
for i in eymax:
    for j in i:
        eymax2.append(j)
exymax2=[]
for i in exymax:
    for j in i:
        exymax2.append(j)

I did these last three equations to try and flatten everything out to make it iterable. Here are other things I have tried:

#Pleasework=[]
#for i in range(0,len(Stiffnessofplies)):
#    linsolve([exmax2[i]], [eymax2[i]], [exymax2[i]], [Nxmax[i]], (exmax, eymax, exymax,Nxmax))



#System= exmax2[0],eymax2[0],exymax2[0]
#linsolve(System, exmax,eymax,exymax,Nxmax)
#Masterlist=list(zip(exmax,eymax,exymax,Nxmax))

I think one of my main issues is the type I'm getting back 'finiteset' really doesn't work well when trying to iterate the list for both values in the list.

0 Answers
Related