Skip to main content
14-Alexandrite
February 21, 2024
Solved

What is wrong with this equation

  • February 21, 2024
  • 2 replies
  • 1734 views

All the variables are defined , However I couldn't figure out why it is not working

YA_10963798_0-1708507067916.png

 

Best answer by Fred_Kohlhepp

Careful!

Simply summing is not the same as integration

2 replies

23-Emerald I
February 21, 2024

Integration requires that you have a function defined over the entire range.  You've got q defined at discrete points.  You might try simple linear interpolation to define a function.

23-Emerald IV
February 21, 2024

It's always better to attach the Prime worksheet, and state which version of Prime you are using.

Regarding the integration: You have a vector of values. Simply sum the vector values for the range that coincides with z going from 0 to DeltaL. You can use the summing operator for that.

 

Success!

Luc

23-Emerald I
February 21, 2024

Careful!

Simply summing is not the same as integration

25-Diamond I
February 21, 2024

@Fred_Kohlhepp wrote:

Careful!

Simply summing is not the same as integration


Agreed on, but not the way you had shown it.

To approximate the integral we must multiply the function values by the differences of the z-values.

In the example you gave these differences are constant 1 in, so you have to multiply the H-sum by 1 in, not by the total 4 in.

Furthermore you have to omit either the last or the first value in vector H to get the lower or upper rectangle sum.

The mean of this sum is what you get using trapezoid "integration".

Werner_E_0-1708554211627.png

 

trapezoid is the very same as what you should get by using linear interpolation. Adding dummy values at the end we even can get Prime to give us the result for the integral over the interpolated function.

Werner_E_1-1708554311634.png