cpmodel / FTT_StandAlone

Future Technology Transformation models
GNU General Public License v3.0
9 stars 1 forks source link

Ensuring shares sum to 1 #51

Closed rhayward1 closed 9 months ago

rhayward1 commented 10 months ago

This update will make the following changes to how capacity or share additions are made in FTT stand alone, and how regulations are corrected for the stretching effect:

All files are diffable so please critique the code and perform your own tests to confirm policy decisions are coming through as intended. If share/capacity additions every iteration becomes an issue, Cormac's method of only adding in the last iteration is also successful. Perhaps a switch for this should be a further development?

BONUS COMMIT

I have committed a launch.json file which, if debugging in vscode, will disable numba for you, so you do not need to comment any appearances of njit out if you want to debug the code. When debugging, select the Python: Debug File configuration.

Femkemilene commented 10 months ago

I believe you can continue to commit in your branch, which automatically updates the pull request. May not have time till Friday.


From: Rosie Hayward @.> Sent: 16 August 2023 15:31 To: cpmodel/FTT_StandAlone @.> Cc: Nijsse, Femke @.>; Review requested @.> Subject: Re: [cpmodel/FTT_StandAlone] Ensuring shares sum to 1 (PR #51)

CAUTION: This email originated from outside of the organisation. Do not click links or open attachments unless you recognise the sender and know the content is safe.

@rh-camecon commented on this pull request.


In SourceCode/Industrial_Heat/ftt_mtm_main.pyhttps://github.com/cpmodel/FTT_StandAlone/pull/51#discussion_r1296009058:

     isReg = np.zeros([len(titles['RTI']), len(titles['ITTI'])])
  • division = np.zeros([len(titles['RTI']), len(titles['ITTI'])])
  • division = divide((data_dt['IWK3'][:, :, 0] - data['IRG3'][:, :, 0]),
  • data_dt['IRG3'][:, :, 0])
  • isReg = 0.5 + 0.5np.tanh(21.25*division)
  • isReg = np.where(data['IRG3'][:, :, 0] > 0.0,
  • (np.tanh(1 +
  • (data_dt['IUD3'][:, :, 0] - data['IRG3'][:, :, 0])
  • / data['IRG3'][:, :, 0])),
  • 0.0) isReg[data['IRG3'][:, :, 0] == 0.0] = 1.0

I'm happy to go with that equation if you have tested it, there is nothing wrong with ugly maths if it is ensuring the model works as intended.

I can't change my commit, but it looks like this will work for all the models (just checked it made sense for heat, where HREG is in shares for some reason) so if you want to put it in as a suggested change in all of them, I'm happy to add it to this pull!

— Reply to this email directly, view it on GitHubhttps://github.com/cpmodel/FTT_StandAlone/pull/51#discussion_r1296009058, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGHDII4WKDY5UTD32PQBOHLXVTKUZANCNFSM6AAAAAA3SNK6X4. You are receiving this because your review was requested.Message ID: @.***>