1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| def allsimulations(self,Param,systemO,inputO,plotO,finalPlot):
Loadings=np.asarray(inputO.allExpLoadMatrix)
Results=np.asarray(inputO.allExpRsltMatrix)
LoadingsOpt=np.asarray(inputO.allOptloadMatrix)
ResultsOpt=np.asarray(inputO.allOptResultMatrix)
AllResultsHere=np.asarray(inputO.allExpLoadMatrix)#np.copy(Loadings)
Times=np.asarray(inputO.allTimeVector)
ResultsIni=np.asarray(inputO.allInitialResults)
###
###
#verif1
###
###
tempCol=[]
for i in range(0,len(inputO.iniAuxVariables),1):
tempCol.append(inputO.iniAuxVariables[i])
ListOfAux=[]
for i in range(0,len(Loadings),1):
tempLine=[]
for j in range(0,len(Loadings[i]),1):
tempLine.append(tempCol)
ListOfAux.append(tempLine)
AuxVar=np.asarray(ListOfAux)
###
###
#verif2
###
###
for f in range(0,len(Loadings),1):
for tp1 in range(0,len(Times[f]),1):
if tp1==0:
CurrentResultTp1=np.copy(ResultsIni[f][0][:])
CurrentAuxVarTp1=np.copy(AuxVar[f][0][:])
else:
timeT=Times[f][tp1-1]
timeTp1=Times[f][tp1]
dTime=timeTp1-Times[f][tp1-1]
LoadT=np.copy(Loadings[f][tp1-1][:])
LoadTp1=np.copy(Loadings[f][tp1][:])
DLoad=np.copy(LoadTp1-Loadings[f][tp1-1][:])
DLoadDt=DLoad/dTime
ResultT=np.copy(CurrentResultTp1)
ResultTp1=np.copy(CurrentResultTp1)
AuxVarT=np.copy(CurrentAuxVarTp1)
AuxVarTp1=np.copy(CurrentAuxVarTp1)
sizeR=len(CurrentResultTp1)
sizeA=len(CurrentAuxVarTp1)
CurrentResultTp1=runC.simulation(self,Param,sizeR,sizeA,timeT,timeTp1,dTime,LoadT,LoadTp1,DLoad,DLoadDt,ResultT,ResultTp1,AuxVarT,AuxVarTp1)
###
###
#verif3
###
###
AllResultsHere[f][tp1][:]=np.copy(CurrentResultTp1)
###
###
#verif4
###
###
##############
return AllResultsHere |
Partager