SAM Open Source

SAM open source image

SAM logo SAM is Now Open Source!

All of the source code and tools required to build SAM is now available to the public. NREL will continue to maintain and update the code, and to release NREL versions of SAM for Windows, Mac and Linux with new features and updates.

SAM Open Source is the latest addition to the suite of ways you can use SAM for your research and analysis. It provides:

  • Transparency: Explore the source code to find equations and algorithms so you can see exactly how the models work.
  • Flexibility: Change the code and build your own versions of SAM to add your own features and capabilities.
  • Collaboration: Contribute new models, fix bugs, or work with NREL to implement new features that can be added to the NREL versions of SAM.

To learn more, watch a recording of the SAM Open Source webinar from September 2017.

Are you ready to dig in? Check it out at

Do you love SAM? Are you super excited that it’s now open source? Share with us what you’re doing with it and how it has helped you! Testimonials like yours help us secure funding to continue to develop this great tool.


Are you new to SAM? Check out our home page or download the desktop version to learn more about the many other ways that SAM can help you in your research, analysis, and development!

Where do I find SAM's source code?
SAM's source code is hosted on repositories. The main repository is at See the README and Wiki pages for information about the code repositories and instructions for building and contributing to the project.

What computer language is SAM written in?
Most of SAM is written in C++, and some of the user interface elements are written in LK script. SAM's code uses standard C libraries along with WxWidgets and WEX (an extension of WXWidgets written for SAM) libraries for the user interface, and LK libraries for scripting functionality. See this SAM Open Source wiki page for more about software dependencies.

How is SAM licensed?
SAM's open source code is copyrighted by the Alliance for Sustainable Energy and licensed under a mixed MIT and GPLv3 license. It allows for-profit and not-for-profit organizations to develop and redistribute software based on SAM under terms of an MIT license and requires that research entities including national laboratories, colleges and universities, and non-profit organizations make the source code of any redistribution publicly available under terms of a GPLv3 license.

Will NREL continue to maintain the source code?
Yes. NREL will continue to maintain the source code and to release NREL versions of SAM. NREL will also review contributions before accepting them as part of the open source code base.

Can I build and distribute my own version of SAM?
Yes, as long as you follow the terms of the SAM license

What other ways can I extend SAM’s functionality?
The desktop version of SAM includes tools for more advanced analysis, including parametric and stochastic simulations, P50/P90 analysis, and the built-in LK scripting language for full automated control over assigning inputs, running simulations, reading outputs, and reading and writing data to files. You can also use the SAM API that comes with the SAM SDK to access the SAM Simulation Core (SSC) library and run SAM from your own applications written in C/C++, Python, VBA, MATLAB, PHP, and other languages.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer