RTORPA Example

[1]:
import generation_models as gt
from tyba_client.client import Client
import numpy as np
import pandas as pd
import os
[2]:
client = Client(personal_access_token=os.environ["TYBA_PAT"])
[3]:
model = gt.StandaloneStorageModel(
    energy_prices=gt.DARTPrices(
        dam=np.random.random(48).tolist(),
        rtm=np.random.random(48).tolist(),
        rtorpa=np.random.random(48).tolist(),
    ),
    project_term=48,
    project_term_units="hours",
    storage_inputs=gt.MultiStorageInputs(
        batteries=[
            gt.BatteryParams(
                power_capacity=1000.0,
                energy_capacity=1000.0 * 2,
                charge_efficiency=0.95,
                discharge_efficiency=0.95,
                degradation_rate=0.0,
            )
        ],
    ),
)
[4]:
resp = client.schedule(model)
resp.raise_for_status()
res = client.wait_on_result(resp.json()["id"])
df = pd.DataFrame(res)
[5]:
# two new columns
df[["rtorpa", "soe_mean"]]
[5]:
rtorpa soe_mean
0 0.459418 475.000000
1 0.698615 1000.000000
2 0.814061 1525.000000
3 0.426796 2000.000000
4 0.660763 1473.684211
5 0.426009 736.184211
6 0.733494 1000.000000
7 0.991707 1737.500000
8 0.816683 1576.315789
9 0.040184 626.315789
10 0.862928 575.000000
11 0.967568 1525.000000
12 0.528905 1968.534483
13 0.320486 1410.753176
14 0.179744 756.034483
15 0.506928 1102.631579
16 0.184159 1051.315789
17 0.758873 1000.000000
18 0.773333 1737.500000
19 0.427789 1473.684211
20 0.568534 473.684211
21 0.038720 50.000000
22 0.406480 575.000000
23 0.467345 1525.000000
24 0.176373 1525.000000
25 0.489898 1525.000000
26 0.294734 2000.000000
27 0.096778 1473.684211
28 0.047591 473.684211
29 0.199256 475.000000
30 0.028051 1263.815789
31 0.402718 1051.315789
32 0.273838 1000.000000
33 0.517905 1737.500000
34 0.550950 2000.000000
35 0.059592 2000.000000
36 0.037408 1473.684211
37 0.083896 1422.368421
38 0.208502 1374.977314
39 0.552403 688.793103
40 0.530890 1000.000000
41 0.328186 1051.315789
42 0.720418 1102.631579
43 0.503628 1051.315789
44 0.096158 1000.000000
45 0.879919 1737.500000
46 0.244617 1473.684211
47 0.264351 473.684211
[ ]: