From 5d5e6b2d63ab9560323e9d648d13171b81c46aed Mon Sep 17 00:00:00 2001 From: Santeri Hiitola Date: Tue, 4 Jul 2023 13:37:41 +0300 Subject: [PATCH 1/4] Added updated noise prediction method --- Scripts/assignment/emme_assignment.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Scripts/assignment/emme_assignment.py b/Scripts/assignment/emme_assignment.py index c6add812..87ad56ae 100644 --- a/Scripts/assignment/emme_assignment.py +++ b/Scripts/assignment/emme_assignment.py @@ -425,18 +425,25 @@ def calc_noise(self): speed = (0.3*(60*link.length/link["@car_time_aht"]) + 0.7*link.data2) speed = max(speed, 50.0) - + # Calculate start noise - if speed <= 90: - heavy_correction = (10*log10((1-heavy_share) - + 500*heavy_share/speed)) + if speed >= 50: + LAE_light = 73.5 + 25*log10(speed/50) + LAE_heavy = 80.5 + 30*log10(speed/50) + if speed >= 40: + LAE_light = 73.5 + 25*log10(speed/50) + LAE_heavy = 80.5 + if speed < 40: + LAE_light = 71.1 + LAE_heavy = 80.5 + if cross_traffic > 0: + LAeq_light = LAE_light + 10*log10(cross_traffic/15/3600) + LAeq_heavy = LAE_heavy + 10*log10(heavy_share*cross_traffic/15/3600) + start_noise = 10*log10(10**(LAeq_light/10)+10**(LAeq_heavy/10)) else: - heavy_correction = (10*log10((1-heavy_share) - + 5.6*heavy_share*(90/speed)**3)) - start_noise = ((68 + 30*log10(speed/50) - + 10*log10(cross_traffic/15/1000) - + heavy_correction) - if cross_traffic > 0 else 0) + start_noise = 0 + + # Calculate noise zone width func = param.noise_zone_width From c5df0003fffce9130d29f3bbe55e9d4803d37d5e Mon Sep 17 00:00:00 2001 From: Santeri Hiitola Date: Tue, 4 Jul 2023 13:49:23 +0300 Subject: [PATCH 2/4] Sanity check log messages for noise calc --- Scripts/assignment/emme_assignment.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Scripts/assignment/emme_assignment.py b/Scripts/assignment/emme_assignment.py index 87ad56ae..f8f927cd 100644 --- a/Scripts/assignment/emme_assignment.py +++ b/Scripts/assignment/emme_assignment.py @@ -427,6 +427,7 @@ def calc_noise(self): speed = max(speed, 50.0) # Calculate start noise + log.info("NEW FORMULA FOR NOISE CALC") if speed >= 50: LAE_light = 73.5 + 25*log10(speed/50) LAE_heavy = 80.5 + 30*log10(speed/50) @@ -442,6 +443,7 @@ def calc_noise(self): start_noise = 10*log10(10**(LAeq_light/10)+10**(LAeq_heavy/10)) else: start_noise = 0 + log.info(start_noise) From 880488a871ddf65eeb2d0df82390f53d9de4273f Mon Sep 17 00:00:00 2001 From: Santeri Hiitola Date: Tue, 4 Jul 2023 13:55:14 +0300 Subject: [PATCH 3/4] Fixed log10 zero insertion --- Scripts/assignment/emme_assignment.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/assignment/emme_assignment.py b/Scripts/assignment/emme_assignment.py index f8f927cd..5c413927 100644 --- a/Scripts/assignment/emme_assignment.py +++ b/Scripts/assignment/emme_assignment.py @@ -429,7 +429,7 @@ def calc_noise(self): # Calculate start noise log.info("NEW FORMULA FOR NOISE CALC") if speed >= 50: - LAE_light = 73.5 + 25*log10(speed/50) + LAE_light = 73.5 + 25*log10(speed/50) LAE_heavy = 80.5 + 30*log10(speed/50) if speed >= 40: LAE_light = 73.5 + 25*log10(speed/50) @@ -439,8 +439,8 @@ def calc_noise(self): LAE_heavy = 80.5 if cross_traffic > 0: LAeq_light = LAE_light + 10*log10(cross_traffic/15/3600) - LAeq_heavy = LAE_heavy + 10*log10(heavy_share*cross_traffic/15/3600) - start_noise = 10*log10(10**(LAeq_light/10)+10**(LAeq_heavy/10)) + LAeq_heavy = LAE_heavy + 10*log10(heavy_share*cross_traffic/15/3600) if heavy_share > 0 else 0 + start_noise = 10*log10(10**(LAeq_light/10)+10**(LAeq_heavy/10)) if LAeq_heavy > 0 else LAeq_light else: start_noise = 0 log.info(start_noise) From c0a3c6de86a86dbc223e4aa88a6534071211a6c0 Mon Sep 17 00:00:00 2001 From: Santeri Hiitola Date: Thu, 17 Aug 2023 10:31:33 +0300 Subject: [PATCH 4/4] Fixed logic error with noise calculation --- Scripts/assignment/emme_assignment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/assignment/emme_assignment.py b/Scripts/assignment/emme_assignment.py index 5c413927..eda76678 100644 --- a/Scripts/assignment/emme_assignment.py +++ b/Scripts/assignment/emme_assignment.py @@ -431,10 +431,10 @@ def calc_noise(self): if speed >= 50: LAE_light = 73.5 + 25*log10(speed/50) LAE_heavy = 80.5 + 30*log10(speed/50) - if speed >= 40: + elif speed >= 40: LAE_light = 73.5 + 25*log10(speed/50) LAE_heavy = 80.5 - if speed < 40: + elif speed < 40: LAE_light = 71.1 LAE_heavy = 80.5 if cross_traffic > 0: