Skip to content

Latest commit

 

History

History

MultifacetVal

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Multifaceted Value 💠 (Π-Val)

?Gauges -
!300 -
?What 300 -
?What gauges -

You may find the folklore right above dull but not pointless. — Math deals with abstract numbers (numerus numerans), computers operate on pure digits but not software developers and users. The "inputs" and "outputs" of software anchor to the material world, where numbers can be concrete (numerus numeratus) or denominated (numerus denominatus).

Verbal, documented, and, programmatic communications frequently rely on titles and contexts and omit denominations/units. Shall a context wane - values may "roam" between measurement systems:

   Temperature 2.7 is  . . . ... the baseline of outer space in Kelvin but in earthly Celsius or Fahrenheit a normal winter forecast (placewhere on 40° or higher latitude) .

  • A close approach of Earth to Mars is ca. 33'900'000 miles but seems credible in kilometers and nmi.
  • An unknown child's age of 7` can mean months and years.
  • Jack can be family, given (not only on birth), and branded name.
  • One apple may mean an electronic device too,
  • The weekly payment of 1'000 dollars may surprise with a national hue: Australian, Canadian, Jamaican, and twenty more.

Concurrent measurement systems can make matters even worse, e.g. flight height can be communicated in feet while cockpit variometers may show meters.

____________________________________________________________________________________________________

Not denominated numbers in applications may imply a single system of categorization (e.g. SI for physical values) and ... open wide the gate to errors, including ill-famed techno-disasters.🔄️

Coding like const OuterSpace_Baseline_Kelvin = 2.7 is univocal but inflexible and ugly to the object-oriented eye. As picky pros, we'd propose trailblazing syntax and features.

<🪝BAIT> Mars Orbiter, or "The Empire [unit] Strikes Back"

 Pound-force [lbf] taken for Newton [N] destroyed the NASA Mars Climate Observer in 1999.   

NASA part of the software relied on metric data from the "contractor" (the report doesn't name the known company and neither do I). Still, the latter sent thrust in the US Customary units, based on the good old British Imperial Pound. Thus the poor Mars Climate Orbiterw was put below the "survival altitude" orbit.

sequenceDiagram
participant NAV as Navigation Sofware<br />(Ground)
participant SF as Small Forces<br />Software (Ground)
participant SFO as Small Forces<br />Software (Spacecraft)
participant MCO as Mars Climate<br />Orbiter
participant M as Mars<br />(Planet)
       MCO->>SFO: angular momentum!!
      SFO->>MCO: command: thrust to de-spun
      SFO->>SF: AMD with thrust in pound
      SF->>SF: calculate the position (attitude and orientation)
Note over SF,SF: done right since operates in pounds
      SF->>NAV: thrust data
rect rgb(255, 175, 175)
      NAV->>NAV: recalculate trajectory
Note over NAV,NAV: pound-second taken as newton-second 
end
      NAV->>MCO: Trajectory Correction Maneuver
      MCO--)M: approaches
Note over MCO,M: below the estimated trajectory
      M--xMCO: destroys
Note over M,MCO: atmospheric stress
destroy participant MCO
Loading

____________________________________________________________________________________________________

Our framework could save astronomical bucks:

class Thrust : EventArgs
{
-   double Magnitude;
+   UVal.Phys.Mech.Force Magnitude;
    vector Direction;
    milliseconds Duration;
}

namespace CONTRACTOR.SmallForecesTeam;

event EventHandler<ThrustArgs> AngularMomentumDesaturation;

AngularMomentumDesaturation.Invoke(new Thrust {
-  Magnitude = reported_val,
+  Magnitude = Force.pound(reported_val),
   Direction = reported_dir, Duraion = duration
});

namespace NASA.Orbiter.NavigationTeam;

OnForce(Thrust thrust) {
-   Trajectory.Apply(thrust.Magnitude, thrust.Vector, thrust.Duration);
+   Trajectory.Apply(thrust.Magnitude.newton, thrust.Vector, thrust.Duration);
...
}

Conversion here is trivia, and  f u n c w a r e  offers an implementation you can test🧪.

Looks good ... </🪝>

... to stake out a repository for CV. But it's not a solution

❗The contractor team of SmallForces knew that the thrust must be communicated in newtons. They took the hardware reported value (the engineers there traditionally operated in the "house" system) and honestly submitted it as N.

Thus the first issue would be to allow limitation of the unit selection.

public enum In
{
    [Abbr("dyn")]
    dyne,

    [Abbr("N")]
    newton = 1_000_000_000_000,

    [Abbr("lbf")]
    pound_force = 4_448_222_000_000,

    [Abbr("kip")]
    kilopound = 1_000 * pound_force,

    [Abbr("pdl")]
    poundal = 138_254_954_376, // since 1877, Absolute English system
}

{}

And it's only one on the list of

Other cases

Beyond

Units are not only measurement systems

Values are not only numbers

Beyond a single crystal

Temp dep on pressure

|- Features and omissions
|--- Instantiation flexibility
|--- Modularity behind interface
|--- Generic-ism !
|--- Constants: predetermined, instantiated vs. generated (as for Ce(Pa)
|--- Arithmetic ops
|--- Comparison
|--- Cache

|- Handbook
|- Description

|- Used decisions
|-- General
|--- Testing - gradula
|-- Specific

|- BIG PIC REQUIRED

|- Structure and Source code
|--- MeasData
|--- Funcs
|----- Intro
|----- Tests
|--- U-Val

|- What's next
|--- ❄️ Project snowflake

Features and omissions

Overload of math ops

It looks first absolutely natural and a must.

var sum = Length.Meter(1) + Length.Centimeter(2)

This shabby meme must remind the obstacle.

You must already know the right conclusion: only for common-zero factored units.