Boost Math Toolkit: Compare simulation data
Hallo, I want to use the test function from the boost math toolkit library to compare simulation results of mechantronic systems with a reference solution. The test reads the reference solution from a file, and after the simulation the test compares the file data with the data from a double array. But if a value of a function is close to zero, I will get a gross relative error. Do you have any suggestion to solve this problem? Thanks for your help in advance Best regards Niklas _______________________________________________________________________ Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 3 Monate kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220
NFarnsworth@web.de wrote:
Hallo, I want to use the test function from the boost math toolkit library to compare simulation results of mechantronic systems with a reference solution. The test reads the reference solution from a file, and after the simulation the test compares the file data with the data from a double array. But if a value of a function is close to zero, I will get a gross relative error. Do you have any suggestion to solve this problem? Thanks for your help in advance
This is a tricky one: the "test" function is specifically set up to follow the policies we use for our regression tests: it might not be ideal for general use yet, which is why it's listed under "Internal Details and Tools (Experimental)". The first thing you need to do is decide what kind of policy you want for comparison of the values - currently we treat all denormalised values as "effectively zero", but otherwise calculate the maximum relative difference between the values. I guess you would want to change the cutoff for "too small to count" or else change the way the relative difference is calculated - perhaps taking into account which value is the true value so we measure relative error, rather than relative difference. At present the only way to change the way this code behaves, is to treat it as am example and do a cut and paste and modify to taste job on it. However, I am interested in making this more generally useful to a wider range of situations, so any ideas or feedback are most welcome. John.
participants (2)
-
John Maddock
-
NFarnsworth@web.de