Skip to content

Commit

Permalink
use column vectors for rhs of linear algebra solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
shieldo committed Jul 19, 2023
1 parent 48170e6 commit 05f8cc4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/space_heat_demand/zone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ fn calc_temperatures(
let mut matrix_a: DMatrix<f64> = DMatrix::zeros(no_of_temps, no_of_temps);

// Init vector_b with zeroes (length = number of nodes + 1 for overall zone heat balance)
let mut vector_b: DMatrix<f64> = DMatrix::zeros(1, no_of_temps);
let mut vector_b: DVector<f64> = DVector::zeros(no_of_temps);

// One term in eqn 39 is sum from k = 1 to n of (A_elk / A_tot). Given
// that A_tot is defined as the sum of A_elk from k = 1 to n, this term
Expand Down Expand Up @@ -965,7 +965,7 @@ fn calc_temperatures(
/// external surface, and calculate temperatures in sequence
fn fast_solver(
coeffs: DMatrix<f64>,
rhs: DMatrix<f64>,
rhs: DVector<f64>,
no_of_temps: usize,
building_elements: &Vec<NamedBuildingElement>,
element_positions: &Vec<(usize, usize)>,
Expand All @@ -976,8 +976,8 @@ fn fast_solver(
// = total number of nodes + 1 for overall zone heat balance (and internal air temp)
let mut coeffs_adj: DMatrix<f64> = DMatrix::zeros(no_of_temps, no_of_temps);

// Init vector_b with zeroes (length = number of nodes + 1 for overall zone heat balance)
let mut rhs_adj: DMatrix<f64> = DMatrix::zeros(1usize, no_of_temps);
// Init rhs_adj with zeroes (length = number of nodes + 1 for overall zone heat balance)
let mut rhs_adj: DVector<f64> = DVector::zeros(no_of_temps);

// Init matrix with zeroes
// Number of rows in matrix = number of columns
Expand Down

0 comments on commit 05f8cc4

Please sign in to comment.