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

Can I get MathCAD to Ignore part of a data set?

Highlighted
Newbie

Can I get MathCAD to Ignore part of a data set?

I'm trying to do some curve fitting to surface data (X, Y, Z) using Minerr to fit measured data (Z) to a function of (X,Y), and under normal circumstances this works just fine. However, some of my data sets have a circular obscuration (approximately) in the middle so that there is no valid data in this region. I was hoping that if I set the data in this region to NaN, that the built-in MathCAD solver functions would simply ignore this data, but this doesn't seem to be the case.

My alternative is to "deconstruct" my matrices of X, Y, Z data into XYZ column vectors, remove the offending data points, perform the fit, put the offending data points back in, and then re-construct the mattrices from the column vectors.

Can anyone offer a better alternative?

6 REPLIES 6
Highlighted

Re: Can I get MathCAD to Ignore part of a data set?

My alternative is to "deconstruct" my matrices of X, Y, Z data into XYZ column vectors, remove the offending data points, perform the fit, put the offending data points back in, and then re-construct the mattrices from the column vectors.

Why do you need to put the offending data points back in?

There are many functions which can extract, remove or collect data based on a certain condition. A worksheet indicating the problem would greatly help.

Mike

Highlighted

Re: Can I get MathCAD to Ignore part of a data set?

You're right I don't need to put the offending points back in.

Highlighted

Re: Can I get MathCAD to Ignore part of a data set?

If you are using minerr the right way you should be constructing a matrix or vector of residuals (which you then minimize). When you do that, set the residuals for the offending points to zero. If that's not the way you are using minerr you had bettter post a worksheet.

Highlighted

Re: Can I get MathCAD to Ignore part of a data set?

Apr 20, 2011

Re: Can I get MathCAD to Ignore part of a data set?

If you are using minerr the right way you should be constructing a matrix or vector of residuals (which you then minimize). When you do that, set the residuals for the offending points to zero. If that's not the way you are using minerr you had bettter post a worksheet.

Richard: I tried your suggestion. I get a vector of residuals, and I created a new vector after changing the residuals of the offending points, But then Minerr won't work using the constraint equation with the new vector on one side of the boolean.
I would post a worksheet, but I have been working this problem on a classified computer. If I have a chance I'll work up a file to post on my unclass machine.
Highlighted

Re: Can I get MathCAD to Ignore part of a data set?

Maybe this will help.

Highlighted

Re: Can I get MathCAD to Ignore part of a data set?

Thanks-your sample file addresses exactly the issue, and illustrates how to strucuture a solution.

Announcements