cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Excel Component - is there a better work flow for processing external data?

akelly
11-Garnet

Excel Component - is there a better work flow for processing external data?

Using Mathcad 15 to do curve fitting of measured data. It's pretty tedious to down-select a subset of the data, analyze it and publish the results. over-and-over-and-over again (e.g. every time the test laboratory runs a new test).  Wondering if there's a faster way.

 

I'm using the Excel Component rather than File Input (or other means of getting external data into Mathcad).

 

I have a bunch of test data in Excel. Every test is stored in a different file.  Every file has different numbers of rows.  Inside the data are several events.  I'm only interested in doing data analysis between two specific events. Meaning the size of the data I'm interested in and its location in the file is variable every time the test is run.

 

My work flow looks something like this:

  • Excel
    • save-a-copy of my pre-processing / post processing template.
    • Copy / paste the data from the test lab's Excel file into my template.
    • Inspect the template for the measurements that indicate the start and end of the event.  Note the start/end rows of the data of interest.
      Note: I haven't figured out how to do this by equation - it requires external information and a bit of "engineering judgement".
  • Mathcad
    • save-a-copy of my curve-fitting template
    • double-click on the excel component to activate it.
    • delete the data in the excel component
  • Excel
    • Copy the subset between the start and end of the event
  • Mathcad
    • Paste the data from the excel template into the excel component
    • Note the number of rows in the pasted data
    • update the output ranges so it matches the size of the pasted data
    • Inspect the results of curve fits to various equations
    • choose a "winner" by inspection. I'll call them outputs A and B.
  • Excel
    • copy / paste Mathcad Output A into the Excel Template.
      All of the dependent formulas and plots are updated after pasting
    • Copy / paste the plots of the post-processed data into PowerPoint or Word.
  • PowerPoint / Word
    • Paste the Excel plots
    • Paste the Mathcad Output B value.

Yes, I'm a Mathsoft hold-out.  I like the Word processing features that still haven't been ported to Prime 6 and Mathsoft's plots still look more professional.

5 REPLIES 5
LucMeekes
23-Emerald III
(To:akelly)

Yes, there is. 

You shouldn't need to go through Excel before your first operations in Mathcad.

Display, tabulation and selection can also be done in Mathcad. If Excel can Read a file, Mathcad can (be tought to) do the same.

 

Why don't you share an example?

 

Luc

 

Attached.  This comes from an HP/Agilent data logger, I think.  Someone else is taking the data and sending me the spreadsheets.  Every run will have a different number of scans.

  1. normalize the measured data as Output/Input.  Call it Output.normal
  2. find the null offset.  In THIS data set, it's an Output.null is an average of Output.normal from Scans 1-71, however this is variable from test to test.
  3. Isolate the "events" of interest.  There are two.  In THIS data set, Event 1 happens between scans 75 and 1887 or 1888.  Event 2 happens between scans 1892 and the end of the data.
  4. Note the time at the start of Event 1.  Create a new column Time.elapsed such that the start of Event 1 happens at Time.elapsed=0 minutes.
  5. Perform curve fits of Output.normal_Event_1 vs.Time.elapsed.  I don't have a universal function to describe this event, so I'm doing curve fits to about 7 different equations.  Doing a visual inspection of all of them and using engineering judgement to decide which one of them best describes the measured data. Some of the curve fits are unusable (e.g. undefined for some values of Time.elapsed, e.g. produces imaginary numbers, etc.) 
  6. Get Output.start from the best curve at Time.elapsed=0.  Get Output.end from the best curve at Time.elapsed=10 minutes.
  7. Calculate Stability=(Output.end-Output.start)/Output.start
  8. Create a new column as Output.change=(Output.normal_event_1-Output.start)/Output.start
  9. Create a new column as Output.recovery=(Output.normal_event_2-Output.null)/Output.start
  10. Plot #1 has 2 series.  Output.change vs. Time.elapsed for event 1. And the curve fit over the same time scale.
  11. Plot #2 has 1 series. Output.recovery vs. Time.elapsed for Event 2.

curve fits attached.  Mathcad 15.

Fred_Kohlhepp
23-Emerald I
(To:akelly)

I fed your data into CurveExpert (you can find it on-line) and it thinks your best function for fitting both of your examples is a Hoerl model:

FredKohlhepp_0-1602249187184.png

where a, b, and c are data fits.

Equally capable (it said) is a Weibull model:

FredKohlhepp_1-1602249286021.png

Which is very close to your first function:

FredKohlhepp_2-1602249352450.png

So it looks like you're on course!

 

Good luck!

I think mathcad is probably not the right tool for this problem.  Matlab or python probably allows more scripting to better handle it.  Ideally you'd get the test lab to standardize format, but that maybe isn't possible.   If the challenge is finding the right fit I'll again point out to the forum zunzun.com which will step through far more options than CurveFitPro and is free, but slow.  (However, it is often down as it currently).  Furthermore, the site has open source programming for the various fits so if you port it python you can borrrow some code.  I think the code is also available on github.

Top Tags