# Non-Euclidean norms in impulsive maneuvers

Hi everyone,

In Orekit, instantaneous velocity jumps are implemented in the class ImpulseManeuver. The corresponding mass expenditure is given by Tsiolkovski inverted equation using the Euclidean norm a.k.a. 2-norm of the delta-V (in satellite frame or other if attitude override is present). However, this is only representative of a single, gimbaled thruster. Other cases can model different configurations, like the 1-norm which translates six thrusters mounted in orthogonal directions. See Space Trajectory Optimization and L1-Optimal Control Problems for more details. So itâ€™d be nice to be able to choose, maybe via an enum?

That actually brings me to something in Hipparchus. The interface Vector and the abstract class RealVector only have 1, 2 and \infty norms, which are all particular cases of the p-norm:
||(x_1,\dots,x_n)||_p=(|x_1|^p+\dots +|x_n|^p)^{1/p}
Why is it not implemented? Is it only because it wasnâ€™t already in Apacheâ€™s math?
Personally, I would also like the method getNorm() to have an alternative signature where p can be specified (like Numpy does), with the default value being 2 to avoid breaking anything.

What do you guys think?

Cheers,
Romain.

Adding generality is good, but keeping efficiency is also good.
Most people use the Lâ‚‚ norm, and it is fast to be computed, which is important as we routinely use millions of such computations in classical use cases. The general case implies calling {Fast}Math.pow which is the worst function to compute. It is extremely slow and has a lot of difficult special cases (17 special cases in the Java specification), so it is a function that should almost always be avoided.
So I would be OK to add a general norm, but not to remove the fast, efficient and accurate Lâ‚‚ norm.

1 Like

Hi @Serrof,

Both ideas look interesting!

Cheers,
Max

Hey @Serrof,

Following what you and @luc said, I would say +1 for a getGeneralNorm() method of some sort where you could input p.

Cheers,
Vincent

Donâ€™t worry Luc, for the generic method I was more thinking about an if/else statement than a systematic call to pow with arbitrary p.

The two developments seem to appeal so I will create separate issues on the respective repo of Hipparchus and Orekit.

Cheers,
Romain.

1 Like

I remember when I was a student (looooong ago). My math teacher used to say â€śdonâ€™t create the theory of the n-wheels bicycle only to apply it to n=2 laterâ€ť