thegrumpys / odop

Open Design Optimization Platform (ODOP) - Coil spring design app; mechanical springs; compression spring, extension spring, torsion spring
https://www.springdesignsoftware.org
MIT License
4 stars 5 forks source link

Update migrate to deal with undefined cmin/cmax #855

Closed grumpyinca closed 8 months ago

grumpyinca commented 9 months ago

It appears that while the changes made in #440 were successful in eliminating undefined cmin / cmax (plus undefined lmin / lmax & smin /smax) in new designs, the changes made to migrate were not successful in eliminating all such problems in older designs.

I anticipate that it will be possible to enhance migrate to eliminate these problems in:

* See comment below

Note:

440 was published as part of v3.8 on February 28, 2021.

Development tool

scanner.js and scripts/scanner.sh were created to help understand the scope of this problem. These will be retained as the basis of future diagnostics.

1fifoto commented 9 months ago

A model with this problem is in development and is a Compression spring and is called 'DeadCoilBaseline'. design.sql.zip

1fifoto commented 9 months ago

Added to migrate in Compression, Extension and Torsion. Added check for undefined cmin and cmax. If found it initializes them to element.value.

grumpyinca commented 9 months ago

Merged to master; pushed to remote (origin); closing.

grumpyinca commented 9 months ago

Added entry to list of known console.log messages in docs/procedures/release.md.

grumpyinca commented 9 months ago

Re-merged to master and pushed to remote / origin. Closing.

grumpyinca commented 9 months ago

Re-opening.

Testing discovered a staging system extension spring design, named Ask4Impossible, that made it through migrate with cmin / cmax as undefined.

Further investigation with an updated scanner.js discovered a small number of compression, extension and torsion spring designs in the production database with null values of independent variables. Those null values propagated to dependent variables. In one torsion spring case, a FS_CycleLife value of infinity got mapped to null.

The current theory is that ODOP versions prior to 4.2 (April, 2022) allowed the user to "blank" values of independent variables, perhaps in the mistaken notion that was the correct way to allow the system to determine those values. In any case, the process of saving into JSON format seems to translate missing values plus values of NaN, and infinity to null.

It is believed that setting force or moment at point 1 equal to the value for point 2 creates a design that is static; does not cycle; Cycle_Life and FS_CycleLife are infinite.

Migrated to design version corresponding to release 4.2 (April, 2022)

Further changes to the spring design migrate files are in progress.

grumpyinca commented 9 months ago

Added test & repair for undefined lmin & lmax.

Re-merged to master & pushed to remote / origin. Closing.

grumpyinca commented 9 months ago

Re-opening.

Testing shows that the extension spring example referenced in the comment above (named Ask4Impossible; migrates from extension spring model version 5 to 8) escapes the fix for undefined cmin & cmax. It appears that it will be necessary to move this fix forward at least one migration.

grumpyinca commented 8 months ago

Combined with check for lmin& lmax of null; moved to last migration case.
Pushed to master. Quick test on "Ask4Impossible" tests OK. Re-closing.