Missing function: Acos

A place for Ventity software questions & answers
Post Reply
cobleg
Member
Posts: 21
Joined: Wed Oct 06, 2021 6:28 am
Vensim version: Ventity

Missing function: Acos

Post 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.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Missing function: Acos

Post by tomfid »

I see what you mean. We'll fix.

A workaround might be to put a table of values in a lookup.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Missing function: Acos

Post by tomfid »

Here's a macro version, based on Abramowitz & Stegun:
Acos 1.zip
(9.77 KiB) Downloaded 269 times
cobleg
Member
Posts: 21
Joined: Wed Oct 06, 2021 6:28 am
Vensim version: Ventity

Re: Missing function: Acos

Post by cobleg »

Awesome, thanks! I will probably implement my project as a series of macros too.
Post Reply