Extract CommonMath functions

Open
#642 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@amandeep25100-a11y is already working on this.

Since Nov 10, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
54/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp
Domain
backend

Research direction

Read the CommonMath functions and the REGCA and REPCA model definitions, then follow the extraction approach from issue #640. Move the listed helpers into CommonMath with their equations and tests alongside its existing functions; done means both models use the shared helpers and the associated tests pass.

Written by the indexing model from the issue text.

Description

cleanup
Summary

Extract the reusable math helpers in REGCA and REPCA into CommonMath.

Rationale

These functions are currently embedded in individual models. They should be reusable and have their equations and tests alongside the other CommonMath functions.

Description

Functions to extract:

  • REGCA: awmax (antiwindup with a moving upper bound) and iramp (inverse smooth ramp).
  • REPCA: droop, invertClamp (rename to iclamp, invertDeadband (rename to ideadband1/2), and the supporting logOneMinusExp.
Additional information

Follow-up to #640.

Dominant language
C++
Stars
27
Forks
11
Avg merge
2d 21h
Merged PRs (30d)
15

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ORNL/GridKit

All issues in ORNL/GridKit

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.