From 09bbf49b1ad6349162021cdf5c98e8fec11e33b0 Mon Sep 17 00:00:00 2001 From: Sebastian Held Date: Wed, 31 Mar 2010 15:39:46 +0200 Subject: [PATCH] testsuite: new test: cavity.m (resonance frequency) --- TESTSUITE/combinedtests/cavity.m | 124 ++++++++++++++++------ TESTSUITE/helperscripts/check_frequency.m | 31 ++++++ 2 files changed, 123 insertions(+), 32 deletions(-) create mode 100644 TESTSUITE/helperscripts/check_frequency.m diff --git a/TESTSUITE/combinedtests/cavity.m b/TESTSUITE/combinedtests/cavity.m index 18310cb..39cbae9 100644 --- a/TESTSUITE/combinedtests/cavity.m +++ b/TESTSUITE/combinedtests/cavity.m @@ -7,9 +7,18 @@ ENABLE_PLOTS = 1; CLEANUP = 0; % if enabled and result is PASS, remove simulation folder STOP_IF_FAILED = 1; % if enabled and result is FAILED, stop with error -% LIMITS -upper_error = 0.036; % max +3.6% -lower_error = 0; % max -0.0% +% LIMITS - inside +lower_rel_limit = 1.3e-3; % -0.13% +upper_rel_limit = 1.3e-3; % +0.13% +lower_rel_limit_TM = 2.5e-3; % -0.25% +upper_rel_limit_TM = 0; % +0% +min_rel_amplitude = 0.6; % 60% +min_rel_amplitude_TM = 0.27; % 27% + +% LIMITS - outside +outer_rel_limit = 0.02; +max_rel_amplitude = 0.17; + % structure a = 5e-2; @@ -19,7 +28,7 @@ if ~((b f2, f2_idx = f2_idx - 1; end + + if strcmp( type, 'inside' ) + if max( val(f1_idx:f2_idx) ) < max1 * rel_amplitude + pass = false; + return + end + elseif strcmp( type, 'outside' ) + if max( val(f1_idx:f2_idx) ) > max1 * rel_amplitude + pass = false; + return + end + else + error 'unsupported operation' + end +end