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

## CUBIC POLYNOMIAL

SOLVED Regular Member

## CUBIC POLYNOMIAL

Hello everyone,

This is rather URGENT. Would you please help me to generate a cubic polynomial for the function in the attached worksheet?

Really appreciate your time and help.

Thanks a lot,

Anousheh

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions Ruby III
(in response to Anousheh)

## Re: CUBIC POLYNOMIAL

Didn't we had that same kind of question sometimes before? Same methods apply, see attached

8 REPLIES 8 Ruby III
(in response to Anousheh)

## Re: CUBIC POLYNOMIAL

Didn't we had that same kind of question sometimes before? Same methods apply, see attached Regular Member
(in response to Werner_E)

## Re: CUBIC POLYNOMIAL

Hello Werner,

Thank you so much. You are right. We had this before, I had problem with defining i !!!

1- How do you decide the range for i?

2- And also, how do you define alpha sub i?

3- Why the graph does not plot Chi(alpha) at the bottom of the worksheet? Please see the attached.

4- How can we refine the polynomial to get 1 for Chi at alpha=0.5

Thank you,

Anousheh Alexandrite
(in response to Anousheh)

## Re: CUBIC POLYNOMIAL

 Anousheh Rouzbehani wrote:...1- How do you decide the range for i?

You decide upper and lower limits. You decide number of points depending on the resolution/closeness of fit you want.

 2- And also, how do you define alpha sub i?

Use the [ key i.e. alpha[i produces alpha sub i.

 3- Why the graph does not plot Chi(alpha) at the bottom of the worksheet? Please see the attached.

Because you pass a vector of alphas to Chi, and Chi is written in such a way that the product in the numerator returns a scalar when each is a vector. You need to vectorise Chi when you pass it a vector i.e. either put an arrow over the top (see the matrix menu) or pass it individual values, alpha sub i. - see attached.

 4- How can we refine the polynomial to get 1 for Chi at alpha=0.5

One (rather coarse) way is simply to weight the point alpha = 0.5 by adding many points with alpha = 0.5 to the vector of points created before you do the fit - see attached.

Alan Alexandrite
(in response to AlanStevens)

## Re: CUBIC POLYNOMIAL

Just for the fun of it here's a slicker way of getting the fit and forcing it to go through 1 at alpha = 0.5.

Alan Ruby III
(in response to AlanStevens)

## Re: CUBIC POLYNOMIAL

Yet another way to force p(0.5)=1.

Just sample only 4 data points (from 0.2 to 0.4), so the cubic is forced to go through all of them.

As your function is "well behaved" enough in the interval of concern we can do that without loosing the good fit. Regular Member
(in response to AlanStevens)

## Re: CUBIC POLYNOMIAL

Hello Alan,

Thanks a lot.

Regards,

Anousheh Ruby III
(in response to Anousheh)

## Re: CUBIC POLYNOMIAL

Some remarks Q1 and 2: I took the number of points and the range from your range variable alpha. So every of the 26 points you user for plotting would be considered by the fit. For a cubic fit you would need at least 4 datapoints.

If you you just 4 points, you will get a function whose graph will run exactly through those points. I used this in a prior post in this thread to force the cubic at (0.5/1). It depends on the function how good the fit would be with respect to the other data points.

More sample points usually will give a better fit.

As for the construction of the range variable and the functions arguments, you may use a simple formula:

If you have an range af x-values beginning at xB and ending at xE and you want nrofpoints datapoints (meaning you are deviding your interval in nrofpoints-1 parts) you may declare

i:=0 .. nrofpoints - 1

and define

x[i := xB + i * (xE-xB) / (nrofpoints - 1)

In case of your file I had 26 datapoints and a range for alpha from 0.25 to 0.5

so we have

i:=0..25

and

alpha[i := 0.25 + i * (0.5-0.25) / 25

or

alpha[i := 0.25 + i * 1 / 100 Regular Member
(in response to Werner_E)

## Re: CUBIC POLYNOMIAL

Hello Werner,

Thank you so much for the explanations.

All the best,

Anousheh