Skip to main content
1-Visitor
September 1, 2017
Solved

Integration vertically

  • September 1, 2017
  • 3 replies
  • 10392 views

Hello to all,

 

I am looking to see if you can tell MathCAD to integrate not along the x axis by along the y axis.

 

In the attached I am trying to integrate the area above the plotted line i.e. from 0m upward to 5m integrating all the values of x in terms of y as opposed to the default which is to integrate under the line all the values of y in terms of x. There is madness to the logic as to why I want to do this I promise.

 

If I can get this to work the answer should obviously be 25m^2.

 

Thanks

 

AndyCapture.PNG

Best answer by Werner_E

Don't blame the solver!

You used an assignment (f(x):=y) in the solve block constraint but you must use a boolean equal sign (the big fat =).

 

Here is an example where you can't find the inverese function in an exact analytical way.

And even when you try to find the yelllow area using integration over x, you need the inverse to find the x-limits (the same is true for your example, but there the limits where quite obvious).

 

The picture also shows a way to use the root function to define the inverse.

Bild.png

3 replies

23-Emerald I
September 1, 2017

First, you need to integrate from 0 to 10 meters.

 

Second, your integral computes the area below the line.  The area above the line is the integral of 5 - line(y)

awibroe1-VisitorAuthor
1-Visitor
September 1, 2017

Hi Fred,

 

Yeah I know the range 0 to 5 is not going to work as it is currently integrating below the line.

 

So in order to integrate above the line would the integrand the same and the lower limit "line(y)"?

 

Andy

23-Emerald I
September 1, 2017

awi.JPG

You're integrating along the horizontal axis!

25-Diamond I
September 1, 2017

In this simple expample with a linear function you have a couple of choices and one of the easiest sure is to stay integrating over x and simply integrate the function 5-y(x) fron x=0 to x=10 as suggested by Fred.

 

If this is only an example and you intend to use a more complicated function, this appraoch may work, too.

Another approach would be to find the inverse of your function (you may use a solve block to define the inverse function) and really integrate this fucntion over y.

 

awibroe1-VisitorAuthor
1-Visitor
September 1, 2017

Werner,

 

Any chance you can show me how you would approach that with this example?

 

Andy.

23-Emerald IV
September 3, 2017

Just for completeness, here's a function to do 'vertical integration' on an arbitrary function (well.... arbitrary..... there are limitations):

VerticalIntegration0.png

VerticalIntegration1.png

Luc

 

15-Moonstone
September 3, 2017

I can understand your desire to integrate along the y-axis.  You should go back to your calculus definition of integration.  There is a significant reason to only allow integration along the x-axis.  The only way this can be done if there is a unique relationship between x and y.

 

Example  y = Mx + B has a unique relationship between x and y i.e. for each x there is a unique y

Example y = Mx^2  This does not a unique relationship, for each y there are two x's that are a solution.

 

Cheers