Skip to main content
1-Visitor
February 21, 2020
Solved

Interpolation data

  • February 21, 2020
  • 1 reply
  • 2853 views

Hi everyone.

 

I have a little problem with an interpollation data. When i start to use cspline the program give return error "The elements in this vector must be in ascending order."

 

Mathcad 14.

P.S. Sorry for bad english.

 

 

Best answer by Werner_E

Looks like you posted an empty worksheet !?

 

When using spline interpolations, the values in the first vector ("x-values") must be in ascending order to make the interpolation work. As you get the error message you describe they obviously aren't all in that order.

1 reply

Werner_E25-Diamond IAnswer
25-Diamond I
February 22, 2020

Looks like you posted an empty worksheet !?

 

When using spline interpolations, the values in the first vector ("x-values") must be in ascending order to make the interpolation work. As you get the error message you describe they obviously aren't all in that order.

mctraila1-VisitorAuthor
1-Visitor
February 22, 2020
The worksheet start with second page. Values in the vector is ascending.
25-Diamond I
February 22, 2020

@mctraila wrote:
The worksheet start with second page.

Tricky 😉

 

The problem in your sheet is, that you obviously are not aware, that by default the first index number of a vector is 0, not 1.

You created your vectors using a range variable j starting at 1. But the vectors you created that way also have an element with index 0 (by default has the value  0) and as the first value in your vector i is 0, too, the first two elements are both 0 and thats not strictly ascending.

 

Two possible solutions:

1) Define j as j:=0 .. 11

or

2) Write ORIGIN:=1 at the top of your sheet (alternatively you may set the value of the system variable ORIGIN via the menu -> Tools -> Worksheet Options -> Built-In Variables -> Array Origin(ORIGIN)->1).

 

For the screenshot below I used option 2

Werner_E_0-1582373637896.png