Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Re: CUBIC POLYNOMIAL

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-01-2013
07:17 PM

05-01-2013
07:17 PM

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

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-01-2013
08:26 PM

05-01-2013
08:26 PM

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

8 REPLIES 8

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-01-2013
08:26 PM

05-01-2013
08:26 PM

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-01-2013
09:27 PM

05-01-2013
09:27 PM

Re: CUBIC POLYNOMIAL

Hello Werner,

Sorry, I had a wrong sign in the equation. Please see the correct worksheet attached.

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-02-2013
03:26 AM

05-02-2013
03:26 AM

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-02-2013
04:40 AM

05-02-2013
04:40 AM

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-02-2013
06:35 AM

05-02-2013
06:35 AM

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.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-02-2013
10:05 PM

05-02-2013
10:05 PM

Re: CUBIC POLYNOMIAL

Hello Alan,

Thanks a lot.

Very helpful remarks. I really appreciate your time.

Regards,

Anousheh

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-02-2013
09:59 AM

05-02-2013
09:59 AM

Re: CUBIC POLYNOMIAL

I think Alan has already answered your questions.

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-02-2013
09:54 PM

05-02-2013
09:54 PM

Re: CUBIC POLYNOMIAL

Hello Werner,

Thank you so much for the explanations.

All the best,

Anousheh