We will be performing a major infrastructure and web site ugprades on Friday, September 27th 8:00 am - 5:00 pm MST (UTC -7).

The website will be down during that time.

Macro "Subarray Layout Optimization" Question

  • bpm77
  • Topic Author
More
09 Dec 2018 21:21 #6547 by bpm77
Hello!

I'm simulating a system on SAM for a desired array size of 6362.35 kWdc. If I check the button "Estimate subarray 1 configuration", the resulting system (33 panels in series x 838 in parallel) has a size that I know does not fit in my area, because of the number of strings in parallel.

I found out that the macro "Subarray Layout Optimization" could optimize the layout given my area constraint. However, when I try running it the following error occurs:

Macro did not finish.
[810] referencing unassigned variable:modules_per_string_npv

I cannot seem to find a way to fix this error. Does anyone have a suggestion on how to tackle this?

Thank you,

Bruno

Please Log in or Create an account to join the conversation.

  • pgilman
More
10 Dec 2018 17:14 #6548 by pgilman
Replied by pgilman on topic Macro "Subarray Layout Optimization" Question
Dear Bruno,

For now the subarray layout optimization macro only works with the Residential and Commercial financial model. It will not work without a financial model because it uses the net present value (NPV) for the optimization.

It also does not work with the PPA financial models (single owner, partnership, leaseback) because of an issue with the variable name that we will fix in the next software update.

In the meantime, if you want to use the macro with a PPA financial model, you can fix it by modifying the macro script:
  1. On the Macro page, click View code at the top right of the window.
  2. Scroll down to Line 500:
    npv[i][j] = get('npv');
  3. Add the line
    npv[i][j] = get('project_return_aftertax_npv');
    after that line and use forward slashes
    //
    to comment out Line 500.
  4. Click Save, and then go back to the Macro page and try running the macro again.

This workaround allows you to change the variable name, so if you run the macro for a Residential or Commercial case, you can comment out the new Line 501 and use the variable assignment on Line 500 instead.

//npv[i][j] = get('npv'); // for Residential and Commercial
npv[i][j] = get('project_return_aftertax_npv'); // for PPA models


Best regards,
Paul.

Please Log in or Create an account to join the conversation.

Moderators: pgilman
Powered by Kunena Forum