[TRNSYS-users] bug in battery component

Jeff Thornton thornton at tess-inc.com
Tue Jul 3 08:03:00 PDT 2018


Egon 

The only time you should change the variable units to string, or variable name, is if you then enter the name of a previously defined equation name in the initial value field - and don’t connect that input to anything.  The program will then evaluate the equation each time and use that value as the input to the model.  The units of the equation should match the default units of that input.

Simple example: I want to supply a constant 10 kW input to the first input of a model but the model wants the input to be in kJ/hr.

Option 1, I write an equation P_supply = 10 * 3600 to get the power units to be in kJ/hr and then go into the input tab of the model, change the input variable type to string and enter the name P_supply as the initial value. 

Option 2, I go into the input tab of the model, change the variable type to kW and enter 10.

What doesn’t work is to have an output of 10 kW from a model and hook it to the input that is expecting kJ/hr.  The model will assume it is 10 kJ/hr no matter what you set for the variable units.  You’ll need to then use an equation to match the units.  That’s why most of the trnsys models use the default units for their inputs and outputs.

Jeff

Sent from my iPhone

> On Jul 3, 2018, at 2:56 AM, Egon Troch <egon at think-e.be> wrote:
> 
> Thank you Jef for your quick respons. However, isn’t it the other way around? If an input is unconnected, “string” should be checked and the default is used. But if it is connected, shouldn’t the input that is selected be used? Or is it the other way around and does “string” need to be selected when an input is connected?
>  
> Kind regards,
> Egon
>  
> From: Jeff Thornton <thornton at tess-inc.com> 
> Sent: Monday, 2 July 2018 16:15
> To: TRNSYS users mailing list at OneBuilding.org <trnsys-users at lists.onebuilding.org>
> Cc: Egon Troch <egon at think-e.be>; Leen Peeters <Leen at think-e.be>
> Subject: Re: [TRNSYS-users] bug in battery component
>  
> Changing units of an input only changes the value of any UNCONNECTED input.  Connected inputs are always assumed to be the default units that the component expects.
>  
> Jeff
> 
> Sent from my iPhone
> 
> On Jun 29, 2018, at 11:05 AM, Egon Troch via TRNSYS-users <trnsys-users at lists.onebuilding.org> wrote:
> 
> Hi,
>  
> I found a bug in the TRNSYS 17 battery component “Type 47a”.
>  
> When changing the unit of the input “power to or from battery” to “kW” it still reads the input as if it were kJ/hr. This results in an unrealistic state of charge as if the battery is much too large.
>  
> If any questions, don’t hesitate to ask!
>  
> Kind regards,
> Egon
>  
> <image001.png>
> _______________________________________________
> TRNSYS-users mailing list
> TRNSYS-users at lists.onebuilding.org
> http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20180703/dc9732a0/attachment.html>


More information about the TRNSYS-users mailing list