[TRNSYS-users] use type 169 python

Alex moreno alamoreno19 at hotmail.com
Mon Jan 27 02:17:26 PST 2020


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

[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png]<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>     Libre de virus. www.avg.com<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20200127/f1acca7e/attachment.html>


More information about the TRNSYS-users mailing list