App-ErrorCalculator
view release on metacpan or search on metacpan
lib/App/ErrorCalculator.pm view on Meta::CPAN
$inlabel->set_text('Valid Data File ');
$data = $ref;
}
}
sub _run_calculation {
my $func = $body;
if (not $funclabel->get_text() eq 'Valid Function ') {
new_and_run
Gtk2::Ex::Dialogs::ErrorMsg( text => "You should give me a valid formula first." );
return();
}
if (not $inlabel->get_text() eq 'Valid Data File ') {
new_and_run
Gtk2::Ex::Dialogs::ErrorMsg( text => "You need to select a valid input data file first." );
return();
}
if (not $outlabel->get_text() eq 'Valid Output File ') {
lib/App/ErrorCalculator.pm view on Meta::CPAN
The function body may contain any number of constants, variables,
operators, functions and parenthesis.
The exact syntax can be obtained by reading
the manual page for L<Math::Symbolic::Parser>. Arithmetic
operators (C<+ - * / ^>) are supported. The caret indicates
exponentiation. Trigonometric, inverse
trigonometric and hyperbolic functions are implemented
(C<sin cos tan cot asin acos atan acot sinh cosh asinh acoth>).
C<log> indicates a natural logarithm.
Additionally, you may include derivatives in the formula which
will be evaluated (analytically) for you. The syntax for this is:
C<partial_derivative(a * x + b, x)>. (Would evaluate to C<a>.)
In order to allow for errors in constants, the program uses the
L<Math::SymbolicX::Error> parser extension: use the
C<error(1 +/- 0.2)> function to include constants with
associated uncertainties in your formulas.
The input files may be of any format recognized by the
L<Spreadsheet::Read> module. That means: Excel sheets,
OpenOffice (1.0) spreadsheets, CSV (comma separated values)
text files, etc.
The program reads tabular data from the spreadsheet file.
It expects each column to contain the data for one variable
in the formula.
a, b, c
1, 2, 3
4, 5, 6
7, 8, 9
This would assign C<1> to the variable C<a>, C<2> to C<b>
and C<3> to C<c> and then evaluate the formula with those
values. The result would be written to the first data line
of the output file. Then, the data in the next row will be
used and so on. If a column is missing data, it is assumed
to be zero.
Since this is about errors, you can declare any number of
errors to the numbers as demonstrated below:
a, a_1, a_2, b, b_1
1, 0.2, 0.1, 2, 0.3
lib/App/ErrorCalculator.pm view on Meta::CPAN
=head2 run
Just load the module with C<require App::ErrorCalculator> and then run
App::ErrorCalculator->run;
=head1 SEE ALSO
New versions of this module can be found on http://steffen-mueller.net or CPAN.
L<Math::Symbolic> implements the formula parser, compiler and evaluator.
(See also L<Math::Symbolic::Parser> and L<Math::Symbolic::Compiler>.)
L<Number::WithError> does the actual error propagation.
L<Gtk2> offers the GUI.
=head1 AUTHOR
Steffen Mueller, E<lt>particles-module at steffen-mueller dot net<gt>
( run in 0.244 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )