<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body>
<p>Maria -</p>
<p>You cannot import any libraries in your script for Type169. </p>
<p>Regards,</p>
<p>Tim</p>
<p> </p>
<div>
<pre>---<br />Timothy P. McDowell
Executive Vice President
Thermal Energy System Specialists, LLC
3 N Pinckney St, Suite 202
Madison, WI 53703
office: 608-274-2577
cell: 608-225-5250</pre>
</div>
<p>On 2021-04-16 05:23, María Herrando via TRNSYS-users wrote:</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<p>Hi everyone,</p>
<p><span style="font-family: Calibri;"> I am encountering another error when trying to run Type 169. <br /></span></p>
<p><span style="font-family: Calibri;">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. </span>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 <span style="font-family: Calibri;">TRNSYSpy, as follows</span>:</p>
<p><span style="font-family: Calibri;">import TRNSYSpy as trn<br /> import numpy as np<br /> from scipy import optimize</span></p>
<p><span style="font-family: Calibri;">and I get the following error: <em>"The Python script failed to load</em>". If I remove the numpy and </span><span style="font-family: Calibri;"><span style="font-family: Calibri;">optimize from scipy</span>, the TRNSYS model runs... Is there a way to solve this or are there equivalent libraries that I can use?</span></p>
<p><span style="font-family: Calibri;">I am using numpy to calculate </span><span style="font-family: Calibri;"><span style="font-family: Calibri;">an angle in </span>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)"<br /></span></p>
<p>Thank you very much in advance,</p>
<p>Best Regards,<br /> María</p>
<pre class="moz-signature">--
</pre>
<!-- html ignored --><br />
<pre>_______________________________________________
TRNSYS-users mailing list
<a href="mailto:TRNSYS-users@lists.onebuilding.org">TRNSYS-users@lists.onebuilding.org</a>
<a href="http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org">http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org</a>
</pre>
</blockquote>
</body></html>