diff --git a/AtmosphereAutopilot/AtmosphereAutopilot.version b/AtmosphereAutopilot/AtmosphereAutopilot.version index a53f39c..67d4609 100644 --- a/AtmosphereAutopilot/AtmosphereAutopilot.version +++ b/AtmosphereAutopilot/AtmosphereAutopilot.version @@ -9,7 +9,7 @@ "VERSION" : { "MAJOR" : 1, "MINOR" : 5, - "PATCH" : 6, + "PATCH" : 7, "BUILD" : 0 }, "KSP_VERSION" : { diff --git a/AtmosphereAutopilot/Properties/AssemblyInfo.cs b/AtmosphereAutopilot/Properties/AssemblyInfo.cs index bc72394..e69a041 100644 --- a/AtmosphereAutopilot/Properties/AssemblyInfo.cs +++ b/AtmosphereAutopilot/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.5.6.0")] -[assembly: AssemblyFileVersion("1.5.6.0")] +[assembly: AssemblyVersion("1.5.7.0")] +[assembly: AssemblyFileVersion("1.5.7.0")] diff --git a/README.md b/README.md index bd24f2a..05f26e5 100644 --- a/README.md +++ b/README.md @@ -121,11 +121,7 @@ Short GUI description (consult source code for more deatils and insight): * AoA - angle of attack, degrees. Positive for pitch up, yaw right. For roll it's the angle between wing chord and airspeed vector, projected on frontal plane. * _has csurf_ - is true if Flight Model has found control surfaces on the craft. It is important for aerodynamics regressor to know it. * Five "trainers", linear regressors. They are analyzing craft performance history and try (and fail horribly) to produce linear models of aerodynamic torques and forces. Their GUIs are filled with magic numbers you should never need to change. -* _balance engines_ - toggles engine-balancing algorithm for VTOLs. -* _balance thrust w_ - weight of thrust maximization objective for engine balancing. -* _balance descend k_ - learning rate of balancing algorithm. -* _balance descend k mult_ - current adaptive learning rate. -* _balance err_ - torque balancing error. +* _balance engines_ - toggles engine-balancing algorithm for VTOLs. Has a hotkey. * _balancer steering k_ - gain for attitude control using engines. Use zero to keep them static. Default value 1. * _Lift acc_ - acceleration, provided by aerodynamic lift in the direction of plane spine. * _Slide acc_ - acceleration, provided by aerodynamic lift in the direction of plane right wing. diff --git a/TestingConsole/Program.cs b/TestingConsole/Program.cs index 068aff5..d7fc33c 100644 --- a/TestingConsole/Program.cs +++ b/TestingConsole/Program.cs @@ -33,7 +33,7 @@ class Program static void Main(string[] args) { Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB"); - linprog_testing(); + linprog_testing_grad(); Console.ReadKey(true); } @@ -270,27 +270,52 @@ static void line_translation_test() static void linprog_testing() { AffineScaling linsolver = new AffineScaling(4, 3); - linsolver.A[0, 0] = -1.0; - linsolver.A[0, 1] = 2.0; - linsolver.b[0, 0] = 0.0; + //GradientLP linsolver = new GradientLP(2, 1); + linsolver.A[2, 0] = 6.66; + linsolver.A[2, 1] = -5.97; + linsolver.b[2, 0] = 0.0; - linsolver.A[1, 0] = 1.0; - linsolver.A[1, 2] = 1.0; - linsolver.b[1, 0] = 1.0; + linsolver.A[0, 0] = 1.0; + linsolver.A[0, 2] = 1.0; + linsolver.b[0, 0] = 1.0; - linsolver.A[2, 1] = 1.0; - linsolver.A[2, 3] = 1.0; - linsolver.b[2, 0] = 1.0; + linsolver.A[1, 1] = 1.0; + linsolver.A[1, 3] = 1.0; + linsolver.b[1, 0] = 1.0; - linsolver.x[0, 0] = 0.1; - linsolver.x[1, 0] = 0.1; + linsolver.x[0, 0] = 0.5; + linsolver.x[1, 0] = 0.5; linsolver.x[2, 0] = 0.5; linsolver.x[3, 0] = 0.5; - linsolver.c[0, 0] = -1.0; - linsolver.c[1, 0] = -1.0; + linsolver.c[0, 0] = -154.0; + linsolver.c[1, 0] = -154.0; + + linsolver.solve(1e-3, 0.66, 10); + linsolver.solve(1e-3, 0.66, 10); + linsolver.solve(1e-3, 0.66, 10); + linsolver.solve(1e-3, 0.66, 10); + //linsolver.solve(1e-4, 0.5, 1000); + } + + static void linprog_testing_grad() + { + GradientLP linsolver = new GradientLP(2, 1); + linsolver.A[0, 0] = 6.66; + linsolver.A[0, 1] = -5.97; + linsolver.b[0, 0] = 0.0; + + linsolver.x[0, 0] = 1.0; + linsolver.x[1, 0] = 1.0; + + linsolver.c[0, 0] = 1.0; + linsolver.c[1, 0] = 1.0; - linsolver.solve(1e-3, 0.5); + linsolver.solve(0.01, 10); + linsolver.solve(100.0, 10); + linsolver.solve(100.0, 10); + linsolver.solve(100.0, 10); + //linsolver.solve(1e-4, 0.5, 1000); } } }