Skip to main content
1-Visitor
February 13, 2012
Question

Explicit function definition

  • February 13, 2012
  • 4 replies
  • 3928 views

Hello,

I am quite new to Mathcad. What I want to do is to define a function explicitly (i.e., as pairs of x - y or x - f(x) values), not analitically (through a formula). Does anyone know wether that is possible or not? I am using Mathcad 14 and I searched the user guide, provided examples and tutorials, but couldn't find anything related to this subject. I even tried to do that myself, by improvising, but without any success.

Moreover, if it's possible to define a function explicitly, could one calculate definite integrals on it afterwards? (I know that is easy if the function is defined analitically).

Best regards,

Marius

4 replies

1-Visitor
February 13, 2012

Yes I believe it is possible, but I'm not sure exactly what your after.

Could you provide an example and post the worksheet?

Mike

1-Visitor
February 19, 2012

Hello!

Thank you for your answer. I don’t have a worksheet yet, but here is what I want to do (I simplified the problem a bit). I have the following (x y) data set where y represents the value of the derivate function at point x:

X Y

0 0

0.2 0.1987

0.4 0.3894

0.6 0.5646

0.8 0.7174

1 0.8415

1.2 0.932

1.4 0.9854

1.5708 1

What I want is to get the value of the function, by numerical integration, at these x points. I don’t need any curve fitting, interpolation function or any other kind of approximation. Could you give me some hints on how to solve this problem with Mathcad?

24-Ruby III
February 13, 2012

Hello!

Provide a screenshot of what you want.

1-Visitor
February 19, 2012

Hello!

Thank you for your answer. I don’t have a worksheet yet, but here is what I want to do (I simplified the problem a bit). I have the following (x y) data set where y represents the value of the derivate function at point x:

X Y

0 0

0.2 0.1987

0.4 0.3894

0.6 0.5646

0.8 0.7174

1 0.8415

1.2 0.932

1.4 0.9854

1.5708 1

What I want is to get the value of the function, by numerical integration, at these x points. I don’t need any curve fitting, interpolation function or any other kind of approximation. Could you give me some hints on how to solve this problem with Mathcad?

23-Emerald I
February 13, 2012

Given an x,y data set there are several ways to proceed; the choice depends on the data and what you want to do. With a dense and complete data set you can use numerical integration techniques. You can curve fit the data--find a function that approximates the data closely, and use the built-in integration schemes for manipulation.

1-Visitor
February 19, 2012

Hello!

Thank you for your answer. I don’t have a worksheet yet, but here is what I want to do (I simplified the problem a bit). I have the following (x y) data set where y represents the value of the derivate function at point x:

X Y

0 0

0.2 0.1987

0.4 0.3894

0.6 0.5646

0.8 0.7174

1 0.8415

1.2 0.932

1.4 0.9854

1.5708 1

What I want is to get the value of the function, by numerical integration, at these x points. I don’t need any curve fitting, interpolation function or any other kind of approximation. Could you give me some hints on how to solve this problem with Mathcad?

19-Tanzanite
February 13, 2012

You need to create an interpolating function. The most general solution is a cubic spline, but it's not always appropriate. Without seeing the data it's hard to say much more.

1-Visitor
February 19, 2012

Hello!

Thank you for your answer. I don’t have a worksheet yet, but here is what I want to do (I simplified the problem a bit). I have the following (x y) data set where y represents the value of the derivate function at point x:

X Y

0 0

0.2 0.1987

0.4 0.3894

0.6 0.5646

0.8 0.7174

1 0.8415

1.2 0.932

1.4 0.9854

1.5708 1

What I want is to get the value of the function, by numerical integration, at these x points. I don’t need any curve fitting, interpolation function or any other kind of approximation. Could you give me some hints on how to solve this problem with Mathcad?

19-Tanzanite
February 19, 2012

We don't need the same reply four times. It's just as easy to read one reply four times as it is to read four replies

I don’t need any curve fitting, interpolation function or any other kind of approximation.

All numerical integration is approximate. The attached is a very general, and usually accurate, approach.