First, let me start out by saying that I am an engineer and not a mathematician, so if you could "dumb down" your answer, that woiuld be greatly appreciated.

I am trying to solve a geometry problem arising out of a 2-D modeling program written in FORTRAN. I have a series of n rectangles stacked on top of each other of irregularly increasing widths. Heights may be irregular, but are not necessarily increasing. I want to convert these rectangles into trapezoids by connecting a point on the side edge of these rectangles to side points of rectangles above and below. The trapezoidal area then includes part of two different rectangles. The bottom part of the bottom rectangle and top part of the top rectangle will be dealt with separately.

I am trying to conserve area, so after working through a bit of math, I end up with a series of equations that look like this…

(b2-b3)((h3-hm3)^2) (hm3 + h4 – hm4) = (hm3^2)(b3 – b4)(hm2+h3-hm3)

where the subscripts are all incremented by one for each subsequent equation. I can tell you that the rectangle widths b2, b3, etc. are known constants, and rectangle heights h2, h3, etc. are also known constants. The variable hmi represents the distance from the base of the rectangle to a point on the side (0<hmi<hi). I plan on setting hm1 and hmn (distance from base of rectangle to point on the side) to constants. which means that I am essentially trying to solve n-1 nonlinear (cubic) equations for a series of hmi values where i goes from 2 to n-1.

Any thoughts on the best way to approach this? This problem would only have to be solved once in the program I am writing, but failure (to converge to a solution) is not an option. There could reasonably be any number of rectangles (and equations) from about 5 to 100.

I’m sorry about the poor problem statement. It’s hard to describe without a picture. Like I said, it comes down to solving a series of nonlinear cubic equations for hmi values in the equation above. Any help is appreciated.