[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[TRNSYS-users] use type 169 python



Hi 

I'm using type 169 for make some calculations but when i use external package as numpy don't work well, i paste my code below:



import TRNSYSpy as TRNSYS
import numpy as np

def PythonExample():
   
    DNI = TRNSYS.getInputValue(3)
   

    Pv_out= np.zeros(2)
    Tcell= np.zeros(2)

   
    for i in range(1,3):
        Tcell[i-1]=TRNSYS.getInputValue(i)
   
   
   
        Pv_out[i-1]=(-20.25391+0.84583*Tcell[i-1]+0.0667*DNI-0.00961*Tcell[i-1]**2 +0.00002*DNI**2)


    out1 = Pv_out[0]
    out2 = Pv_out[1]

    TRNSYS.setOutputValue(1,out1)
    TRNSYS.setOutputValue(2,out2)    
   
    return

Regards

Libre de virus. www.avg.com