From 09bec6db04c89cada38858723482110d184bae88 Mon Sep 17 00:00:00 2001 From: Michael Wetter Date: Tue, 5 Mar 2024 11:06:47 -0800 Subject: [PATCH] Updated documentation --- IBPSA/Utilities/Math/Functions/Examples/Interpolate.mo | 4 ++-- IBPSA/Utilities/Math/Functions/interpolate.mo | 6 +++++- IBPSA/Utilities/Math/Functions/splineDerivatives.mo | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/IBPSA/Utilities/Math/Functions/Examples/Interpolate.mo b/IBPSA/Utilities/Math/Functions/Examples/Interpolate.mo index 99ddc892d3..3bb1d55d33 100644 --- a/IBPSA/Utilities/Math/Functions/Examples/Interpolate.mo +++ b/IBPSA/Utilities/Math/Functions/Examples/Interpolate.mo @@ -22,13 +22,13 @@ protected height=100, offset=-50) "Ramp from -50Pa to +50Pa"; initial equation - d =IBPSA.Utilities.Math.Functions.splineDerivatives( + d = IBPSA.Utilities.Math.Functions.splineDerivatives( x=xd, y=yd, ensureMonotonicity=true); equation dp=ramp.y; - m_flow =IBPSA.Utilities.Math.Functions.interpolate(u=dp,xd=xd,yd=yd,d=d); + m_flow = IBPSA.Utilities.Math.Functions.interpolate(u=dp, xd=xd, yd=yd, d=d); annotation ( experiment( diff --git a/IBPSA/Utilities/Math/Functions/interpolate.mo b/IBPSA/Utilities/Math/Functions/interpolate.mo index 56fb832770..1f2e359e8d 100644 --- a/IBPSA/Utilities/Math/Functions/interpolate.mo +++ b/IBPSA/Utilities/Math/Functions/interpolate.mo @@ -34,7 +34,11 @@ algorithm Documentation(info="

This function returns the value on a cubic hermite spline through the given support points -and provided spline derivatives at these points with monotonically increasing values. +and provided spline derivatives at these points. +The spline derivatives at the support points can be computed using + +IBPSA.Utilities.Math.Functions.splineDerivatives. +The support points must be monotonically increasing. Outside the provided support points, the function returns a linear extrapolation with the same slope as the cubic spline has at the respective support point.

diff --git a/IBPSA/Utilities/Math/Functions/splineDerivatives.mo b/IBPSA/Utilities/Math/Functions/splineDerivatives.mo index c5b194d4e7..ac460a8d9d 100644 --- a/IBPSA/Utilities/Math/Functions/splineDerivatives.mo +++ b/IBPSA/Utilities/Math/Functions/splineDerivatives.mo @@ -83,8 +83,8 @@ The algorithm to ensure monotonicity is based on the method described in Fritsch

This function is typically used with - -IBPSA.Utilities.Math.Functions.cubicHermiteLinearExtrapolation + +IBPSA.Utilities.Math.Functions.interpolate which is used to evaluate the cubic spline. Because in many applications, the shape of the spline depends on parameters which will no longer change once the initialisation is complete,