MechJeb2

MechJeb2

4M Downloads

Delta-V calculation fails when KIDS "Extend Curve to Zero Isp" is active.

bfrobin446 opened this issue ยท 4 comments

commented

In build 282, I noticed that the dV Stats window was not displaying any stages, with the log message

[MechJeb2] Exception on MechJebModuleStageStats.RunSimulation(): FuelFlowSimulation.SimulateStage reached max step count of 100

I tested different combinations of KIDS settings. With Isp multipliers set to anything, thrust corrector enabled, and "Extend Curve to Zero Isp" off, Delta-V calculations worked. With "Extend Curve to Zero Isp" enabled and thrust corrector enabled, Delta-V calculations timed out.

commented

Can you try again with build 284+? Build 283 contained a rewrite of part of the dV simulation and it's possible that it happened to fix this problem--I tried to reproduce this with build 284 but I couldn't. If you encounter the problem with build 284+, can you provide an (ideally stock) example .craft file showing the problem?

commented

Nice detective work. I asked ferram4 about it. He knows about this issue and it sounds like he plans to fix it. So bug him if he doesn't :P

I'll close this since in the end it doesn't seem to be a MJ bug.

commented

I copied my KIDS folder into a clean install of KSP with build 284, started a sandbox save, and tried to reproduce. The exceptions seem to be specific to the Sepratron. Perhaps the fact that the Sepratron has identical sea-level and vacuum ISP is part of the problem.

A .craft file with a command pod, an AR202, and a Sepratron was enough for me to trigger the exceptions. I've uploaded the file I used at https://www.dropbox.com/s/q0bkpaj8c5v6phu/Delta-V%20test.craft

commented

I tested with a ModuleManager config that changes the Sepratron's Isp from 100 SL, 100 vacuum to 99 SL, 100 vacuum. No more exceptions. https://www.dropbox.com/s/hflyqhsemrvf4sp/sepratronfix.cfg

My theory at this point is that when KIDS tries to extend a completely flat Isp curve to zero Isp, the result is a curve with Inf or NaN values in it that in turn breaks MJ's simulation.