Reusing results after overlapping input changes

An engineering analysis program separates its work into three modules:

  • The geometry module takes geometry data and returns section properties. Each call takes 0.8 s.
  • The stiffness module takes section properties and a material's elastic modulus, a measure of its resistance to elastic deformation. Each call takes 1.5 s.
  • The solve module takes stiffness data and one load case. Each call takes 0.2 s.


Three modules pass section properties and stiffness data forward, with geometry, material modulus, and load supplied at their respective boundaries.


A cache stores a module's inputs and resulting output for reuse. For this problem, a saved output is reused exactly when all that module's inputs are unchanged. Each distinct input combination is computed only once. Calls run sequentially, and lookup and storage time are negligible.


The initial analysis starts with an empty cache. It uses two geometries, A and B, and three materials, M1, M2, and M3. Every geometry is combined with every material. For each geometry–material pair, the solve module processes five distinct load cases. Assume no distinct combinations produce identical intermediate data.


After the initial analysis finishes, the engineer simultaneously changes geometry A and the elastic modulus of M2. Geometry B, the other two material moduli, and all five load cases remain unchanged. Each changed input produces different downstream data. The program then updates the complete analysis, retaining every unaffected saved result.


Find:

  • The total execution time for the initial analysis, in seconds to one decimal place.
  • The number of stiffness-module calls required for the update, as an exact integer.
  • The total execution time for the update, in seconds to one decimal place.
Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Modular Programming Questions: