Skip to main content

UBC Solar's Simulation Environment

Project description

UBC Solar Physics

Documentation Status

UBC Solar's physics and environment models for simulating our groundbreaking solar cars.

The API is currently unstable, and backwards compatibility may not be maintained.

Requirements

Versions indicated are recommended

  • Git [^1]
  • Python >=3.9 [^2]
  • Rustc >=1.79.0 [^3]
  • Cargo >=1.79.0 [^4]

Installation

First, clone this repository.

git clone https://github.com/UBC-Solar/physics.git

Then, create and activate a virtual environment. Next, install dependencies in editable mode.

pip3 install -e .

Getting Started

Example of calculating solar arrays produced energy

from physics.models.arrays import BasicArray
import numpy as np

efficiency = 0.25  # 25.0% efficient
panel_size = 4.0   # 4.0m^2 of panels
tick = 1.0         # 1.0s interval

arrays = BasicArray(panel_efficiency=efficiency, panel_size=panel_size)

irradiance = np.full([5], 400.0)  # 10 seconds of 400.0W/m^2 irradiance

solar_power_produced = arrays.calculate_produced_energy(solar_irradiance=irradiance, tick=tick)

assert np.array_equal(solar_power_produced, np.array([400.0, 400.0, 400.0, 400.0, 400.0]))

Appendix

[^1]: use git --version to verify version

[^2]: use python3 --version to verify version

[^3]: use rustc --version to verify version

[^4]: use cargo --version to verify version

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ubc_solar_physics-1.1.0.tar.gz (36.4 kB view hashes)

Uploaded Source

Built Distributions

ubc_solar_physics-1.1.0-cp313-cp313-win_amd64.whl (197.0 kB view hashes)

Uploaded CPython 3.13 Windows x86-64

ubc_solar_physics-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (353.6 kB view hashes)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64

ubc_solar_physics-1.1.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (358.2 kB view hashes)

Uploaded CPython 3.13 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

ubc_solar_physics-1.1.0-cp313-cp313-macosx_11_0_arm64.whl (298.7 kB view hashes)

Uploaded CPython 3.13 macOS 11.0+ ARM64

ubc_solar_physics-1.1.0-cp313-cp313-macosx_10_13_x86_64.whl (305.3 kB view hashes)

Uploaded CPython 3.13 macOS 10.13+ x86-64

ubc_solar_physics-1.1.0-cp312-cp312-win_amd64.whl (197.0 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

ubc_solar_physics-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (353.6 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

ubc_solar_physics-1.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (358.2 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

ubc_solar_physics-1.1.0-cp312-cp312-macosx_11_0_arm64.whl (298.7 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

ubc_solar_physics-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl (305.3 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

ubc_solar_physics-1.1.0-cp311-cp311-win_amd64.whl (196.9 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

ubc_solar_physics-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (353.7 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ubc_solar_physics-1.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (359.1 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

ubc_solar_physics-1.1.0-cp311-cp311-macosx_11_0_arm64.whl (298.4 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

ubc_solar_physics-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl (306.6 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

ubc_solar_physics-1.1.0-cp310-cp310-win_amd64.whl (197.1 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

ubc_solar_physics-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (353.6 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ubc_solar_physics-1.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (359.0 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

ubc_solar_physics-1.1.0-cp310-cp310-macosx_11_0_arm64.whl (298.2 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

ubc_solar_physics-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl (306.5 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

ubc_solar_physics-1.1.0-cp39-cp39-win_amd64.whl (197.2 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

ubc_solar_physics-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (354.4 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ubc_solar_physics-1.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (359.2 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

ubc_solar_physics-1.1.0-cp39-cp39-macosx_11_0_arm64.whl (299.2 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

ubc_solar_physics-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl (306.5 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page