[TRNSYS-users] TRNSYS v18: Type 169 - problem with Python Script because of libraries to import

María Herrando mherrando at unizar.es
Fri Apr 16 03:23:51 PDT 2021


Hi everyone,

I am encountering another error when trying to run Type 169.

In the code I am trying to solve in Python, I need to import a couple of 
libraries to solve some equations, which I believe are the reason for 
the error I am getting when trying to run the model. To double check 
that this is the problem for not running, I tried in the simple example 
provided in the Examples of TRNSYS, adding the libraries to import, 
after importing TRNSYSpy, as follows:

import TRNSYSpy as trn
import numpy as np
from scipy import optimize

and I get the following error: /"The Python script failed to load/". If 
I remove the numpy and optimize from scipy, the TRNSYS model runs... Is 
there a way to solve this or are there equivalent libraries that I can use?

I am using numpy to calculate an angle in radians and the cos of the 
angle, and I use optimize from scipy to solve an equation with one 
unknown inside a function "sol = optimize.root(resta, 10, args=pars, 
method='hybr', jac=None, tol=None, callback=None, options=None)"

Thank you very much in advance,

Best Regards,
María

-- 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20210416/a28cdf5f/attachment.html>


More information about the TRNSYS-users mailing list