Page 1 of 1

Missing function: Acos

Posted: Mon Feb 28, 2022 8:41 am
by cobleg
For context, I am developing an entity that calculates the solar radiation by hour over an entire year. In calculating the zenith angle, I need to use the Acos function (inverse cosine). The user guide indicates that it is available. However, I have incurred an error:

Source Description
Auxiliary "zenith angle" Unrecognized element 'Acos' in Expression: Model.degrees per radian*Acos(cos(solar declination in radians)*Cos(latitude/Model.degrees per radian)*Cos(hour angle/Model.degrees per radian)+Sin(solar declination in radians)*Sin(latitude/Model.degrees per radian))

I am using version 4.5 of Ventity.

Do you know how I can resolve this error please.

Re: Missing function: Acos

Posted: Mon Feb 28, 2022 5:22 pm
by tomfid
I see what you mean. We'll fix.

A workaround might be to put a table of values in a lookup.

Re: Missing function: Acos

Posted: Mon Feb 28, 2022 8:26 pm
by tomfid
Here's a macro version, based on Abramowitz & Stegun:
Acos 1.zip
(9.77 KiB) Downloaded 337 times

Re: Missing function: Acos

Posted: Tue Mar 01, 2022 1:25 am
by cobleg
Awesome, thanks! I will probably implement my project as a series of macros too.