Having successfully delivered similar projects involving complex power system calculations and data integration using Python, including replicating intricate algorithms for transmission capacity calculations, I'm confident I can accurately replicate the IDCCb ATC calculations for you. My experience with network analysis, PTDF and RAM data handling, coupled with expertise in utilizing APIs for data retrieval, makes me well-suited for this task.
My approach will involve a meticulous breakdown of the IDCCb calculation process as described in the provided documentation, specifically focusing on Article 20 and the distinction between positive and negative RAM values. I will develop a Python script that leverages the JAO API to fetch the necessary "Final Domain" data (PTDF and RAM), IDCCa values, and then implement the calculation logic, mirroring the exact steps outlined in the documentation. This will include handling the conditional logic for positive and negative RAM, ensuring the calculations are performed correctly for each CNEC. The script will output the final IDCCb ATC values in JSON format, mirroring the structure of the published results.
To ensure the solution is perfectly tailored to your needs, could you share more details about how you are currently attempting the calculation and where the discrepancies lie?