Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

annual_heat_demand and sum of demand as result of bdew.HeatBuilding() differ slightly #33

Open
MaGering opened this issue Jan 15, 2021 · 4 comments
Assignees
Milestone

Comments

@MaGering
Copy link
Contributor

If you check the result, which is returned by bdew.HeatBuilding(), you'll find that its sum differs slightly from your input in annual_heat_demand.

To reproduce this, you can add these two lines to heat_demand_example.py here after calling bdew.HeatBuilding() for a single family housing ('efh'):

    result_annual_heat_demand = sum(demand["efh"])
    print("Sum of heat demand 'efh': ", result_annual_heat_demand)
@p-snft
Copy link
Member

p-snft commented Jan 15, 2021

To simplify discussion for those who cannot run the code right away: What are the numbers?

@MaGering
Copy link
Contributor Author

If you pass annual_heat_demand=25000 and shlp_type='EFH', then you'll get sum(demand["efh"]) = 25001.458160603575

@p-snft
Copy link
Member

p-snft commented Jan 16, 2021

I think, this inaccuracy is quite expected when using floating point numbers. If it's really necessary, it might be mitigated but not avoided.

@p-snft p-snft self-assigned this Jan 23, 2021
@p-snft
Copy link
Member

p-snft commented Jan 23, 2021

I found that the results in this area in the code are pretty sensitive to code changes. Maybe, it is possible to reduce the inaccuracy.

@uvchik uvchik added this to the Release v0.2 milestone Jan 27, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants