I was upgrading my orekit from 9.3 to 10.1 and encountered a problem I have not been able to solve. In my 9.3 I used the following code:

FieldOrbit initialOrbit = orbitType.mapArrayToOrbit(stateVectorDS, null,

positionAngle, date,mu, initialOrbitI.getFrame());

where stateVectorDS is a DerivativeStructure[], positionAngle is a PositionAngle, the date is an FieldAbsoluteDate, and mu is a double.

After upgrading it seems like the method no longer works. The only difference in the constructor is that mu should be a T. I have tried changing mu to a derivativestructure but im not sure if i did this correctly. I just used factory.constant( mu). Is this correct?

EDIT: I ask because the behavior no longer seems accurate. My next line is:

```
FieldSpacecraftState<DerivativeStructure> spacecraftState = new FieldSpacecraftState<>(initialOrbit);
```

This works in equinoctial or keplerian defined orbits but for cartesian orbits I get: â€śMathRuntimeException: cannot normalize a zero norm vectorâ€ť