Skip to content

Commit

Permalink
Merge pull request #24 from NREL/main
Browse files Browse the repository at this point in the history
include mike's changes
  • Loading branch information
martin-springer authored Sep 14, 2023
2 parents cec16e8 + 401dceb commit 51c1913
Show file tree
Hide file tree
Showing 8 changed files with 555 additions and 133 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/binder.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: Binder
on:
workflow_dispatch:
push:
branches:
- main
# name: Binder
# on:
# workflow_dispatch:
# push:
# branches:
# - main

# Push to dockerhub and cache on binder
jobs:
binder:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
# # Push to dockerhub and cache on binder
# jobs:
# binder:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# with:
# ref: ${{ github.event.pull_request.head.sha }}

- name: update jupyter dependencies with repo2docker
uses: jupyterhub/repo2docker-action@master
with:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_NREL_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_NREL_TOKEN }}
BINDER_CACHE: true
PUBLIC_REGISTRY_CHECK: true
MYBINDERORG_TAG: ${{ github.event.ref }} # This builds the container on mybinder.org with the branch that was pushed on.
# - name: update jupyter dependencies with repo2docker
# uses: jupyterhub/repo2docker-action@master
# with:
# DOCKER_USERNAME: ${{ secrets.DOCKERHUB_NREL_USER }}
# DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_NREL_TOKEN }}
# BINDER_CACHE: true
# PUBLIC_REGISTRY_CHECK: true
# MYBINDERORG_TAG: ${{ github.event.ref }} # This builds the container on mybinder.org with the branch that was pushed on.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 111,
"metadata": {},
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install pvdeg==0.1.1"
"# pip install pvdeg==0.1.1"
]
},
{
Expand Down Expand Up @@ -65,10 +65,19 @@
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Latitude = 39.73 Longitude = -105.18 - -\n"
]
}
],
"source": [
"PSM_FILE = os.path.join(DATA_DIR,'psm3_demo.csv')\n",
"WEATHER, META = pvdeg.weather.read(PSM_FILE,'psm')"
"WEATHER, META = pvdeg.weather.read(PSM_FILE,'psm')\n",
"print ( 'Latitude =', META['latitude'], 'Longitude =', META ['longitude'] , META['Country'], META['City'])"
]
},
{
Expand All @@ -82,7 +91,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 37,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -101,35 +110,58 @@
"source": [
"## 3. VantHoff Degradation\n",
"\n",
"Van 't Hoff Irradiance Degradation\n",
"Van't Hoff Irradiance Degradation Equation:\n",
"$$ R_o = R_D · G^p · T_f^{\\frac{T}{10} }$$\n",
"\n",
"For one year of degredation the controlled environmnet lamp settings will need to be set to IWa.\n",
"For the yearly average degredation outdoors to be the same as the controlled environmnet, the lamp settings will need to be set to *G$_{WA}$* and the temperature set to *T$_{oeq}$*.\n",
"\n",
"As with most `pvdeg` functions, the following functions will always require two arguments (weather_df and meta)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"execution_count": 39,
"metadata": {
"scrolled": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"AF = 27.8 , T_oeq = 19.6 (°C) , and G_WA = 297 (W/m²)\n"
]
}
],
"source": [
"# chamber irradiance (W/m^2)\n",
"I_chamber = 1000 \n",
"# chamber temperature (C)\n",
"temp_chamber = 60\n",
"\n",
"# calculate the VantHoff Acceleration factor\n",
"# chamber irradiance (W/m²)\n",
"I_chamber = 1600 \n",
"# chamber temperature (°C)\n",
"temp_chamber = 85\n",
"# Schwartzchild Coefficient\n",
"p=0.64\n",
"# Acceleration factor for every 10°C\n",
"Tf=1.41\n",
"\n",
"# calculate the Van't Hoff Acceleration factor\n",
"vantHoff_deg = pvdeg.degradation.vantHoff_deg(weather_df=WEATHER, meta=META,\n",
" I_chamber=I_chamber,\n",
" temp_chamber=temp_chamber,\n",
" poa=poa_df,\n",
" temp_cell=temp_cell)\n",
" temp=temp_cell, \n",
" p=p, \n",
" Tf=Tf)\n",
"\n",
"# calculate the VantHoff weighted irradiance\n",
"# calculate the Van't Hoff weighted irradiance\n",
"irr_weighted_avg_v = pvdeg.degradation.IwaVantHoff(weather_df=WEATHER, meta=META,\n",
" poa=poa_df,\n",
" temp_cell=temp_cell)"
" temp=temp_cell, \n",
" p=p, \n",
" Tf=Tf)\n",
"# calculate the Van't Hoff weighted average temperature\n",
"To_eq = pvdeg.degradation._to_eq_vantHoff(temp_cell, Tf)\n",
"\n",
"print ('AF =', round(vantHoff_deg,1), ', T_oeq =', round(To_eq,1) , '(°C) , and G_WA =',round(irr_weighted_avg_v), '(W/m²)')"
]
},
{
Expand All @@ -139,21 +171,23 @@
"## 4. Arrhenius\n",
"Calculate the Acceleration Factor between the rate of degredation of a modeled environmnet versus a modeled controlled environmnet\n",
"\n",
"Example: \"If the AF=25 then 1 year of Controlled Environment exposure is equal to 25 years in the field\"\n",
"Example: \"If the *AF*=25 then 1 year of Controlled Environment exposure is equal to 25 years in the field\"\n",
"\n",
"Equation:\n",
"$$ AF = N * \\frac{ I_{chamber}^x * RH_{chamber}^n * e^{\\frac{- E_a}{k T_{chamber}}} }{ \\Sigma (I_{POA}^x * RH_{outdoor}^n * e^{\\frac{-E_a}{k T_outdoor}}) }$$\n",
"$$ AF = N · \\frac{ G_{chamber}^x · RH_{chamber}^n · e^{\\frac{- E_a}{k T_{chamber}}} }{ \\Sigma (G_{POA}^x · RH_{outdoor}^n · e^{\\frac{-E_a}{k T_outdoor}}) }$$\n",
"\n",
"Function to calculate IWa, the Environment Characterization (W/m²). For one year of degredation the controlled environmnet lamp settings will need to be set at IWa.\n",
"Function to calculate *G$_{WA}$*, the Environment Characterization (W/m²). If the controlled environmnet lamp settings are set at *G$_{WA}$*, and the temperature set to *T$_{eq}$*, then the degradation will be the same as the yearly average outdoors.\n",
"\n",
"Equation:\n",
"$$ I_{WA} = [ \\frac{ \\Sigma (I_{outdoor}^x * RH_{outdoor}^n e^{\\frac{-E_a}{k T_{outdood}}}) }{ N * RH_{WA}^n * e^{- \\frac{E_a}{k T_eq}} } ]^{\\frac{1}{x}} $$"
"$$ G_{WA} = [ \\frac{ \\Sigma (G_{outdoor}^x · RH_{outdoor}^n e^{\\frac{-E_a}{k T_{outdood}}}) }{ N · RH_{WA}^n · e^{- \\frac{E_a}{k T_eq}} } ]^{\\frac{1}{x}} $$"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"execution_count": 8,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# relative humidity within chamber (%)\n",
Expand All @@ -171,13 +205,13 @@
" rh_chamber=rh_chamber,\n",
" temp_chamber=temp_chamber,\n",
" poa=poa_df,\n",
" temp_cell=temp_cell,\n",
" temp=temp,\n",
" Ea=Ea)\n",
"\n",
"irr_weighted_avg_a = pvdeg.degradation.IwaArrhenius(weather_df=WEATHER, meta=META,\n",
" poa=poa_df, \n",
" rh_outdoor=WEATHER['relative_humidity'],\n",
" temp_cell=temp_cell,\n",
" temp=temp,\n",
" Ea=Ea)"
]
},
Expand All @@ -192,8 +226,10 @@
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"execution_count": 9,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# chamber settings\n",
Expand All @@ -213,8 +249,10 @@
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"execution_count": 10,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"rh_surface = pvdeg.humidity.surface_outside(rh_ambient=WEATHER['relative_humidity'],\n",
Expand Down Expand Up @@ -244,8 +282,10 @@
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"execution_count": 11,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"fatigue = pvdeg.fatigue.solder_fatigue(weather_df=WEATHER, meta=META)"
Expand All @@ -265,8 +305,10 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"execution_count": 12,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# select the month of June\n",
Expand Down Expand Up @@ -301,7 +343,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.9.16"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion binder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
### DO NOT EDIT THIS FILE! This Is Automatically Generated And Will Be Overwritten ###
FROM silvanaayala136/pvdegradationtools:e5d0ad05e725
FROM silvanaayala136/pvdegradationtools:ad0dae17a2d4
Loading

0 comments on commit 51c1913

Please sign in to comment.