{"id":34045850,"url":"https://github.com/ppadillaq/sammoo","last_synced_at":"2026-04-07T11:32:15.598Z","repository":{"id":282575294,"uuid":"909617635","full_name":"ppadillaq/sammoo","owner":"ppadillaq","description":"Optimization of Solar Industrial Process Heat (SIPH) systems with Concentrated Solar Power (CSP) by the use of NREL-PySAM package to System Advisor Model (SAM), in the context of my Master's degree of Research in Industrial Technology at the Universidad Nacional de Educación a Distancia (UNED) in Spain.","archived":false,"fork":false,"pushed_at":"2026-03-14T12:36:59.000Z","size":4032,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-14T22:24:17.447Z","etag":null,"topics":["modelling-and-simulation","multiobjective-optimization","renewable-energy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ppadillaq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-29T09:12:47.000Z","updated_at":"2026-03-14T12:20:35.000Z","dependencies_parsed_at":"2025-08-11T15:17:52.395Z","dependency_job_id":"d43fc39d-c8a8-49f5-8f33-d763494dccfa","html_url":"https://github.com/ppadillaq/sammoo","commit_stats":null,"previous_names":["ppadillaq/sam-model-optim","ppadillaq/sammoo"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ppadillaq/sammoo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppadillaq%2Fsammoo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppadillaq%2Fsammoo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppadillaq%2Fsammoo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppadillaq%2Fsammoo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppadillaq","download_url":"https://codeload.github.com/ppadillaq/sammoo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppadillaq%2Fsammoo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31511606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["modelling-and-simulation","multiobjective-optimization","renewable-energy"],"created_at":"2025-12-13T23:23:57.949Z","updated_at":"2026-04-07T11:32:15.585Z","avatar_url":"https://github.com/ppadillaq.png","language":"Python","readme":"# sammoo\n\n**SAMMOO: System Advisor Model Multi-Objective Optimization**\n\n**Python-based Framework for Multi-Objective Optimization of Renewable Energy Systems using NREL's System Advisor Model (SAM)**\n\nOptimization of Solar Industrial Process Heat (SIPH) systems using Concentrated Solar Power (CSP) technologies through the NREL [PySAM](https://nrel-pysam.readthedocs.io/en/latest/) package (System Advisor Model). This project was developed in the context of my Master's Thesis in Research in Industrial Technologies at the Universidad Nacional de Educación a Distancia (UNED), Spain.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/ppadillaq/sammoo/master/assets/sammoo-logo_white.png\" alt=\"sammoo logo\" width=\"300\"/\u003e\n\u003c/p\u003e\n\n\n---\n\n## 🌞 Overview\n\nThis Python package integrates:\n- **System Advisor Model (SAM)** via NREL PySAM for the simulation of parabolic trough systems.\n- **ParMOO** for multi-objective optimization using surrogate models.\n\nIt allows you to:\n- Run parametric studies on industrial CSP systems.\n- Optimize system configurations with multiple economic and technical objectives.\n- Analyze Pareto fronts and export results.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/ppadillaq/sammoo/master/assets/example_Pareto_Front.svg\" alt=\"Pareto Front\" width=\"400\"/\u003e\n\u003c/p\u003e\n\n## 📦 Features\n\n- Modular simulation wrapper (`ConfigSelection`) for different SAM configurations.\n- Integration with PySAM modules: `TroughPhysicalIph`, `LcoefcrDesign`, `CashloanHeat`, etc.\n- Multi-objective optimization engine (`ParMOOSim`) using ParMOO.\n- Automatic switching from sequential to batch acquisition.\n- Exportable plots and CSV reports.\n\n## Thermal Load Profiles\n\n### 🔥 ThermalLoadProfileLPG\n\nThe `ThermalLoadProfileLPG` class generates a realistic hourly **thermal load profile** from monthly LPG consumption (in tonnes), compatible with SAM’s “User-defined thermal load profile” input.\n\n- Working schedule: Monday to Friday, 6:00–19:00\n- Outputs hourly thermal demand in kJ/h, kWh, and kW\n- Includes:\n  - Yearly and weekly plotting\n  - CSV export\n  - Energy balance summary\n\n#### Example usage:\n\n```python\nfrom sammoo.profiles.thermal_load_lpg import ThermalLoadProfileLPG\n\nmonthly_data = {1: 5000, 2: 4000, ..., 12: 3000}\nprofile = ThermalLoadProfileLPG(monthly_data)\nprofile.plot_year()\nprofile.export_csv(\"thermal_profile.csv\")\n```\n\n## 🗂️ Project Structure\n\n```\nsammoo/\n├── sammoo/                             # Core package\n│   ├── __init__.py\n│   ├── version.py\n│   ├── config_selection.py              # ConfigSelection class\n│   ├── parmoo_simulation.py             # ParMOOSim class\n│   ├── components/                      # New components module (v0.2.0)\n│   │   ├── __init__.py\n│   │   ├── thermal_load_lpg.py          # ThermalLoadProfileLPG class (enhanced)\n│   │   ├── weather_design_point.py      # Weather-based DNI calculation helper\n│   │   └── solar_loop_configuration.py  # Solar field / loop setup helpers\n│   ├── resources/\n│   │   ├── solar_resource/\n│   │   │   └── seville_spain.csv        # Default weather CSV\n│   │   └── collector_data/\n│   │       └── iph_collectors_parameters.csv  # Industrial Process Heat collectors database\n│   └── templates/                       # JSON SAM templates\n│       ├── __init__.py\n│       └── iph_parabolic_commercial_owner/\n│           ├── __init__.py\n│           └── *.json\n├── examples/                            # Example usage scripts\n│   ├── op1_single_objective_comparison.py\n│   ├── opt2_design_point_multiobj.py\n│   ├── opt3_multiobj_row_distance.py\n│   └── opt4_startup_shutdown.py\n├── README.md\n├── CHANGELOG.md\n├── pyproject.toml\n├── MANIFEST.in\n├── LICENSE\n\n```\n\n## 📂 Example Scripts\n\nThe `examples/` folder contains several usage scenarios of the `sammoo` package:\n\n- `opt1_single_objective_comparison.py`: Compare optimal designs for different single-objective formulations (e.g., LCOE, Payback, LCS, NPV).\n- `opt2_design_point_multiobj.py`: Multi-objective optimization at a fixed design point (e.g., SM and storage hours), optionally applying a thermal load profile.\n- `opt3_multiobj_row_distance.py`: Multi-objective optimization of solar field row spacing (`Row_Distance`) using ParMOO.\n- `opt4_startup_shutdown.py`: Optimization focusing on startup/shutdown temperatures and their impact on techno-economic performance.\n\n💡 **Note**: Example scripts (`examples/`) are not included in the PyPI installation.  \nIf you want to explore the examples, please [clone the GitHub repository](https://github.com/ppadillaq/sammoo).\n\n\n---\n\n## 🚀 Quick Start\n\n### ✅ Option 1: Install from PyPI *(recommended for users)*\n\n```bash\npip install sammoo\n```\n\nYou can now use the package in Python:\n```bash\nfrom sammoo import ConfigSelection, ParMOOSim\n```\n\u003e 💡 **Note:** Example scripts (`examples/`) are not included in the PyPI installation.  \n\u003e If you want to explore examples, clone the GitHub repository instead:\n\n```bash\ngit clone https://github.com/ppadillaq/sammoo.git\ncd sammoo\npython examples/single_objective_comparison.py\n```\n\n### 🛠 Option 2: Install from source (for development)\nIf you want to work with the source code:\n```bash\ngit clone https://github.com/ppadillaq/sammoo.git\ncd sammoo\npip install -e .\n```\n\n### ▶️ Run an example\n\n```bash\npython examples/opt1_single_objective_comparison.py\n```\n\n## 🛠 Dependencies\n\n- Python ≥ 3.10\n- NREL PySAM\n- ParMOO\n- NumPy\n- Matplotlib (for plotting)\n\nInstall them via:\n\n```\npip install pysam parmoo numpy matplotlib\n```\n\n## 📈 Example Use Case\n\n```python\n# Minimal example: multi-objective optimization with a thermal load profile\n\nfrom sammoo import ConfigSelection, ParMOOSim\nfrom sammoo.components import ThermalLoadProfileLPG\n\n# 1) (Optional) Generate an hourly thermal load profile from monthly LPG consumption (kg)\nmonthly_kg = {1: 11000, 2: 9000, 3: 8000, 4: 9500, 5: 9200, 6: 9800,\n              7: 8600, 8: 8700, 9: 9000, 10: 9400, 11: 8800, 12: 9600}\nprofile = ThermalLoadProfileLPG(monthly_kg=monthly_kg)  # uses default efficiency and PCI\n\n# 2) Define the design space (use \"continuous\" / \"integer\")\ndesign_vars = {\n    \"specified_solar_multiple\": ([1.0, 3.0], \"continuous\"),\n    \"tshours\": ([2, 8], \"integer\"),\n}\n\n# 3) Define objectives (minimize LCOE, maximize LCS)\nselected_outputs = [\"LCOE\", \"-LCS\"]\n\n# 4) Create the SAM configuration (optionally set collector/HTF)\ncfg = ConfigSelection(\n    config=\"Commercial owner\",\n    selected_outputs=selected_outputs,\n    design_variables=design_vars,\n    collector_name=\"Power Trough 250\",   # optional\n    htf_name=\"Therminol VP-1\",           # optional\n    verbose=0\n)\n\n# Apply the demand profile → sets timestep_load_abs and sizes q_pb_design\nprofile.apply_to_config(cfg)\n\n# 5) Run the optimization (increase search_budget and sim_max for better results)\nopt = ParMOOSim(cfg, search_budget=20, auto_switch=True)\nopt.solve_all(sim_max=50)\n\n# 6) Display results\nprint(opt.get_results())\n\n```\n\n## ☀️ Weather Data\n\nThe simulation requires a weather file (`file_name`) in CSV format. You can:\n\n- ✅ Provide your own via `user_weather_file=\"path/to/weather.csv\"`\n- 🔁 Or let the framework use a built-in default (Tucson, AZ)\n\nYour custom weather files must follow the TMY3 format used by SAM.\n\n\n## 📚 Publications\n\nVersion **0.3.0** of this project was used in the development of the following master's thesis in the Master's programme in *Research in Industrial Technologies* (Energy Engineering track), UNED (Spain):\n\n- Padilla-Quesada, P. (2025). *Sammoo: Un marco de optimización multiobjetivo basada en simulaciones para el diseño de sistemas solares térmicos de calor de proceso industrial* [Trabajo Fin de Máster, Universidad Nacional de Educación a Distancia (UNED)]. https://hdl.handle.net/20.500.14468/31636\n\n[Download full thesis (PDF)](https://e-spacio.uned.es/bitstreams/87c9541c-8e90-4a36-a15d-b0c7b5e2132f/download)\n\nFuture versions may include broader support for other CSP technologies, reinforcement learning-based controllers, and integration with digital twin platforms.\n\n\n## 📄 License\n\nThis project is licensed under the **BSD 3-Clause License**.  \nSee the [`LICENSE`](./LICENSE) file for full text.\n\n## 👤 Author\n\nPedro Padilla Quesada\u003cbr\u003e\nMSc in Research in Industrial Technologies\u003cbr\u003e\nUNED, Spain\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppadillaq%2Fsammoo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppadillaq%2Fsammoo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppadillaq%2Fsammoo/lists"}