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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Force Roots to Specific Values of X - Polynomial Regression (Polyfitc)

AATaylor
5-Regular Member

Force Roots to Specific Values of X - Polynomial Regression (Polyfitc)

Hi,

I have used the polyfitc regression function to fit a polynomial to a set of data.

The curve describes the deflection of a beam, and so must be zero at specific points, x (the supports).

Unfortunately, the roots are slightly inaccurate. Is it possible to force the roots of the output of polynomial regression function?

 

Many thanks and kind regards

1 ACCEPTED SOLUTION

Accepted Solutions

Find attached

1) the implementation of what I was talking about when I mentioned the addition of data to pull the resulting zeros more to 0 and 1000

and

2) a (IMHO better) way to get the necessary coefficients using a solve block with minerr where we can force 0 to be a perfect zero and can weight the constraint f(1000)=0 very easily.

 

View solution in original post

5 REPLIES 5

If the number of given roots equals the order of the polynomial you wouldn't need a fit anyway as the polynomial is already defined by its zeros.

Otherwise I am not aware of a way to force the fit to some specific points.

One way to workaround this problem is to add the desired points multiple times to your data as this would "weight" them more than the rest. The resulting function will probably still not include the exact points but will be "nearer" to them.

tietjee
14-Alexandrite
(To:AATaylor)

It sounds like you are trying to solve a statically indeterminate beam. I would not recommend using the roots, if the problem is linear.  Solve the determinate beam, then place a unit load at each support and determine the deflection at each location.  Using matrix notation can speed the process.

 

Cheers

 

AATaylor
5-Regular Member
(To:tietjee)

Hi,

 

Thank you both for your responses.

 

I'm not trying to solve a statically indeterminate beam, I'm actually just trying to derive a polynomial of the deflected shape of a simply supported beam with point load. The polynomial will allow me to reproduce a scaled deflection curve as a polyline in a CAD Package.

 

In the attached file, the polyfitc output would ideally have zeroes at (0,0) and (1000,0).

 

I was hoping to be able to force these roots in the regression analysis. I suspect it's not possible in MathCAD. I know it can be done in Matlab, but it's not a simple fix and I have no access to Matlab / limited experience with the software.

 

Many thanks

Find attached

1) the implementation of what I was talking about when I mentioned the addition of data to pull the resulting zeros more to 0 and 1000

and

2) a (IMHO better) way to get the necessary coefficients using a solve block with minerr where we can force 0 to be a perfect zero and can weight the constraint f(1000)=0 very easily.

 

AATaylor
5-Regular Member
(To:Werner_E)

Wow, that's great thank you for your help!

 

Top Tags