Funktion auf cubicSplineInterpolation

This commit is contained in:
Jens Cornelsen
2025-01-13 20:05:54 +01:00
parent 373f75359a
commit 89d31f606b
4 changed files with 15 additions and 13 deletions

View File

@@ -1,3 +1,5 @@
<script lang="ts">
import { BedarfsausweisWohnenClient, GebaeudeAufnahmeClient } from "#components/Ausweis/types.js";
import { funktionMonatlicherBelastungsgrad } from "#lib/Berechnungen/BedarfsausweisWohnen/funktionMonatlicherBelastungsgrad.js";
@@ -8,9 +10,9 @@
export let gebaeude_aufnahme: GebaeudeAufnahmeClient;
// Beispielwerte - müssen noch errechnet werden
let heizlast = 25;
let zeitkonstante = 110;
let maximalerWaermestrom = 2500;
let heizlast = 150;
let zeitkonstante = 90;
let maximalerWaermestrom = 10000;
let waermeQuellen = {
Januar: 100,

View File

@@ -1,6 +1,6 @@
// Funktion zur Berechnung des Ausnutzungsgrades aus Tabelle 18
import { linearInterpolation, nevillePolynomialInterpolation } from "js-interpolate";
import { cubicSplineInterpolation, nevillePolynomialInterpolation } from "js-interpolate";
const dataset = {
alleMonate: {
@@ -130,7 +130,7 @@ export function funktionAusnutzungsgrad(
for (const key in data) {
const values = data[key as unknown as keyof typeof data];
const interpolated = linearInterpolation(
const interpolated = cubicSplineInterpolation(
values.map((value, i) => ({
x: waermeQuellenSenkenVerhaeltnis[i],
y: value,
@@ -142,7 +142,7 @@ export function funktionAusnutzungsgrad(
interpolations.push(interpolated);
}
const interpolated = linearInterpolation(
const interpolated = cubicSplineInterpolation(
interpolations.map((interpolation, i) => {
return {
x: Object.keys(data)[i],

View File

@@ -1,10 +1,10 @@
// Funktion zur Berechnung der Bilanzinnentemperatur aus Tabelle 8 EFH oder Tabelle 10 MFH
import { linearInterpolation, nevillePolynomialInterpolation } from "js-interpolate";
import { cubicSplineInterpolation } from "js-interpolate";
import { any } from "node_modules/cypress/types/bluebird/index.js";
// aus Eingabeformular
let wohneinheiten = 3;
let wohneinheiten = 2;
const datasetEinfamilienHaus = {
Januar: {
@@ -157,7 +157,7 @@ export function funktionBilanzInnentemperatur(heizlast: number, zeitkonstane: nu
for (const key in data) {
const values = data[key as unknown as keyof typeof data]
const interpolated = linearInterpolation(
const interpolated = cubicSplineInterpolation(
values.map((value, i) => ({ x: HeizLast[i], y: value })),
heizlast
)
@@ -165,7 +165,7 @@ export function funktionBilanzInnentemperatur(heizlast: number, zeitkonstane: nu
interpolations.push(interpolated)
}
const interpolated = linearInterpolation(
const interpolated = cubicSplineInterpolation(
interpolations.map((interpolation, i) => {
return {
x: Object.keys(data)[i],

View File

@@ -1,6 +1,6 @@
// Funktion zur Berechnung des monatlichen Belastungsgrades aus Tabelle 9 EFH und Tabelle 11 MFH
import { linearInterpolation } from "js-interpolate";
import { cubicSplineInterpolation } from "js-interpolate";
// aus Eingabeformular
let wohneinheiten = 3;
@@ -156,7 +156,7 @@ export function funktionMonatlicherBelastungsgrad(heizlast: number, zeitkonstane
for (const key in data) {
const values = data[key as unknown as keyof typeof data]
const interpolated = linearInterpolation(
const interpolated = cubicSplineInterpolation(
values.map((value, i) => ({ x: HeizLast[i], y: value })),
heizlast
)
@@ -164,7 +164,7 @@ export function funktionMonatlicherBelastungsgrad(heizlast: number, zeitkonstane
interpolations.push(interpolated)
}
const interpolated = linearInterpolation(
const interpolated = cubicSplineInterpolation(
interpolations.map((interpolation, i) => {
return {
x: Object.keys(data)[i],