Forum OpenACS Development: model calculations environment, suggestions?

Hi all,

A modeling interpreter is being built for the accounting-finance package.

It's a linear programming variation of calculator/spreadsheet math to make models easier to read and program for non-tcl users while providing some security (no square brackets etc).

Does an environment like this already exist for OpenACS/tcl?

Right now these are the main variations from tcl:

1. equations require spaces as delimiters between most everything
2. functional lines use equal sign = instead of SET to help reduce potential security issues.
3. all nonfunctional lines are ignored (as comments)
4. comments can be appended to a functional line after double dash (--)
5. the sections: initial conditions, loop, values tracking, and report calculations are delimited by a pound sign (#)

Any suggestions?

Collapse
Posted by Torben Brosten on
Here's a portion of an example test case..

periods_per_year = 12 
 
energy_production_annual = 44570000. -- kWh/kW or kWh annual energy output per rated kW 
energy_output_cert_annual = 43288918. -- kWh/kW 
forecast_peak_power = 2298.01 -- hours (was base_sys_perf) 
annual_system_degredation = 0.005 -- percent as decimal 
system_power_output_peak = 19395. -- kW 
sys_output_period = 0 -- kWh 
 
ppa_rate = .2 -- $/kWh 
ppa_escalation = .025 -- percent as decimal (factor) 
power_revenue_period = 0 -- $ (was direct_income) 
 
\# 
period = i + 1 
periods_per_year = periods_per_year 
year = int( ( ( i + periods_per_year ) / periods_per_year ) ) 
next_year = year.i + 1 
prev_year = year.i - 1 
 
sys_output_period = acc_fin::energy_output forecast_peak_power system_power_output_peak annual_system_degredation year.i periods_per_year ; 
power_revenue_period = sys_output_period.i * ppa_rate * pow( 1 + ppa_escalation , prev_year.i ) 
 
\# 
i period next_year year sys_output_period power_revenue_period 
\# 
sum_periods = f::sum \$i_list ; 
sum_power_revenue_period = f::sum \$power_revenue_period_list ;