Extends from Buildings.BaseClasses.BaseIconExamples (Icon for Examples packages).
Name | Description |
---|---|
ExtendedPolynomialDerivativeCheck |
This example checks whether the function derivative is implemented correctly. If the derivative implementation is not correct, the model will stop with an assert statement.
Type | Name | Default | Description |
---|---|---|---|
Real | c[:] | {0.1162,1.5404,-1.4825,0.766... | Polynomial coefficients |
Real | xMin | 1 | Minimum x value for polynomial |
Real | xMax | 2 | Maximum x value for polynomial |
model ExtendedPolynomialDerivativeCheck parameter Real[:] c={0.1162,1.5404,-1.4825,0.7664,-0.1971} "Polynomial coefficients"; parameter Real xMin=1 "Minimum x value for polynomial"; parameter Real xMax=2 "Maximum x value for polynomial"; Real x; Real y; initial equation y=x; equation x=Buildings.Fluid.Utilities.extendedPolynomial(c, time, xMin, xMax); der(y)=der(x); assert(abs(x-y) < 1E-2, "Model has an error");end ExtendedPolynomialDerivativeCheck;