{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# MHKiT WEC-Sim Example\n", "\n", "This notebook demonstrates using the MHKiT wave module and [WEC-Sim](http://wec-sim.github.io/WEC-Sim/index.html) together to perform a resource characterization study in MHKiT, simulate representative cases with WEC-Sim, and visualize the results in MHKiT to estimate MAEP (Mean Annual Energy Production).\n", "\n", " 1. Characterize the available resource at a location\n", " - See the PacWave example notebook\n", " 2. Write a WEC-Sim batch file for the given clusters\n", " 3. Simulate the device *in WEC-Sim*.\n", " - Ensure that the spectra used in WEC-Sim is identical to the one used in MHKiT.\n", " 4. Load WEC-Sim batch results\n", " 5. Assess results and visualize quantities of interest\n", "\n", "This example uses WEC-Sim to simulate the [Oscillating Surge Wave Energy Converter (OSWEC)](https://wec-sim.github.io/WEC-Sim/main/user/tutorials.html#oscillating-surge-wec-oswec), a flap-type device.\n", "\n", "Start by importing MHKiT and the necessary python packages (e.g.`scipy.io`, `matplotlib.pyplot`, `pandas`, `numpy`)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from mhkit import wave\n", "import scipy.io as sio\n", "import matplotlib.pyplot as plt\n", "import pandas as pd\n", "import numpy as np" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. Characterize the available resource at a location\n", "\n", "This example will use an abbreviated version of `PacWave_resource_characterization_example.ipynb`. \n", "For full details on downloading, calculating, and visualizing the k-means clusters representation of the site's wave resouce, see that example.\n", "\n", "We select the N=32 cluster as it's total energy flux is closet to the total energy flux of the site considering all wave conditions. We will load the PacWave example output, which can be easily saved after running the example with the command `results[32].to_csv(\"pacwave_cluster_32.csv\")`. We will start this example by reading in that csv output and formatting it for WEC-Sim." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TeHm0weightsTpJ
07.9744911.2539700.0588619.2942796031.115427
110.7945332.6414030.03521612.58104137004.325098
26.9019791.9531220.0520018.04426412516.214519
312.6676287.3101160.00507014.764135367451.945581
412.8937012.2622940.01604615.02762436455.136139
510.5576214.7542970.01731112.304920116784.361789
68.7666642.7393800.04364610.21755731825.667989
76.5374031.3055780.0507467.6193505272.441394
89.6662911.3406940.03707011.2660738443.649821
912.7873073.9203970.01646414.903621107680.986511
1011.6058791.8210160.02232313.52666619446.169168
117.5840821.8787350.0546248.83925612827.143861
1210.1754116.1339320.00883611.859453188189.689187
139.3193574.5874320.01881710.86172295155.068368
147.2289961.2566910.0576928.4254035449.034309
155.6469671.3391070.0321186.5815474750.825175
167.6159802.6346200.0364978.87643325339.645267
179.4604063.3811470.03382411.02611452508.670941
1816.0004413.0442230.00429518.64853287446.895732
1910.5503431.5636340.03026512.29643712622.321616
2011.8174362.9829230.02171713.77323653748.089829
2112.1011225.3057270.01454014.103872177305.220432
2210.4000353.5882970.03231212.12125365405.272028
239.1325402.0115680.04813010.64398617913.129344
249.8802962.4629080.05063411.51549629157.316025
258.3218032.0030800.0541719.69907116104.920042
266.1313521.7944490.0354297.1460989295.960216
2711.4307273.9798910.02533113.32252590734.821382
2814.2638092.7817330.00935916.62448666183.179571
2913.7441615.4652250.00751816.018835240475.837506
308.7352511.2706300.04706610.1809456821.344537
318.3017483.6767670.0220709.67569754122.886646
\n", "
" ], "text/plain": [ " Te Hm0 weights Tp J\n", "0 7.974491 1.253970 0.058861 9.294279 6031.115427\n", "1 10.794533 2.641403 0.035216 12.581041 37004.325098\n", "2 6.901979 1.953122 0.052001 8.044264 12516.214519\n", "3 12.667628 7.310116 0.005070 14.764135 367451.945581\n", "4 12.893701 2.262294 0.016046 15.027624 36455.136139\n", "5 10.557621 4.754297 0.017311 12.304920 116784.361789\n", "6 8.766664 2.739380 0.043646 10.217557 31825.667989\n", "7 6.537403 1.305578 0.050746 7.619350 5272.441394\n", "8 9.666291 1.340694 0.037070 11.266073 8443.649821\n", "9 12.787307 3.920397 0.016464 14.903621 107680.986511\n", "10 11.605879 1.821016 0.022323 13.526666 19446.169168\n", "11 7.584082 1.878735 0.054624 8.839256 12827.143861\n", "12 10.175411 6.133932 0.008836 11.859453 188189.689187\n", "13 9.319357 4.587432 0.018817 10.861722 95155.068368\n", "14 7.228996 1.256691 0.057692 8.425403 5449.034309\n", "15 5.646967 1.339107 0.032118 6.581547 4750.825175\n", "16 7.615980 2.634620 0.036497 8.876433 25339.645267\n", "17 9.460406 3.381147 0.033824 11.026114 52508.670941\n", "18 16.000441 3.044223 0.004295 18.648532 87446.895732\n", "19 10.550343 1.563634 0.030265 12.296437 12622.321616\n", "20 11.817436 2.982923 0.021717 13.773236 53748.089829\n", "21 12.101122 5.305727 0.014540 14.103872 177305.220432\n", "22 10.400035 3.588297 0.032312 12.121253 65405.272028\n", "23 9.132540 2.011568 0.048130 10.643986 17913.129344\n", "24 9.880296 2.462908 0.050634 11.515496 29157.316025\n", "25 8.321803 2.003080 0.054171 9.699071 16104.920042\n", "26 6.131352 1.794449 0.035429 7.146098 9295.960216\n", "27 11.430727 3.979891 0.025331 13.322525 90734.821382\n", "28 14.263809 2.781733 0.009359 16.624486 66183.179571\n", "29 13.744161 5.465225 0.007518 16.018835 240475.837506\n", "30 8.735251 1.270630 0.047066 10.180945 6821.344537\n", "31 8.301748 3.676767 0.022070 9.675697 54122.886646" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "results = pd.read_csv(\"data/wave/pacwave_cluster_32.csv\", index_col=0)\n", "results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. Write a WEC-Sim batch file for the given clusters\n", "\n", "[WEC-Sim MCR](https://wec-sim.github.io/WEC-Sim/main/user/advanced_features.html#multiple-condition-runs-mcr) (multiple condition run) files should contain a structure `mcr` that contains two variables: `header` and `cases`. Each column of `header` and `cases` denotes a variable and it's value respectively. Each row is another simulation. WEC-Sim defines waves using the significant wave height and peak period. We will isolate these values from the results of the cluster analysis and create a dictionary that is written to the `.mat` file." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "scrolled": true }, "outputs": [], "source": [ "ws_mcr_cases = results[[\"Hm0\",\"Tp\"]]\n", "ws_mcr_header = np.array([\"waves.height\",\"waves.period\"], dtype='object')\n", "ws_mcr_out = {'mcr': {'header': ws_mcr_header, 'cases': ws_mcr_cases}}\n", "sio.savemat('mcr_mhkit.mat', ws_mcr_out)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3. Simulate the device *in WEC-Sim*\n", "\n", "Now that the MCR file is created, we need to go simulate WEC performance in these wave conditions using WEC-Sim. To recreate the data used in the next step, use the created MCR file with WEC-Sim's [OSWEC example](https://github.com/WEC-Sim/WEC-Sim/tree/main/examples/OSWEC). For an accurate comparison to the power calculated in the resource characterization, we should ensure that the WEC-Sim cases use irregular JONSWAP wave spectra as in the PacWave example.\n", "\n", "For convenience in this demonstration, we enforce OSWEC model stability in the extreme wave conditions by arbitrarily applying a large PTO stiffness and damping:\n", "```\n", "pto(1).stiffness = 1e5;\n", "pto(1).damping = 5e7;\n", "```\n", "\n", "To reduce the amount of extranenous data saved for this example, we limit the WEC-Sim output to the PTO's power output in the `userDefinedFunctions.m` script:\n", "```\n", "if exist('imcr','var')\n", " if imcr == 1\n", " nmcr = size(mcr.cases,1);\n", " power = nan(1, nmcr);\n", " end\n", "\n", " iRampEnd = simu.rampTime./simu.dtOut + 1;\n", " power(imcr) = -mean(output.ptos(1).powerInternalMechanics(iRampEnd:end,5));\n", "\n", " if imcr == nmcr\n", " % Save output\n", " save('mcr_mhkit_power.mat', 'power');\n", " end\n", "end\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 4. Load WEC-Sim batch results\n", "\n", "Note that in this example we do not save the entire WEC-Sim `output` structure for each case. See the `wecsim_example.ipynb` for information on loading that WEC-Sim data. Here the output is one array of average power output that we will load and compare to the resource characterization.\n", "\n", "Note that the power output \\[W\\] is significantly larger than the energy flux \\[W/m\\] due to the width of the OSWEC. " ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TeHm0weightsTpJP
07.9744911.2539700.0588619.2942796031.1154276.861312e+04
110.7945332.6414030.03521612.58104137004.3250983.873519e+05
26.9019791.9531220.0520018.04426412516.2145191.923400e+05
312.6676287.3101160.00507014.764135367451.9455811.951187e+06
412.8937012.2622940.01604615.02762436455.1361393.115873e+05
510.5576214.7542970.01731112.304920116784.3617898.410281e+05
68.7666642.7393800.04364610.21755731825.6679893.398579e+05
76.5374031.3055780.0507467.6193505272.4413948.332614e+04
89.6662911.3406940.03707011.2660738443.6498216.951609e+04
912.7873073.9203970.01646414.903621107680.9865115.068824e+05
1011.6058791.8210160.02232313.52666619446.1691681.601980e+05
117.5840821.8787350.0546248.83925612827.1438612.112478e+05
1210.1754116.1339320.00883611.859453188189.6891872.402013e+06
139.3193574.5874320.01881710.86172295155.0683681.067714e+06
147.2289961.2566910.0576928.4254035449.0343096.414256e+04
155.6469671.3391070.0321186.5815474750.8251757.328911e+04
167.6159802.6346200.0364978.87643325339.6452673.671972e+05
179.4604063.3811470.03382411.02611452508.6709414.020208e+05
1816.0004413.0442230.00429518.64853287446.8957322.414505e+05
1910.5503431.5636340.03026512.29643712622.3216161.335059e+05
2011.8174362.9829230.02171713.77323653748.0898293.552203e+05
2112.1011225.3057270.01454014.103872177305.2204321.343228e+06
2210.4000353.5882970.03231212.12125365405.2720287.368317e+05
239.1325402.0115680.04813010.64398617913.1293441.998769e+05
249.8802962.4629080.05063411.51549629157.3160252.715734e+05
258.3218032.0030800.0541719.69907116104.9200422.319710e+05
266.1313521.7944490.0354297.1460989295.9602161.478045e+05
2711.4307273.9798910.02533113.32252590734.8213829.391133e+05
2814.2638092.7817330.00935916.62448666183.1795712.000335e+05
2913.7441615.4652250.00751816.018835240475.8375068.686179e+05
308.7352511.2706300.04706610.1809456821.3445378.550423e+04
318.3017483.6767670.0220709.67569754122.8866467.578856e+05
\n", "
" ], "text/plain": [ " Te Hm0 weights Tp J P\n", "0 7.974491 1.253970 0.058861 9.294279 6031.115427 6.861312e+04\n", "1 10.794533 2.641403 0.035216 12.581041 37004.325098 3.873519e+05\n", "2 6.901979 1.953122 0.052001 8.044264 12516.214519 1.923400e+05\n", "3 12.667628 7.310116 0.005070 14.764135 367451.945581 1.951187e+06\n", "4 12.893701 2.262294 0.016046 15.027624 36455.136139 3.115873e+05\n", "5 10.557621 4.754297 0.017311 12.304920 116784.361789 8.410281e+05\n", "6 8.766664 2.739380 0.043646 10.217557 31825.667989 3.398579e+05\n", "7 6.537403 1.305578 0.050746 7.619350 5272.441394 8.332614e+04\n", "8 9.666291 1.340694 0.037070 11.266073 8443.649821 6.951609e+04\n", "9 12.787307 3.920397 0.016464 14.903621 107680.986511 5.068824e+05\n", "10 11.605879 1.821016 0.022323 13.526666 19446.169168 1.601980e+05\n", "11 7.584082 1.878735 0.054624 8.839256 12827.143861 2.112478e+05\n", "12 10.175411 6.133932 0.008836 11.859453 188189.689187 2.402013e+06\n", "13 9.319357 4.587432 0.018817 10.861722 95155.068368 1.067714e+06\n", "14 7.228996 1.256691 0.057692 8.425403 5449.034309 6.414256e+04\n", "15 5.646967 1.339107 0.032118 6.581547 4750.825175 7.328911e+04\n", "16 7.615980 2.634620 0.036497 8.876433 25339.645267 3.671972e+05\n", "17 9.460406 3.381147 0.033824 11.026114 52508.670941 4.020208e+05\n", "18 16.000441 3.044223 0.004295 18.648532 87446.895732 2.414505e+05\n", "19 10.550343 1.563634 0.030265 12.296437 12622.321616 1.335059e+05\n", "20 11.817436 2.982923 0.021717 13.773236 53748.089829 3.552203e+05\n", "21 12.101122 5.305727 0.014540 14.103872 177305.220432 1.343228e+06\n", "22 10.400035 3.588297 0.032312 12.121253 65405.272028 7.368317e+05\n", "23 9.132540 2.011568 0.048130 10.643986 17913.129344 1.998769e+05\n", "24 9.880296 2.462908 0.050634 11.515496 29157.316025 2.715734e+05\n", "25 8.321803 2.003080 0.054171 9.699071 16104.920042 2.319710e+05\n", "26 6.131352 1.794449 0.035429 7.146098 9295.960216 1.478045e+05\n", "27 11.430727 3.979891 0.025331 13.322525 90734.821382 9.391133e+05\n", "28 14.263809 2.781733 0.009359 16.624486 66183.179571 2.000335e+05\n", "29 13.744161 5.465225 0.007518 16.018835 240475.837506 8.686179e+05\n", "30 8.735251 1.270630 0.047066 10.180945 6821.344537 8.550423e+04\n", "31 8.301748 3.676767 0.022070 9.675697 54122.886646 7.578856e+05" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Relative location and filename of simulated WEC-Sim data (run with mooring)\n", "filename = \"./data/wave/mcr_mhkit_power.mat\"\n", "\n", "# Load data using the `wecsim.read_output` function which returns a dictionary of Datasets.\n", "wecsim_data = sio.loadmat(filename)\n", "results['P'] = wecsim_data['power'][0]\n", "results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 5. Assess results and visualize quantities of interest\n", "Now that we have loaded the OSWEC's modeled power, we can assess it's performance relative to the incoming wave and calculate the mean annual energy production (MAEP) using MHKiT." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TeHm0weightsTpJPCWCWR
07.9744911.2539700.0588619.2942796031.1154276.861312e+0411.3765230.632029
110.7945332.6414030.03521612.58104137004.3250983.873519e+0510.4677470.581542
26.9019791.9531220.0520018.04426412516.2145191.923400e+0515.3672640.853737
312.6676287.3101160.00507014.764135367451.9455811.951187e+065.3100480.295003
412.8937012.2622940.01604615.02762436455.1361393.115873e+058.5471440.474841
510.5576214.7542970.01731112.304920116784.3617898.410281e+057.2015470.400086
68.7666642.7393800.04364610.21755731825.6679893.398579e+0510.6787360.593263
76.5374031.3055780.0507467.6193505272.4413948.332614e+0415.8040900.878005
89.6662911.3406940.03707011.2660738443.6498216.951609e+048.2329430.457386
912.7873073.9203970.01646414.903621107680.9865115.068824e+054.7072600.261514
1011.6058791.8210160.02232313.52666619446.1691681.601980e+058.2380220.457668
117.5840821.8787350.0546248.83925612827.1438612.112478e+0516.4688140.914934
1210.1754116.1339320.00883611.859453188189.6891872.402013e+0612.7637870.709099
139.3193574.5874320.01881710.86172295155.0683681.067714e+0611.2207830.623377
147.2289961.2566910.0576928.4254035449.0343096.414256e+0411.7713630.653965
155.6469671.3391070.0321186.5815474750.8251757.328911e+0415.4266050.857034
167.6159802.6346200.0364978.87643325339.6452673.671972e+0514.4910150.805056
179.4604063.3811470.03382411.02611452508.6709414.020208e+057.6562740.425349
1816.0004413.0442230.00429518.64853287446.8957322.414505e+052.7611100.153395
1910.5503431.5636340.03026512.29643712622.3216161.335059e+0510.5769700.587609
2011.8174362.9829230.02171713.77323653748.0898293.552203e+056.6089840.367166
2112.1011225.3057270.01454014.103872177305.2204321.343228e+067.5757930.420877
2210.4000353.5882970.03231212.12125365405.2720287.368317e+0511.2656310.625868
239.1325402.0115680.04813010.64398617913.1293441.998769e+0511.1581240.619896
249.8802962.4629080.05063411.51549629157.3160252.715734e+059.3140740.517449
258.3218032.0030800.0541719.69907116104.9200422.319710e+0514.4037350.800207
266.1313521.7944490.0354297.1460989295.9602161.478045e+0515.8998610.883326
2711.4307273.9798910.02533113.32252590734.8213829.391133e+0510.3500870.575005
2814.2638092.7817330.00935916.62448666183.1795712.000335e+053.0224220.167912
2913.7441615.4652250.00751816.018835240475.8375068.686179e+053.6120800.200671
308.7352511.2706300.04706610.1809456821.3445378.550423e+0412.5348060.696378
318.3017483.6767670.0220709.67569754122.8866467.578856e+0514.0030520.777947
\n", "
" ], "text/plain": [ " Te Hm0 weights Tp J P \\\n", "0 7.974491 1.253970 0.058861 9.294279 6031.115427 6.861312e+04 \n", "1 10.794533 2.641403 0.035216 12.581041 37004.325098 3.873519e+05 \n", "2 6.901979 1.953122 0.052001 8.044264 12516.214519 1.923400e+05 \n", "3 12.667628 7.310116 0.005070 14.764135 367451.945581 1.951187e+06 \n", "4 12.893701 2.262294 0.016046 15.027624 36455.136139 3.115873e+05 \n", "5 10.557621 4.754297 0.017311 12.304920 116784.361789 8.410281e+05 \n", "6 8.766664 2.739380 0.043646 10.217557 31825.667989 3.398579e+05 \n", "7 6.537403 1.305578 0.050746 7.619350 5272.441394 8.332614e+04 \n", "8 9.666291 1.340694 0.037070 11.266073 8443.649821 6.951609e+04 \n", "9 12.787307 3.920397 0.016464 14.903621 107680.986511 5.068824e+05 \n", "10 11.605879 1.821016 0.022323 13.526666 19446.169168 1.601980e+05 \n", "11 7.584082 1.878735 0.054624 8.839256 12827.143861 2.112478e+05 \n", "12 10.175411 6.133932 0.008836 11.859453 188189.689187 2.402013e+06 \n", "13 9.319357 4.587432 0.018817 10.861722 95155.068368 1.067714e+06 \n", "14 7.228996 1.256691 0.057692 8.425403 5449.034309 6.414256e+04 \n", "15 5.646967 1.339107 0.032118 6.581547 4750.825175 7.328911e+04 \n", "16 7.615980 2.634620 0.036497 8.876433 25339.645267 3.671972e+05 \n", "17 9.460406 3.381147 0.033824 11.026114 52508.670941 4.020208e+05 \n", "18 16.000441 3.044223 0.004295 18.648532 87446.895732 2.414505e+05 \n", "19 10.550343 1.563634 0.030265 12.296437 12622.321616 1.335059e+05 \n", "20 11.817436 2.982923 0.021717 13.773236 53748.089829 3.552203e+05 \n", "21 12.101122 5.305727 0.014540 14.103872 177305.220432 1.343228e+06 \n", "22 10.400035 3.588297 0.032312 12.121253 65405.272028 7.368317e+05 \n", "23 9.132540 2.011568 0.048130 10.643986 17913.129344 1.998769e+05 \n", "24 9.880296 2.462908 0.050634 11.515496 29157.316025 2.715734e+05 \n", "25 8.321803 2.003080 0.054171 9.699071 16104.920042 2.319710e+05 \n", "26 6.131352 1.794449 0.035429 7.146098 9295.960216 1.478045e+05 \n", "27 11.430727 3.979891 0.025331 13.322525 90734.821382 9.391133e+05 \n", "28 14.263809 2.781733 0.009359 16.624486 66183.179571 2.000335e+05 \n", "29 13.744161 5.465225 0.007518 16.018835 240475.837506 8.686179e+05 \n", "30 8.735251 1.270630 0.047066 10.180945 6821.344537 8.550423e+04 \n", "31 8.301748 3.676767 0.022070 9.675697 54122.886646 7.578856e+05 \n", "\n", " CW CWR \n", "0 11.376523 0.632029 \n", "1 10.467747 0.581542 \n", "2 15.367264 0.853737 \n", "3 5.310048 0.295003 \n", "4 8.547144 0.474841 \n", "5 7.201547 0.400086 \n", "6 10.678736 0.593263 \n", "7 15.804090 0.878005 \n", "8 8.232943 0.457386 \n", "9 4.707260 0.261514 \n", "10 8.238022 0.457668 \n", "11 16.468814 0.914934 \n", "12 12.763787 0.709099 \n", "13 11.220783 0.623377 \n", "14 11.771363 0.653965 \n", "15 15.426605 0.857034 \n", "16 14.491015 0.805056 \n", "17 7.656274 0.425349 \n", "18 2.761110 0.153395 \n", "19 10.576970 0.587609 \n", "20 6.608984 0.367166 \n", "21 7.575793 0.420877 \n", "22 11.265631 0.625868 \n", "23 11.158124 0.619896 \n", "24 9.314074 0.517449 \n", "25 14.403735 0.800207 \n", "26 15.899861 0.883326 \n", "27 10.350087 0.575005 \n", "28 3.022422 0.167912 \n", "29 3.612080 0.200671 \n", "30 12.534806 0.696378 \n", "31 14.003052 0.777947 " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "results['CW'] = wave.performance.capture_width(results['P'], results['J'])\n", "oswec_width = 18\n", "results['CWR'] = results['CW'] / oswec_width\n", "results" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2865149.0" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "MAEP = wave.performance.mean_annual_energy_production_matrix(results['CW'], results['J'], results['weights']) / 1000 # kWh\n", "MAEP = np.round(MAEP, 0).item()\n", "MAEP" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.11" } }, "nbformat": 4, "nbformat_minor": 4 }