Implementing realistic engine curve

Main Goal

I want to make a realistic car and when I reached to the engine physics thought that the torque of a hinge motor is constant. My goal is to make a realistic curve in an efficient way.

Attempted Solutions

What I have thought of is to make an active while true that is repeating every frame or 0.05 sec, but making a script that will look like ‘if rpm == xxxx then tq = xxx end’ will need at least 10 lines per 1000 rpm to make any detailed curve, but is way too far from a reasonably-sized code.

Another Idea came when I saw the curve created from the “controlled chaos” formula ‘Xn = RXm (1 - Xm)’ where Xn is the next year (n = m + 1), Xm is current year, R is growth rate.