NAME

Text::CSV::Munge::Strain.pm


VERSION

Version 0.01


SYNOPSIS

This module recieves its method calls as a pass-through from its parent module. So your use statment calls only that one, not this one. You also only refer to that one, as below...

Establish new object.

use Text::CSV::Munge;

my $strains = Text::CSV::Munge->new();

Let us assume we already have a CSV file containing seven columns and 500 lines. Say that channel zero (1st column in the CSV) represents time as the X axis and that channels 1 through 6 (columns 2 through 7 of the CSV) represent readings in microstrain from two strain gage rosettes, one rectangular and one delta.

Assuming thus, we read in that file like so.

$strains->merge_csvs( /some/path/sg_data.csv', []);

We are assuming the input CSV is raw data. So let us add to that the usual qualities expected to be known for each of our 6 gages. Since they are specific to a given channel, and channels are represented in a CSV by single columns, we assign these qualities by setting a key in a hash for that column, like so...

$strains->set_col_key('ohms', 120, 1 .. 6);

$strains->set_col_key('gage factor', 2.01, 1 .. 6);

$strains->set_col_key('transverse sensitivity', 0.015, 1 .. 6);

Return the established column keys of any channel (CSV column).

And then just to check we'll see how that took by asking the module to describe those six columns by reading back a synopsis of all their column hash keys, like so...

print $strains->describe(1 .. 6);

All six strain gages now have have the necessary column key values assigned so that we may not proceed to calcuating their values into a combined, total strain reading complete with angle in degrees relative to gage 1 of the trio.

Our first three strain gage channels comprise a rectangular rosette. So let us now append three new channels (future CSV columns) describing the max and min principal strains and the angle in degrees, like so...

$strains->sg_rosette_rect( 1, 2, 3, $poisson );

Thus are channels 7 through 8 (future CSV columns 8 through 11) now exist, with channel names (future 1st-row column headings) appropriate to their data type. Further, the three original strain channels have been associated to their derivitive values by a new column hash key "array" whose value is a list of the derived channel (0-based) numbers. The derived channels have a similar key listing back to the source channel numbers.

Thus, with channels 7, 8 and 9 being derived channels, you may determine their source channels like so...

my @source_chans = $strains->get_col_key('array', 7);

...or likewise going the other way, like so...

my @derived_chans = $strains->get_col_key('array', 1);

Let us now do likewise for our 2nd trio of strain gages for the delta rosette, like so...

$strains->sg_rosette_delta( 4, 5, 6, $poisson );

...whereby we obtain similar results, except for its use of formula specific to the differing geometry. So having called thus, three new channels are created just as for the prior example.

We'll write out our calcuations saving only time and the two rosettes.

$strains-write_csv( /some/path/sg_and_rosette_data.csv', 0, 7 .. 12 );>


DESCRIPTION

Mostly for calculating the maximum and minimum principal strains from delta and rectangular strain gage rosettes.

All formula were taken from online documentation by Vishay Measurements Group:

http://www.vishay.com/brands/measurements_group/guide/tn/tn515/515drnj.htm

Transverse Sensitivity

Calculations made for strain gage rosettes include correction for transverse sensitivity using formulae garnered from Vishay Micro-Measurements Tech Note TN-509 as detailed by page and formula number within related subroutines.

Rectangular and delta rosettes are treated separately, each with its own unique correction formula particular to that type with separate GF and Kt for each gage.

A generic retro-rosette subroutine generates uncorrected three-gage output from corrected max/min principal strains. This method is of use mainly for testing and debugging.

Wheatstone Bridge Nonlinearity

Not yet implementted. Will be per Vishay Micro-Measurments Tech Note TN-507-1 when I get to it.


BUGS AND LIMITATIONS

This program is free software. It carries absolutely no warranties or guarantees of any kind (expressed, implied, or even vaguely hinted at).


AUTHOR

Gan Uesli Starling <gan@starling.us>


LICENSE AND COPYRIGHT

Copyright (c) 2006 Gan Uesli Starling. All rights reserved.

This program is free software; you may redistribute and/or modify it under the same terms as Perl itself.