All of the source code and tools required to build SAM are available to the public on the SAM GitHub repositories. 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:
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 https://github.com/NREL/SAM.
Do you have a question or suggestion about the open source code? Post a question or comment on the SAM Open Source Forum.
Where do I find SAM's source code?
SAM's source code is hosted on GitHub.com repositories. The main repository is at https://github.com/nrel/sam. 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.
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.
PySAM is a Python wrapper for SAM that you can use to write Python code that makes calls to the SAM Simulation Core (SSC) compute modules. It provides access for tools for accessing SAM default values and input variables so you can create code directly in Python without having to run SAM's code generator.
For more information:
This overview presented on August 2, 2019 demonstrates how to use PySAM to build a renewable energy system model in Python using PySAM.
Note. The examples in this video use PySAM 1.2 with pvwattsv5. The example script provided here will not work with newer versions of PySAM with pvwattsv7. For more up-to-date examples, see the PySAM documentation.
This page is for information about and links to teaching materials used for academic courses that involve SAM. If you would like to share materials for courses you teach, please contact us.
For links to presentation materials and sample files used by NREL for SAM webinars, please see the relevant Videos page from the website nagivation menu. For example, materials for webinars we have given on modeling PV system are available on the PV Videos page.
Solar Resource Assessment and Economics (EME 810) is a graduate-level course for the Renewable Energy and Sustainability Systems (RESS) Program Solar Option.
Course resources for this and other RESS courses are Open Educational Resources via Creative Commons Share-Alike 3.0 licensing (per Dutton e-Education Institute at Penn State). Three solar courses are open now for sharing (EME 810, 811, and 812, and AE 868), along with several other key RESS courses are related to policy, technologies, and markets.
The following Solar Electric Investment Analysis (B-1291) series was developed by Milton Geiger (University of Wyoming), Eric Romich (Ohio State University), and Benjamin Rashford (University of Wyoming) and is available under a Creative Commons Attribution Non-Commercial 4.0 license (International) with permission granted to "share, copy, and redistribute the material in any medium or format and adapt, remix, transform, and build upon the material for any purpose other than commercial, under the following terms: Attribution You must give the appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner but not in any way that suggests the licensor endorses you or your use."
These materials provide information to help agricultural landowners make informed decisions about investing in photovoltaic power systems for behind-the-meter applications. Each part in the series is a short bulletin focusing on one aspect of the decision-making process. The bulletins cover technical and economic topics. Part 6 is an example using SAM.
This series has been also been adapted by John Hay (University of Nebraska).
SAM is widely used for projects and research outside of the United States. This page provides information about work done by the NREL SAM team and other organizations with a specific focus on features, sample files, and access to data for SAM around the world.
For information about where to find weather data to use with SAM, please see the Weather Data page. You can also search this website to find support forum discussions about specific countries, or about other aspects of the model.
The SAM team has participated in the Solar Energy Research Institute for India and the United States (SERIIUS) partnership between the U.S. Department of Energy Sunshot Initiative and India's Jawaharlal Nehru National Solar Energy Mission to support their vision of cooperation and innovation to develop solar electricity technologies.
This work has resulted in the following new features being added to SAM:
NREL staff have been using SAM's electricity metering and billing capabilities to explore compensation mechanisms for Mexico designed to promote deployment of photovoltaic distributed generation projects. This work is part of the 21st Century Power Partnership (21CPP) with the U.S. Agency for International Development and the Clean Energy Ministerial.
The Australian Solar Thermal Energy Association (AUSTELA) with the support of Australian Renewable Energy Agency developed a guide with a set of sample files and solar resource data to support the development of concentrating solar power projects in Australia. ITP Renewables developed the materials, and the SAM team reviewed documents and tested SAM files.
this is to test various ways to include links to things within the content. note, this will make the sea horse picture appear when the page gets loaded.
Creating a link to an article (on biomass combustion): click me - with the link dialog box, used the main panel to find an article to include.
Creating a link to an image (seahorse): picture me - with the link dialog box, used the browse button (next to the URL field) to find a file.
Creating a link to a file for download (SAM test txt file): file me - with the link dialog box, used the browse button (next to the URL field). Uploaded a test file and selected it.
Creating a link to a file for download (SAM test xlsx file): file me again - with the "Insert File" dialog box, used the browse button (next to the URL field).
Creating a link to a docman category (2017.9-linux): doc it - folder SAM 2017.9.5 Versions - with the "Document" button below the edit panel, selected a SAM category.
Creating a link to a docman document (2017.9-linux): doc it - SAM 2017.9.5 for Linux Document (234.52 MB) - with the "Document" button below the edit panel, selected a SAM document.
Creating a link to a docman file (2017.9-linux): doc it - SAM 2015.1.30 Mac dmg file (189.86 MB) - with the "Document" button below the edit panel, selected a SAM docman file.
You can see the page at: https://sam-test.nrelcloud.org/index.php?option=com_content&view=article&id=93