seemps.analysis.factories.mps_affine#

seemps.analysis.factories.mps_affine(mps: MPS, orig: tuple[float, float], dest: tuple[float, float]) MPS[source]#

Applies an affine transformation to an MPS, mapping it from one interval [x0, x1] to another [u0, u1]. This is a transformation u = a * x + b, with u0 = a * x0 + b and and u1 = a * x1 + b. Hence, a = (u1 - u0) / (x1 - x0) and b = ((u1 + u0) - a * (x0 + x1)) / 2.

Parameters:
mpsMPS | MPSSum

The MPS to be transformed.

origtuple[float, float]

A tuple (x0, x1) representing the original interval.

desttuple[float, float]

A tuple (u0, u1) representing the destination interval.

Returns:
mps_affineMPS | MPSSum

The MPS affinely transformed from (x0, x1) to (u0, u1).