Hi All, I have a tricky question that I am hoping a more experienced excel user may be able to assist. This might not be the right spot, or even the right forum, let me know if this is the case or where i might be able to find some assistance.
First off, a bit of a background to the problem.
I have an engineering problem that I have solved already (sort of) using excel, but I am trying to compact the design to use fewer cells. It is a friction/energy problem - i know the kinetic energy of an object and i am working out when it will stop moving. The energy is absorbed and converted to heat/sound etc. The amount of energy absorbed per meter changes after a given distance.
As an example, this is what a graph would look like:
Attachment 608805 (can't upload this one, but you get the idea in black below)
I am working out the area under the curve and then (for a given value) determining the distance at which all energy is absorbed. From this example, an energy of 32kJ would sit at 0.95m.
I was working this out by calculating this energy for a given distance (say every 0.1m) and working out the difference given the kJ/m between the two distances. Easy enough.
I have since simplified that to work out the energy between the step values instead, reducing it from ~thousand cells (given the range of distance i needed to cover, along with different starting energy levels i had around 10x100 cells), down to this:
=MAX(
(B6/D$5)*IF(B6<$D$3,1,0),
(($B6-$D$3+$D$2*$E$5)/$E$5)*(IF($B6<=$E$3,1,0)*IF($B6>$D$3,1,0)),
(($B6-$E$3+$E$2*$F$5)/$F$5)*(IF(B6<=$F$3,1,0)*IF(B6>$E$3,1,0)),
(($B6-$F$3+$F$2*$G$5)/$G$5)*(IF(B6>$F$3,1,0))
)
Cells 1.png
Much easier to explain to someone in this format and develop a standalone app, as well as being able to add other functions. Which is where the trouble starts...
I've added things like putting the object on a slope (recursive check, not too complicated) and other additional variables, but the tricky one is adding additional sets of elements at variable distances from the first point of contact.
Adding items with variable offsets would look like this:
Graph 2.png
Graph 3.png
Graph 4.png
Now, previously i have succeeded in doing this by offsetting them by a fixed distance (say 0.1m), with up to 10 additional elements, and this resulted in a 10x100 table that could be summed into a single row and the appropriate energy/distance extracted (a little more complicated than that, but not by much).
Now, i want to be able to do this, but instead of having fixed offsets, i would like to be able to vary them. I could do this the same way, just increasing the resolution of each step (needing 1000's of columns, which can be done by not a lot of copy/paste/drag) and performing the same lookup. But i would like to know if it is possible to do this in a mathematical way (other than a "finite element analysis" method).
I would need to be able to use at least 6 additional elements, which straight up makes the number of IF statements to break it up into pieces a hard thing to do by hand (with each step in the graph changing depending on where each previous element is offset). Is there another excel function that might be used to do this?
Here's an example of the starting points of each step (24 total, with the possibility of some overlapping):
Cells 2.png
I'm open to VBA, pivot tables, whatever, just trying to find another way other than brute forcing it with a lot of unnecessary cells. Being able to transfer it into another application that can't handle that many variables (or at least i don't have the time to enter them one by one) is my main reason for this, but i'd also like to know if there is a simpler way, something more elegant. I do enjoy a pretty spreadsheet...
Bookmarks