30
1 Getting Organized: Data Management for MathCAD Bradley Carman June 2012

Data Management for MathCAD

Embed Size (px)

Citation preview

Page 1: Data Management for MathCAD

1

Getting Organized: Data Management for MathCAD

Bradley CarmanJune 2012

Page 2: Data Management for MathCAD

2

Introduction

MathCAD is the ideal tool for data analysis

Not ideal for data storage and management

A tool is needed for Data Management

Started with Excel Add-in, Evolved to full application (SciData)

Data Management

Page 3: Data Management for MathCAD

3

Applied Example: Drag Coefficient Measurement for Parachute

Parachutes A-D dropped from 100m elevation

Velocity measured every 0.5s for 5s

100kg mass attached to each parachute

Goal is to determine the Drag Coefficient: Cv

Ac=1.5m2

A B

C D

Ac=1.75m2

Ac=1.4m2

Ac=2m2

Page 4: Data Management for MathCAD

4

Data Analysis – The Current Way

MathCAD easily provides the Data Analysis for this problemPlotting, Curve Fitting, etc.

But, current data import is “Hard Coded”

1. Hard Coded Data Input and Characteristic Values

2. Analysis & Results

Page 5: Data Management for MathCAD

5

Data Analysis – The Current Way

Problems:

Slow to change out data sets

No link between characteristic values and data sets

Changing data sets often leads to separate MathCAD files = tendency for errors

Page 6: Data Management for MathCAD

6

Data Analysis – The New Way

Replace hard coded data and characteristic values with variables

Feed the variables data from database using the MathCAD API

Analysis & Results remain exactly the same!

1. Variable Data Input/Characteristic Values

2. Analysis & Results

Page 7: Data Management for MathCAD

7

Data Analysis – The New Way

Result:

Single MathCAD document and analysis

Quickly change out data sets

Data and characteristic values can be linked

Page 8: Data Management for MathCAD

8

Separating Data from Analysis - Implemented

Real benefit now comes from a Data Management System as the driver of inputs and outputs of the analysis

Now it is possible to Batch Process all data sets!

Retrieved Results

Send to MathCAD

Data Management System

Data

Characteristic Values

Results

Data

Characteristic Values

Results

Data

Characteristic Values

Results

Data

Characteristic Values

Results

Page 9: Data Management for MathCAD

9

Demonstration: Using SciData as the Data Management System

Data is organized in a table

Each row contains a data set, characteristic values, and results

Data

Characteristic Values

Results

Page 10: Data Management for MathCAD

10

Step 1: Importing Data

Data files use SDS Standard

Page 11: Data Management for MathCAD

11

Step 2: Categorize the Data Set

Page 12: Data Management for MathCAD

12

Step 3: Add Characteristic Values to the Data Set

Page 13: Data Management for MathCAD

13

Step 4: Link to MathCAD Analysis File

Page 14: Data Management for MathCAD

14

Step 5: Execute the Link

Page 15: Data Management for MathCAD

15

Step 6: Setup Inputs and Outputs

# = Result tag

Note: Results are retrieved by file due to bugs with MathCAD API. WRITEPRN is much faster.

Page 16: Data Management for MathCAD

16

Step 6: Setup Outputs Continued…

Page 17: Data Management for MathCAD

17

Step 7: Batch Processing

Page 18: Data Management for MathCAD

18

Step 8: Compile Results

All results are now compiled together and ready to be presented

Since everything came from the same MathCAD analysis, there are no discrepancies among results

Fast, organized, and error free!

Parachute Ax CvA 1.5 1.48B 1.75 2.34C 2 2.59D 1.4 1.84

Page 19: Data Management for MathCAD

19

Conclusion

Data and Analysis are now separate:

-Now have a good place to store and organize data and information

-Enabling batch processing

-Improving efficiency and accuracy!

sourceforge.net/projects/scidata/

Page 20: Data Management for MathCAD

20

Additional Examples

Design Table

Full Table Analysis

Table Filter

Data Extraction

High Speed Video Analysis

Page 21: Data Management for MathCAD

21

Parachute Design Table

Page 22: Data Management for MathCAD

22

Full Table Analysis

Page 23: Data Management for MathCAD

23

Table Filter

Page 24: Data Management for MathCAD

24

Data Extraction

When SciData cannot interpret a data file, only the file name is added

Use MathCAD to interpret and filter more complex data files, then export to SciData

First challenge: Building a path to the file using the name

Building a relative path Best practice

Page 25: Data Management for MathCAD

25

Data Extraction

Handling different data formats

Page 26: Data Management for MathCAD

26

Data Extraction

Use READFILE or READPRN

Don’t Use Import>Data>…

Problem: - Can’t use variable path

Problem: - Can’t use relative path ‘..\..\Data\’- Has bugs (problems updating)

Page 27: Data Management for MathCAD

27

Data Extraction

READPRN can filter out all non-numeric information automatically.

Page 28: Data Management for MathCAD

28

Data Extraction

1. Data Extraction File

2. Extract to SciData

3. Add Clean Analysis File

4. Start with a Clean Slate

Page 29: Data Management for MathCAD

29

High Speed Video Drop Analysis

1. In DOS run: ren *.bmp *.bmp.dat

2. Scan Data folder

3. Batch Process, get dropPositionX

4. Full Table Analysis

Page 30: Data Management for MathCAD

30

Review

Data Management for MathCAD SciData can be downloaded at:

– sourceforge.net/projects/scidata/

Data Management benefits:– Organization and error avoidance– All data types stored conveniently together in a standardized form (metadata and arrays)– Batch Processing– Row by Row and Full Table Analysis from the same root source

Contact Info– Brad Carman– [email protected]

Questions?– Remember your evaluations