Quantcast
Channel: VBForums - Maths Forum
Viewing all articles
Browse latest Browse all 112

[ABANDONED] Nasty Multipe Equation

$
0
0
Fish grow over time...hopefully.

I have a program where the weight of fish are measured periodically in hatchery raceways. Occasionally, fish are moved from one location to another, and when they are moved they may be combined with other fish. Figuring out the weight of the fish in the new location requires figuring out how much the fish grew from the time of the last measure to the time they were moved. Then, a weight point is written for the new location which is the weighted average of the weight of the new fish plus the weight of the existing fish.

The result of this is that there could be one or more of these "dead reckoning" weights written, one point for each move into any location. That is all relatively straightforward.

The nasty part comes when the fish are weighed in the new location, some number of days after they were moved. Up until then, I was assuming a rate of growth. A daily delta W, where the fish were assumed to increase in weight by a set amount per day. Once I get a new weight fix, the assumed daily delta W no longer matters. A true daily delta W must be calculated and must replace the assumed value.

What is essential for the functioning of the program is that the dead reckoning weights be re-written to reflect the new values. Those weights were calculated by something like this:

(DeltaW * Da * N1) + (DeltaW * Db * N2) = DRpoint.

Da = days between the last weight for location A and the move.
Db = days between the last weight for location B and the move.
N1 = Number contributed from location A.
N2 = Number contributed from location B.

Now, at some later date, I have TruePoint, which is Dx days since DRpoint. What I have to calculate is what DRpoint should have been, and what the true DeltaW had to have been. I believe that this results in a horrible equation:

(DeltaW * Da * N1) + (DeltaW * Db * N2)/(N1+N2) = NewWeight - (DeltaW * Dx)

I believe this reduces down to

DeltaW = NewWeight/(((Da * N1) + (Db * N2)/(N1 + N2)) + Dx)

I just can't quite convince myselft that this is the way to go. If I were to take that new DeltaW, I think that I can recalculate all of the dead reckoning points based off of that value. This would be a recursive step, because there could be many moves between the new weight and the old weight.

I guess I'm looking for some confirmation that the math is right, or commentary on the problem.

Viewing all articles
Browse latest Browse all 112

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>