diff --git a/ssc/cmod_fresnel_physical_iph.cpp b/ssc/cmod_fresnel_physical_iph.cpp index 063a41aab..4dbcd63ad 100644 --- a/ssc/cmod_fresnel_physical_iph.cpp +++ b/ssc/cmod_fresnel_physical_iph.cpp @@ -253,26 +253,26 @@ static var_info _cm_vtab_fresnel_physical_iph[] = { { SSC_INPUT, SSC_NUMBER, "sales_tax_rate", "Sales Tax Rate", "%", "", "Capital_Costs", "?=0", "", "" }, // Construction financing inputs/outputs (SSC variable table from cmod_cb_construction_financing) - { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate1", "Interest rate, loan 1", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate2", "Interest rate, loan 2", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate3", "Interest rate, loan 3", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate4", "Interest rate, loan 4", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate5", "Interest rate, loan 5", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_months1", "Months prior to operation, loan 1", "", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_months2", "Months prior to operation, loan 2", "", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_months3", "Months prior to operation, loan 3", "", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_months4", "Months prior to operation, loan 4", "", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_months5", "Months prior to operation, loan 5", "", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_percent1", "Percent of total installed cost, loan 1", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_percent2", "Percent of total installed cost, loan 2", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_percent3", "Percent of total installed cost, loan 3", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_percent4", "Percent of total installed cost, loan 4", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_percent5", "Percent of total installed cost, loan 5", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate1", "Upfront fee on principal, loan 1", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate2", "Upfront fee on principal, loan 2", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate3", "Upfront fee on principal, loan 3", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate4", "Upfront fee on principal, loan 4", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate5", "Upfront fee on principal, loan 5", "%", "", "Financial Parameters", "*", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate1", "Interest rate, loan 1", "%", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate2", "Interest rate, loan 2", "%", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate3", "Interest rate, loan 3", "%", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate4", "Interest rate, loan 4", "%", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate5", "Interest rate, loan 5", "%", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_months1", "Months prior to operation, loan 1", "", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_months2", "Months prior to operation, loan 2", "", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_months3", "Months prior to operation, loan 3", "", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_months4", "Months prior to operation, loan 4", "", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_months5", "Months prior to operation, loan 5", "", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_percent1", "Percent of total installed cost, loan 1", "%", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_percent2", "Percent of total installed cost, loan 2", "%", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_percent3", "Percent of total installed cost, loan 3", "%", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_percent4", "Percent of total installed cost, loan 4", "%", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_percent5", "Percent of total installed cost, loan 5", "%", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate1", "Upfront fee on principal, loan 1", "%", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate2", "Upfront fee on principal, loan 2", "%", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate3", "Upfront fee on principal, loan 3", "%", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate4", "Upfront fee on principal, loan 4", "%", "", "Financial Parameters", "csp_financial_model=1","", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate5", "Upfront fee on principal, loan 5", "%", "", "Financial Parameters", "csp_financial_model=1","", "" }, // OUTPUTS @@ -386,26 +386,26 @@ static var_info _cm_vtab_fresnel_physical_iph[] = { { SSC_OUTPUT, SSC_NUMBER, "installed_per_capacity", "Estimated total installed cost per net capacity ($/kW)", "$/kW", "", "Capital Costs", "", "", "" }, // Financing - { SSC_OUTPUT, SSC_NUMBER, "const_per_principal1", "Principal, loan 1", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_principal2", "Principal, loan 2", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_principal3", "Principal, loan 3", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_principal4", "Principal, loan 4", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_principal5", "Principal, loan 5", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_interest1", "Interest cost, loan 1", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_interest2", "Interest cost, loan 2", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_interest3", "Interest cost, loan 3", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_interest4", "Interest cost, loan 4", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_interest5", "Interest cost, loan 5", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_total1", "Total financing cost, loan 1", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_total2", "Total financing cost, loan 2", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_total3", "Total financing cost, loan 3", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_total4", "Total financing cost, loan 4", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_total5", "Total financing cost, loan 5", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_percent_total", "Total percent of installed costs, all loans", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_principal_total", "Total principal, all loans", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_interest_total", "Total interest costs, all loans", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "construction_financing_cost", "Total construction financing cost", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_ARRAY, "ppa_price_input", "PPA prices - yearly", "$/kWh", "", "Revenue", "ppa_multiplier_model=0&csp_financial_model<5&is_dispatch=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_principal1", "Principal, loan 1", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_principal2", "Principal, loan 2", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_principal3", "Principal, loan 3", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_principal4", "Principal, loan 4", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_principal5", "Principal, loan 5", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_interest1", "Interest cost, loan 1", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_interest2", "Interest cost, loan 2", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_interest3", "Interest cost, loan 3", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_interest4", "Interest cost, loan 4", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_interest5", "Interest cost, loan 5", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_total1", "Total financing cost, loan 1", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_total2", "Total financing cost, loan 2", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_total3", "Total financing cost, loan 3", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_total4", "Total financing cost, loan 4", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_total5", "Total financing cost, loan 5", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_percent_total", "Total percent of installed costs, all loans", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_principal_total", "Total principal, all loans", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_interest_total", "Total interest costs, all loans", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "construction_financing_cost", "Total construction financing cost", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_ARRAY, "ppa_price_input", "PPA prices - yearly", "$/kWh", "", "Revenue", "ppa_multiplier_model=0&csp_financial_model<5&is_dispatch=1", "", "" }, // **************************************************************************************************************************************** // Timeseries Simulation Outputs here (sim_type = 1): @@ -1442,69 +1442,70 @@ class cm_fresnel_physical_iph : public compute_module } // Update construction financing costs, specifically, update: "construction_financing_cost" - double const_per_interest_rate1 = as_double("const_per_interest_rate1"); - double const_per_interest_rate2 = as_double("const_per_interest_rate2"); - double const_per_interest_rate3 = as_double("const_per_interest_rate3"); - double const_per_interest_rate4 = as_double("const_per_interest_rate4"); - double const_per_interest_rate5 = as_double("const_per_interest_rate5"); - double const_per_months1 = as_double("const_per_months1"); - double const_per_months2 = as_double("const_per_months2"); - double const_per_months3 = as_double("const_per_months3"); - double const_per_months4 = as_double("const_per_months4"); - double const_per_months5 = as_double("const_per_months5"); - double const_per_percent1 = as_double("const_per_percent1"); - double const_per_percent2 = as_double("const_per_percent2"); - double const_per_percent3 = as_double("const_per_percent3"); - double const_per_percent4 = as_double("const_per_percent4"); - double const_per_percent5 = as_double("const_per_percent5"); - double const_per_upfront_rate1 = as_double("const_per_upfront_rate1"); - double const_per_upfront_rate2 = as_double("const_per_upfront_rate2"); - double const_per_upfront_rate3 = as_double("const_per_upfront_rate3"); - double const_per_upfront_rate4 = as_double("const_per_upfront_rate4"); - double const_per_upfront_rate5 = as_double("const_per_upfront_rate5"); - - double const_per_principal1, const_per_principal2, const_per_principal3, const_per_principal4, const_per_principal5; - double const_per_interest1, const_per_interest2, const_per_interest3, const_per_interest4, const_per_interest5; - double const_per_total1, const_per_total2, const_per_total3, const_per_total4, const_per_total5; - double const_per_percent_total, const_per_principal_total, const_per_interest_total, construction_financing_cost; - - const_per_principal1 = const_per_principal2 = const_per_principal3 = const_per_principal4 = const_per_principal5 = - const_per_interest1 = const_per_interest2 = const_per_interest3 = const_per_interest4 = const_per_interest5 = - const_per_total1 = const_per_total2 = const_per_total3 = const_per_total4 = const_per_total5 = - const_per_percent_total = const_per_principal_total = const_per_interest_total = construction_financing_cost = - std::numeric_limits::quiet_NaN(); - - N_financial_parameters::construction_financing_total_cost(total_installed_cost_out, - const_per_interest_rate1, const_per_interest_rate2, const_per_interest_rate3, const_per_interest_rate4, const_per_interest_rate5, - const_per_months1, const_per_months2, const_per_months3, const_per_months4, const_per_months5, - const_per_percent1, const_per_percent2, const_per_percent3, const_per_percent4, const_per_percent5, - const_per_upfront_rate1, const_per_upfront_rate2, const_per_upfront_rate3, const_per_upfront_rate4, const_per_upfront_rate5, - const_per_principal1, const_per_principal2, const_per_principal3, const_per_principal4, const_per_principal5, - const_per_interest1, const_per_interest2, const_per_interest3, const_per_interest4, const_per_interest5, - const_per_total1, const_per_total2, const_per_total3, const_per_total4, const_per_total5, - const_per_percent_total, const_per_principal_total, const_per_interest_total, construction_financing_cost); - - assign("const_per_principal1", (ssc_number_t)const_per_principal1); - assign("const_per_principal2", (ssc_number_t)const_per_principal2); - assign("const_per_principal3", (ssc_number_t)const_per_principal3); - assign("const_per_principal4", (ssc_number_t)const_per_principal4); - assign("const_per_principal5", (ssc_number_t)const_per_principal5); - assign("const_per_interest1", (ssc_number_t)const_per_interest1); - assign("const_per_interest2", (ssc_number_t)const_per_interest2); - assign("const_per_interest3", (ssc_number_t)const_per_interest3); - assign("const_per_interest4", (ssc_number_t)const_per_interest4); - assign("const_per_interest5", (ssc_number_t)const_per_interest5); - assign("const_per_total1", (ssc_number_t)const_per_total1); - assign("const_per_total2", (ssc_number_t)const_per_total2); - assign("const_per_total3", (ssc_number_t)const_per_total3); - assign("const_per_total4", (ssc_number_t)const_per_total4); - assign("const_per_total5", (ssc_number_t)const_per_total5); - assign("const_per_percent_total", (ssc_number_t)const_per_percent_total); - assign("const_per_principal_total", (ssc_number_t)const_per_principal_total); - assign("const_per_interest_total", (ssc_number_t)const_per_interest_total); - assign("construction_financing_cost", (ssc_number_t)construction_financing_cost); - - + if (csp_financial_model == 1) + { + double const_per_interest_rate1 = as_double("const_per_interest_rate1"); + double const_per_interest_rate2 = as_double("const_per_interest_rate2"); + double const_per_interest_rate3 = as_double("const_per_interest_rate3"); + double const_per_interest_rate4 = as_double("const_per_interest_rate4"); + double const_per_interest_rate5 = as_double("const_per_interest_rate5"); + double const_per_months1 = as_double("const_per_months1"); + double const_per_months2 = as_double("const_per_months2"); + double const_per_months3 = as_double("const_per_months3"); + double const_per_months4 = as_double("const_per_months4"); + double const_per_months5 = as_double("const_per_months5"); + double const_per_percent1 = as_double("const_per_percent1"); + double const_per_percent2 = as_double("const_per_percent2"); + double const_per_percent3 = as_double("const_per_percent3"); + double const_per_percent4 = as_double("const_per_percent4"); + double const_per_percent5 = as_double("const_per_percent5"); + double const_per_upfront_rate1 = as_double("const_per_upfront_rate1"); + double const_per_upfront_rate2 = as_double("const_per_upfront_rate2"); + double const_per_upfront_rate3 = as_double("const_per_upfront_rate3"); + double const_per_upfront_rate4 = as_double("const_per_upfront_rate4"); + double const_per_upfront_rate5 = as_double("const_per_upfront_rate5"); + + double const_per_principal1, const_per_principal2, const_per_principal3, const_per_principal4, const_per_principal5; + double const_per_interest1, const_per_interest2, const_per_interest3, const_per_interest4, const_per_interest5; + double const_per_total1, const_per_total2, const_per_total3, const_per_total4, const_per_total5; + double const_per_percent_total, const_per_principal_total, const_per_interest_total, construction_financing_cost; + + const_per_principal1 = const_per_principal2 = const_per_principal3 = const_per_principal4 = const_per_principal5 = + const_per_interest1 = const_per_interest2 = const_per_interest3 = const_per_interest4 = const_per_interest5 = + const_per_total1 = const_per_total2 = const_per_total3 = const_per_total4 = const_per_total5 = + const_per_percent_total = const_per_principal_total = const_per_interest_total = construction_financing_cost = + std::numeric_limits::quiet_NaN(); + + N_financial_parameters::construction_financing_total_cost(total_installed_cost_out, + const_per_interest_rate1, const_per_interest_rate2, const_per_interest_rate3, const_per_interest_rate4, const_per_interest_rate5, + const_per_months1, const_per_months2, const_per_months3, const_per_months4, const_per_months5, + const_per_percent1, const_per_percent2, const_per_percent3, const_per_percent4, const_per_percent5, + const_per_upfront_rate1, const_per_upfront_rate2, const_per_upfront_rate3, const_per_upfront_rate4, const_per_upfront_rate5, + const_per_principal1, const_per_principal2, const_per_principal3, const_per_principal4, const_per_principal5, + const_per_interest1, const_per_interest2, const_per_interest3, const_per_interest4, const_per_interest5, + const_per_total1, const_per_total2, const_per_total3, const_per_total4, const_per_total5, + const_per_percent_total, const_per_principal_total, const_per_interest_total, construction_financing_cost); + + assign("const_per_principal1", (ssc_number_t)const_per_principal1); + assign("const_per_principal2", (ssc_number_t)const_per_principal2); + assign("const_per_principal3", (ssc_number_t)const_per_principal3); + assign("const_per_principal4", (ssc_number_t)const_per_principal4); + assign("const_per_principal5", (ssc_number_t)const_per_principal5); + assign("const_per_interest1", (ssc_number_t)const_per_interest1); + assign("const_per_interest2", (ssc_number_t)const_per_interest2); + assign("const_per_interest3", (ssc_number_t)const_per_interest3); + assign("const_per_interest4", (ssc_number_t)const_per_interest4); + assign("const_per_interest5", (ssc_number_t)const_per_interest5); + assign("const_per_total1", (ssc_number_t)const_per_total1); + assign("const_per_total2", (ssc_number_t)const_per_total2); + assign("const_per_total3", (ssc_number_t)const_per_total3); + assign("const_per_total4", (ssc_number_t)const_per_total4); + assign("const_per_total5", (ssc_number_t)const_per_total5); + assign("const_per_percent_total", (ssc_number_t)const_per_percent_total); + assign("const_per_principal_total", (ssc_number_t)const_per_principal_total); + assign("const_per_interest_total", (ssc_number_t)const_per_interest_total); + assign("construction_financing_cost", (ssc_number_t)construction_financing_cost); + } } diff --git a/ssc/cmod_mspt_iph.cpp b/ssc/cmod_mspt_iph.cpp index 9c098d1f8..8d00b6efe 100644 --- a/ssc/cmod_mspt_iph.cpp +++ b/ssc/cmod_mspt_iph.cpp @@ -305,26 +305,26 @@ static var_info _cm_vtab_mspt_iph[] = { { SSC_INPUT, SSC_NUMBER, "csp.pt.sf.land_overhead_factor", "Land overhead factor", "", "", "Heliostat Field", "*", "", "" }, // Construction financing inputs/outputs (SSC variable table from cmod_cb_construction_financing) -{ SSC_INPUT, SSC_NUMBER, "const_per_interest_rate1", "Interest rate, loan 1", "%", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_interest_rate2", "Interest rate, loan 2", "%", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_interest_rate3", "Interest rate, loan 3", "%", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_interest_rate4", "Interest rate, loan 4", "%", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_interest_rate5", "Interest rate, loan 5", "%", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_months1", "Months prior to operation, loan 1", "", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_months2", "Months prior to operation, loan 2", "", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_months3", "Months prior to operation, loan 3", "", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_months4", "Months prior to operation, loan 4", "", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_months5", "Months prior to operation, loan 5", "", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_percent1", "Percent of total installed cost, loan 1", "%", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_percent2", "Percent of total installed cost, loan 2", "%", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_percent3", "Percent of total installed cost, loan 3", "%", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_percent4", "Percent of total installed cost, loan 4", "%", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_percent5", "Percent of total installed cost, loan 5", "%", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate1", "Upfront fee on principal, loan 1", "%", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate2", "Upfront fee on principal, loan 2", "%", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate3", "Upfront fee on principal, loan 3", "%", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate4", "Upfront fee on principal, loan 4", "%", "", "Financial Parameters", "*", "", ""}, -{ SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate5", "Upfront fee on principal, loan 5", "%", "", "Financial Parameters", "*", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_interest_rate1", "Interest rate, loan 1", "%", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_interest_rate2", "Interest rate, loan 2", "%", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_interest_rate3", "Interest rate, loan 3", "%", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_interest_rate4", "Interest rate, loan 4", "%", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_interest_rate5", "Interest rate, loan 5", "%", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_months1", "Months prior to operation, loan 1", "", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_months2", "Months prior to operation, loan 2", "", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_months3", "Months prior to operation, loan 3", "", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_months4", "Months prior to operation, loan 4", "", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_months5", "Months prior to operation, loan 5", "", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_percent1", "Percent of total installed cost, loan 1", "%", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_percent2", "Percent of total installed cost, loan 2", "%", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_percent3", "Percent of total installed cost, loan 3", "%", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_percent4", "Percent of total installed cost, loan 4", "%", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_percent5", "Percent of total installed cost, loan 5", "%", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate1", "Upfront fee on principal, loan 1", "%", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate2", "Upfront fee on principal, loan 2", "%", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate3", "Upfront fee on principal, loan 3", "%", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate4", "Upfront fee on principal, loan 4", "%", "", "Financial Parameters", "csp_financial_model=1", "", ""}, +{ SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate5", "Upfront fee on principal, loan 5", "%", "", "Financial Parameters", "csp_financial_model=1", "", ""}, // **************************************************************************************************************************************** // DEPRECATED INPUTS -- exec() checks if a) variable is assigned and b) if replacement variable is assigned. throws exception if a=true and b=false @@ -434,25 +434,25 @@ static var_info _cm_vtab_mspt_iph[] = { { SSC_OUTPUT, SSC_NUMBER, "csp.pt.cost.installed_per_capacity", "Estimated installed cost per cap", "$", "", "System Costs", "*", "", "" }, // Financing -{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal1", "Principal, loan 1", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal2", "Principal, loan 2", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal3", "Principal, loan 3", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal4", "Principal, loan 4", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal5", "Principal, loan 5", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest1", "Interest cost, loan 1", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest2", "Interest cost, loan 2", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest3", "Interest cost, loan 3", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest4", "Interest cost, loan 4", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest5", "Interest cost, loan 5", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_total1", "Total financing cost, loan 1", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_total2", "Total financing cost, loan 2", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_total3", "Total financing cost, loan 3", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_total4", "Total financing cost, loan 4", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_total5", "Total financing cost, loan 5", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_percent_total", "Total percent of installed costs, all loans", "%", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal_total", "Total principal, all loans", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest_total", "Total interest costs, all loans", "$", "", "Financial Parameters", "*", "", "" }, -{ SSC_OUTPUT, SSC_NUMBER, "construction_financing_cost", "Total construction financing cost", "$", "", "Financial Parameters", "*", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal1", "Principal, loan 1", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal2", "Principal, loan 2", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal3", "Principal, loan 3", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal4", "Principal, loan 4", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal5", "Principal, loan 5", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest1", "Interest cost, loan 1", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest2", "Interest cost, loan 2", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest3", "Interest cost, loan 3", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest4", "Interest cost, loan 4", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest5", "Interest cost, loan 5", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_total1", "Total financing cost, loan 1", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_total2", "Total financing cost, loan 2", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_total3", "Total financing cost, loan 3", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_total4", "Total financing cost, loan 4", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_total5", "Total financing cost, loan 5", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_percent_total", "Total percent of installed costs, all loans", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal_total", "Total principal, all loans", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest_total", "Total interest costs, all loans", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, +{ SSC_OUTPUT, SSC_NUMBER, "construction_financing_cost", "Total construction financing cost", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, { SSC_OUTPUT, SSC_ARRAY, "ppa_price_input", "PPA prices - yearly", "$/kWh", "", "Revenue", "ppa_multiplier_model=0&csp_financial_model<5&is_dispatch=1&sim_type=1", "", "SIMULATION_PARAMETER" }, @@ -2204,69 +2204,70 @@ class cm_mspt_iph : public compute_module assign("csp.pt.cost.installed_per_capacity", (ssc_number_t)estimated_installed_cost_per_cap); // Update construction financing costs, specifically, update: "construction_financing_cost" - double const_per_interest_rate1 = as_double("const_per_interest_rate1"); - double const_per_interest_rate2 = as_double("const_per_interest_rate2"); - double const_per_interest_rate3 = as_double("const_per_interest_rate3"); - double const_per_interest_rate4 = as_double("const_per_interest_rate4"); - double const_per_interest_rate5 = as_double("const_per_interest_rate5"); - double const_per_months1 = as_double("const_per_months1"); - double const_per_months2 = as_double("const_per_months2"); - double const_per_months3 = as_double("const_per_months3"); - double const_per_months4 = as_double("const_per_months4"); - double const_per_months5 = as_double("const_per_months5"); - double const_per_percent1 = as_double("const_per_percent1"); - double const_per_percent2 = as_double("const_per_percent2"); - double const_per_percent3 = as_double("const_per_percent3"); - double const_per_percent4 = as_double("const_per_percent4"); - double const_per_percent5 = as_double("const_per_percent5"); - double const_per_upfront_rate1 = as_double("const_per_upfront_rate1"); - double const_per_upfront_rate2 = as_double("const_per_upfront_rate2"); - double const_per_upfront_rate3 = as_double("const_per_upfront_rate3"); - double const_per_upfront_rate4 = as_double("const_per_upfront_rate4"); - double const_per_upfront_rate5 = as_double("const_per_upfront_rate5"); - - double const_per_principal1, const_per_principal2, const_per_principal3, const_per_principal4, const_per_principal5; - double const_per_interest1, const_per_interest2, const_per_interest3, const_per_interest4, const_per_interest5; - double const_per_total1, const_per_total2, const_per_total3, const_per_total4, const_per_total5; - double const_per_percent_total, const_per_principal_total, const_per_interest_total, construction_financing_cost; - - const_per_principal1 = const_per_principal2 = const_per_principal3 = const_per_principal4 = const_per_principal5 = - const_per_interest1 = const_per_interest2 = const_per_interest3 = const_per_interest4 = const_per_interest5 = - const_per_total1 = const_per_total2 = const_per_total3 = const_per_total4 = const_per_total5 = - const_per_percent_total = const_per_principal_total = const_per_interest_total = construction_financing_cost = - std::numeric_limits::quiet_NaN(); - - N_financial_parameters::construction_financing_total_cost(total_installed_cost, - const_per_interest_rate1, const_per_interest_rate2, const_per_interest_rate3, const_per_interest_rate4, const_per_interest_rate5, - const_per_months1, const_per_months2, const_per_months3, const_per_months4, const_per_months5, - const_per_percent1, const_per_percent2, const_per_percent3, const_per_percent4, const_per_percent5, - const_per_upfront_rate1, const_per_upfront_rate2, const_per_upfront_rate3, const_per_upfront_rate4, const_per_upfront_rate5, - const_per_principal1, const_per_principal2, const_per_principal3, const_per_principal4, const_per_principal5, - const_per_interest1, const_per_interest2, const_per_interest3, const_per_interest4, const_per_interest5, - const_per_total1, const_per_total2, const_per_total3, const_per_total4, const_per_total5, - const_per_percent_total, const_per_principal_total, const_per_interest_total, construction_financing_cost); - - assign("const_per_principal1", (ssc_number_t)const_per_principal1); - assign("const_per_principal2", (ssc_number_t)const_per_principal2); - assign("const_per_principal3", (ssc_number_t)const_per_principal3); - assign("const_per_principal4", (ssc_number_t)const_per_principal4); - assign("const_per_principal5", (ssc_number_t)const_per_principal5); - assign("const_per_interest1", (ssc_number_t)const_per_interest1); - assign("const_per_interest2", (ssc_number_t)const_per_interest2); - assign("const_per_interest3", (ssc_number_t)const_per_interest3); - assign("const_per_interest4", (ssc_number_t)const_per_interest4); - assign("const_per_interest5", (ssc_number_t)const_per_interest5); - assign("const_per_total1", (ssc_number_t)const_per_total1); - assign("const_per_total2", (ssc_number_t)const_per_total2); - assign("const_per_total3", (ssc_number_t)const_per_total3); - assign("const_per_total4", (ssc_number_t)const_per_total4); - assign("const_per_total5", (ssc_number_t)const_per_total5); - assign("const_per_percent_total", (ssc_number_t)const_per_percent_total); - assign("const_per_principal_total", (ssc_number_t)const_per_principal_total); - assign("const_per_interest_total", (ssc_number_t)const_per_interest_total); - assign("construction_financing_cost", (ssc_number_t)construction_financing_cost); - - + if (csp_financial_model == 1) + { + double const_per_interest_rate1 = as_double("const_per_interest_rate1"); + double const_per_interest_rate2 = as_double("const_per_interest_rate2"); + double const_per_interest_rate3 = as_double("const_per_interest_rate3"); + double const_per_interest_rate4 = as_double("const_per_interest_rate4"); + double const_per_interest_rate5 = as_double("const_per_interest_rate5"); + double const_per_months1 = as_double("const_per_months1"); + double const_per_months2 = as_double("const_per_months2"); + double const_per_months3 = as_double("const_per_months3"); + double const_per_months4 = as_double("const_per_months4"); + double const_per_months5 = as_double("const_per_months5"); + double const_per_percent1 = as_double("const_per_percent1"); + double const_per_percent2 = as_double("const_per_percent2"); + double const_per_percent3 = as_double("const_per_percent3"); + double const_per_percent4 = as_double("const_per_percent4"); + double const_per_percent5 = as_double("const_per_percent5"); + double const_per_upfront_rate1 = as_double("const_per_upfront_rate1"); + double const_per_upfront_rate2 = as_double("const_per_upfront_rate2"); + double const_per_upfront_rate3 = as_double("const_per_upfront_rate3"); + double const_per_upfront_rate4 = as_double("const_per_upfront_rate4"); + double const_per_upfront_rate5 = as_double("const_per_upfront_rate5"); + + double const_per_principal1, const_per_principal2, const_per_principal3, const_per_principal4, const_per_principal5; + double const_per_interest1, const_per_interest2, const_per_interest3, const_per_interest4, const_per_interest5; + double const_per_total1, const_per_total2, const_per_total3, const_per_total4, const_per_total5; + double const_per_percent_total, const_per_principal_total, const_per_interest_total, construction_financing_cost; + + const_per_principal1 = const_per_principal2 = const_per_principal3 = const_per_principal4 = const_per_principal5 = + const_per_interest1 = const_per_interest2 = const_per_interest3 = const_per_interest4 = const_per_interest5 = + const_per_total1 = const_per_total2 = const_per_total3 = const_per_total4 = const_per_total5 = + const_per_percent_total = const_per_principal_total = const_per_interest_total = construction_financing_cost = + std::numeric_limits::quiet_NaN(); + + N_financial_parameters::construction_financing_total_cost(total_installed_cost, + const_per_interest_rate1, const_per_interest_rate2, const_per_interest_rate3, const_per_interest_rate4, const_per_interest_rate5, + const_per_months1, const_per_months2, const_per_months3, const_per_months4, const_per_months5, + const_per_percent1, const_per_percent2, const_per_percent3, const_per_percent4, const_per_percent5, + const_per_upfront_rate1, const_per_upfront_rate2, const_per_upfront_rate3, const_per_upfront_rate4, const_per_upfront_rate5, + const_per_principal1, const_per_principal2, const_per_principal3, const_per_principal4, const_per_principal5, + const_per_interest1, const_per_interest2, const_per_interest3, const_per_interest4, const_per_interest5, + const_per_total1, const_per_total2, const_per_total3, const_per_total4, const_per_total5, + const_per_percent_total, const_per_principal_total, const_per_interest_total, construction_financing_cost); + + assign("const_per_principal1", (ssc_number_t)const_per_principal1); + assign("const_per_principal2", (ssc_number_t)const_per_principal2); + assign("const_per_principal3", (ssc_number_t)const_per_principal3); + assign("const_per_principal4", (ssc_number_t)const_per_principal4); + assign("const_per_principal5", (ssc_number_t)const_per_principal5); + assign("const_per_interest1", (ssc_number_t)const_per_interest1); + assign("const_per_interest2", (ssc_number_t)const_per_interest2); + assign("const_per_interest3", (ssc_number_t)const_per_interest3); + assign("const_per_interest4", (ssc_number_t)const_per_interest4); + assign("const_per_interest5", (ssc_number_t)const_per_interest5); + assign("const_per_total1", (ssc_number_t)const_per_total1); + assign("const_per_total2", (ssc_number_t)const_per_total2); + assign("const_per_total3", (ssc_number_t)const_per_total3); + assign("const_per_total4", (ssc_number_t)const_per_total4); + assign("const_per_total5", (ssc_number_t)const_per_total5); + assign("const_per_percent_total", (ssc_number_t)const_per_percent_total); + assign("const_per_principal_total", (ssc_number_t)const_per_principal_total); + assign("const_per_interest_total", (ssc_number_t)const_per_interest_total); + assign("construction_financing_cost", (ssc_number_t)construction_financing_cost); + } // ***************************************************** // If calling cmod to run design only, return here diff --git a/ssc/cmod_trough_physical_iph.cpp b/ssc/cmod_trough_physical_iph.cpp index afdf565dd..c273478ce 100644 --- a/ssc/cmod_trough_physical_iph.cpp +++ b/ssc/cmod_trough_physical_iph.cpp @@ -338,26 +338,26 @@ static var_info _cm_vtab_trough_physical_iph[] = { // Construction financing inputs/outputs (SSC variable table from cmod_cb_construction_financing) - { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate1", "Interest rate, loan 1", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate2", "Interest rate, loan 2", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate3", "Interest rate, loan 3", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate4", "Interest rate, loan 4", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate5", "Interest rate, loan 5", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_months1", "Months prior to operation, loan 1", "", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_months2", "Months prior to operation, loan 2", "", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_months3", "Months prior to operation, loan 3", "", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_months4", "Months prior to operation, loan 4", "", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_months5", "Months prior to operation, loan 5", "", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_percent1", "Percent of total installed cost, loan 1", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_percent2", "Percent of total installed cost, loan 2", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_percent3", "Percent of total installed cost, loan 3", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_percent4", "Percent of total installed cost, loan 4", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_percent5", "Percent of total installed cost, loan 5", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate1", "Upfront fee on principal, loan 1", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate2", "Upfront fee on principal, loan 2", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate3", "Upfront fee on principal, loan 3", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate4", "Upfront fee on principal, loan 4", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate5", "Upfront fee on principal, loan 5", "%", "", "Financial Parameters", "*", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate1", "Interest rate, loan 1", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate2", "Interest rate, loan 2", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate3", "Interest rate, loan 3", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate4", "Interest rate, loan 4", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_interest_rate5", "Interest rate, loan 5", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_months1", "Months prior to operation, loan 1", "", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_months2", "Months prior to operation, loan 2", "", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_months3", "Months prior to operation, loan 3", "", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_months4", "Months prior to operation, loan 4", "", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_months5", "Months prior to operation, loan 5", "", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_percent1", "Percent of total installed cost, loan 1", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_percent2", "Percent of total installed cost, loan 2", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_percent3", "Percent of total installed cost, loan 3", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_percent4", "Percent of total installed cost, loan 4", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_percent5", "Percent of total installed cost, loan 5", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate1", "Upfront fee on principal, loan 1", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate2", "Upfront fee on principal, loan 2", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate3", "Upfront fee on principal, loan 3", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate4", "Upfront fee on principal, loan 4", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate5", "Upfront fee on principal, loan 5", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, // ************************************************************************************************* // OUTPUTS @@ -485,25 +485,25 @@ static var_info _cm_vtab_trough_physical_iph[] = { { SSC_OUTPUT, SSC_NUMBER, "csp.dtr.cost.installed_per_capacity", "Estimated total installed cost per net capacity ($/kW)", "$/kW", "", "Capital Costs", "", "", "" }, // Financing - { SSC_OUTPUT, SSC_NUMBER, "const_per_principal1", "Principal, loan 1", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_principal2", "Principal, loan 2", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_principal3", "Principal, loan 3", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_principal4", "Principal, loan 4", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_principal5", "Principal, loan 5", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_interest1", "Interest cost, loan 1", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_interest2", "Interest cost, loan 2", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_interest3", "Interest cost, loan 3", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_interest4", "Interest cost, loan 4", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_interest5", "Interest cost, loan 5", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_total1", "Total financing cost, loan 1", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_total2", "Total financing cost, loan 2", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_total3", "Total financing cost, loan 3", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_total4", "Total financing cost, loan 4", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_total5", "Total financing cost, loan 5", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_percent_total", "Total percent of installed costs, all loans", "%", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_principal_total", "Total principal, all loans", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "const_per_interest_total", "Total interest costs, all loans", "$", "", "Financial Parameters", "*", "", "" }, - { SSC_OUTPUT, SSC_NUMBER, "construction_financing_cost", "Total construction financing cost", "$", "", "Financial Parameters", "*", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_principal1", "Principal, loan 1", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_principal2", "Principal, loan 2", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_principal3", "Principal, loan 3", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_principal4", "Principal, loan 4", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_principal5", "Principal, loan 5", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_interest1", "Interest cost, loan 1", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_interest2", "Interest cost, loan 2", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_interest3", "Interest cost, loan 3", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_interest4", "Interest cost, loan 4", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_interest5", "Interest cost, loan 5", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_total1", "Total financing cost, loan 1", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_total2", "Total financing cost, loan 2", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_total3", "Total financing cost, loan 3", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_total4", "Total financing cost, loan 4", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_total5", "Total financing cost, loan 5", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_percent_total", "Total percent of installed costs, all loans", "%", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_principal_total", "Total principal, all loans", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "const_per_interest_total", "Total interest costs, all loans", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, + { SSC_OUTPUT, SSC_NUMBER, "construction_financing_cost", "Total construction financing cost", "$", "", "Financial Parameters", "csp_financial_model=1", "", "" }, { SSC_OUTPUT, SSC_ARRAY, "ppa_price_input", "PPA prices - yearly", "$/kWh", "", "Revenue", "ppa_multiplier_model=0&csp_financial_model<5&is_dispatch=1","", "" }, @@ -2144,67 +2144,71 @@ class cm_trough_physical_iph : public compute_module // Update construction financing costs, specifically, update: "construction_financing_cost" - double const_per_interest_rate1 = as_double("const_per_interest_rate1"); - double const_per_interest_rate2 = as_double("const_per_interest_rate2"); - double const_per_interest_rate3 = as_double("const_per_interest_rate3"); - double const_per_interest_rate4 = as_double("const_per_interest_rate4"); - double const_per_interest_rate5 = as_double("const_per_interest_rate5"); - double const_per_months1 = as_double("const_per_months1"); - double const_per_months2 = as_double("const_per_months2"); - double const_per_months3 = as_double("const_per_months3"); - double const_per_months4 = as_double("const_per_months4"); - double const_per_months5 = as_double("const_per_months5"); - double const_per_percent1 = as_double("const_per_percent1"); - double const_per_percent2 = as_double("const_per_percent2"); - double const_per_percent3 = as_double("const_per_percent3"); - double const_per_percent4 = as_double("const_per_percent4"); - double const_per_percent5 = as_double("const_per_percent5"); - double const_per_upfront_rate1 = as_double("const_per_upfront_rate1"); - double const_per_upfront_rate2 = as_double("const_per_upfront_rate2"); - double const_per_upfront_rate3 = as_double("const_per_upfront_rate3"); - double const_per_upfront_rate4 = as_double("const_per_upfront_rate4"); - double const_per_upfront_rate5 = as_double("const_per_upfront_rate5"); - - double const_per_principal1, const_per_principal2, const_per_principal3, const_per_principal4, const_per_principal5; - double const_per_interest1, const_per_interest2, const_per_interest3, const_per_interest4, const_per_interest5; - double const_per_total1, const_per_total2, const_per_total3, const_per_total4, const_per_total5; - double const_per_percent_total, const_per_principal_total, const_per_interest_total, construction_financing_cost; - - const_per_principal1 = const_per_principal2 = const_per_principal3 = const_per_principal4 = const_per_principal5 = - const_per_interest1 = const_per_interest2 = const_per_interest3 = const_per_interest4 = const_per_interest5 = - const_per_total1 = const_per_total2 = const_per_total3 = const_per_total4 = const_per_total5 = - const_per_percent_total = const_per_principal_total = const_per_interest_total = construction_financing_cost = - std::numeric_limits::quiet_NaN(); - - N_financial_parameters::construction_financing_total_cost(total_installed_cost_out, - const_per_interest_rate1, const_per_interest_rate2, const_per_interest_rate3, const_per_interest_rate4, const_per_interest_rate5, - const_per_months1, const_per_months2, const_per_months3, const_per_months4, const_per_months5, - const_per_percent1, const_per_percent2, const_per_percent3, const_per_percent4, const_per_percent5, - const_per_upfront_rate1, const_per_upfront_rate2, const_per_upfront_rate3, const_per_upfront_rate4, const_per_upfront_rate5, - const_per_principal1, const_per_principal2, const_per_principal3, const_per_principal4, const_per_principal5, - const_per_interest1, const_per_interest2, const_per_interest3, const_per_interest4, const_per_interest5, - const_per_total1, const_per_total2, const_per_total3, const_per_total4, const_per_total5, - const_per_percent_total, const_per_principal_total, const_per_interest_total, construction_financing_cost); - - assign("const_per_principal1", (ssc_number_t)const_per_principal1); - assign("const_per_principal2", (ssc_number_t)const_per_principal2); - assign("const_per_principal3", (ssc_number_t)const_per_principal3); - assign("const_per_principal4", (ssc_number_t)const_per_principal4); - assign("const_per_principal5", (ssc_number_t)const_per_principal5); - assign("const_per_interest1", (ssc_number_t)const_per_interest1); - assign("const_per_interest2", (ssc_number_t)const_per_interest2); - assign("const_per_interest3", (ssc_number_t)const_per_interest3); - assign("const_per_interest4", (ssc_number_t)const_per_interest4); - assign("const_per_interest5", (ssc_number_t)const_per_interest5); - assign("const_per_total1", (ssc_number_t)const_per_total1); - assign("const_per_total2", (ssc_number_t)const_per_total2); - assign("const_per_total3", (ssc_number_t)const_per_total3); - assign("const_per_total4", (ssc_number_t)const_per_total4); - assign("const_per_total5", (ssc_number_t)const_per_total5); - assign("const_per_percent_total", (ssc_number_t)const_per_percent_total); - assign("const_per_principal_total", (ssc_number_t)const_per_principal_total); - assign("const_per_interest_total", (ssc_number_t)const_per_interest_total); - assign("construction_financing_cost", (ssc_number_t)construction_financing_cost); + if (csp_financial_model == 1) + { + double const_per_interest_rate1 = as_double("const_per_interest_rate1"); + double const_per_interest_rate2 = as_double("const_per_interest_rate2"); + double const_per_interest_rate3 = as_double("const_per_interest_rate3"); + double const_per_interest_rate4 = as_double("const_per_interest_rate4"); + double const_per_interest_rate5 = as_double("const_per_interest_rate5"); + double const_per_months1 = as_double("const_per_months1"); + double const_per_months2 = as_double("const_per_months2"); + double const_per_months3 = as_double("const_per_months3"); + double const_per_months4 = as_double("const_per_months4"); + double const_per_months5 = as_double("const_per_months5"); + double const_per_percent1 = as_double("const_per_percent1"); + double const_per_percent2 = as_double("const_per_percent2"); + double const_per_percent3 = as_double("const_per_percent3"); + double const_per_percent4 = as_double("const_per_percent4"); + double const_per_percent5 = as_double("const_per_percent5"); + double const_per_upfront_rate1 = as_double("const_per_upfront_rate1"); + double const_per_upfront_rate2 = as_double("const_per_upfront_rate2"); + double const_per_upfront_rate3 = as_double("const_per_upfront_rate3"); + double const_per_upfront_rate4 = as_double("const_per_upfront_rate4"); + double const_per_upfront_rate5 = as_double("const_per_upfront_rate5"); + + double const_per_principal1, const_per_principal2, const_per_principal3, const_per_principal4, const_per_principal5; + double const_per_interest1, const_per_interest2, const_per_interest3, const_per_interest4, const_per_interest5; + double const_per_total1, const_per_total2, const_per_total3, const_per_total4, const_per_total5; + double const_per_percent_total, const_per_principal_total, const_per_interest_total, construction_financing_cost; + + const_per_principal1 = const_per_principal2 = const_per_principal3 = const_per_principal4 = const_per_principal5 = + const_per_interest1 = const_per_interest2 = const_per_interest3 = const_per_interest4 = const_per_interest5 = + const_per_total1 = const_per_total2 = const_per_total3 = const_per_total4 = const_per_total5 = + const_per_percent_total = const_per_principal_total = const_per_interest_total = construction_financing_cost = + std::numeric_limits::quiet_NaN(); + + N_financial_parameters::construction_financing_total_cost(total_installed_cost_out, + const_per_interest_rate1, const_per_interest_rate2, const_per_interest_rate3, const_per_interest_rate4, const_per_interest_rate5, + const_per_months1, const_per_months2, const_per_months3, const_per_months4, const_per_months5, + const_per_percent1, const_per_percent2, const_per_percent3, const_per_percent4, const_per_percent5, + const_per_upfront_rate1, const_per_upfront_rate2, const_per_upfront_rate3, const_per_upfront_rate4, const_per_upfront_rate5, + const_per_principal1, const_per_principal2, const_per_principal3, const_per_principal4, const_per_principal5, + const_per_interest1, const_per_interest2, const_per_interest3, const_per_interest4, const_per_interest5, + const_per_total1, const_per_total2, const_per_total3, const_per_total4, const_per_total5, + const_per_percent_total, const_per_principal_total, const_per_interest_total, construction_financing_cost); + + assign("const_per_principal1", (ssc_number_t)const_per_principal1); + assign("const_per_principal2", (ssc_number_t)const_per_principal2); + assign("const_per_principal3", (ssc_number_t)const_per_principal3); + assign("const_per_principal4", (ssc_number_t)const_per_principal4); + assign("const_per_principal5", (ssc_number_t)const_per_principal5); + assign("const_per_interest1", (ssc_number_t)const_per_interest1); + assign("const_per_interest2", (ssc_number_t)const_per_interest2); + assign("const_per_interest3", (ssc_number_t)const_per_interest3); + assign("const_per_interest4", (ssc_number_t)const_per_interest4); + assign("const_per_interest5", (ssc_number_t)const_per_interest5); + assign("const_per_total1", (ssc_number_t)const_per_total1); + assign("const_per_total2", (ssc_number_t)const_per_total2); + assign("const_per_total3", (ssc_number_t)const_per_total3); + assign("const_per_total4", (ssc_number_t)const_per_total4); + assign("const_per_total5", (ssc_number_t)const_per_total5); + assign("const_per_percent_total", (ssc_number_t)const_per_percent_total); + assign("const_per_principal_total", (ssc_number_t)const_per_principal_total); + assign("const_per_interest_total", (ssc_number_t)const_per_interest_total); + assign("construction_financing_cost", (ssc_number_t)construction_financing_cost); + } + } // Return if only called for design point