Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit a7316359 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

use new SI functionality

parent 22fc8dbf
No related branches found
No related tags found
No related merge requests found
......@@ -137,7 +137,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
var m = v1 + d / k;
var b = -d / k;
var c = 0.SI<Meter>() - m / k;
var t = (Math.Log((v2 * k + d).Value() / (v1 * k + d).Value()) / k.Value()).SI<Second>();
var t = Math.Log(((v2 * k + d) / (v1 * k + d)).Cast<Scalar>()) / k;
// TODO @@@quam: remove .SI<> when bug #VECTO-111 is fixed...
return m / k * Math.Exp((k * t).Value()) + b * t + c;
......
......@@ -380,7 +380,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
{
var exceeded = new List<Watt>(); // only used while testing
var acceleration = new List<double>(); // only used while testing
var searchInterval = CurrentState.Acceleration.Value() / 2.0;
var searchInterval = CurrentState.Acceleration / 2.0;
Meter originalDs = ds;
do {
......@@ -413,7 +413,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
}
// check for minimum acceleration, add some safety margin due to search
if (Math.Abs(CurrentState.Acceleration.Value()) < Constants.SimulationSettings.MinimumAcceleration.Value() / 5.0 &&
Math.Abs(searchInterval) < Constants.SimulationSettings.MinimumAcceleration.Value() / 20.0) {
searchInterval.Abs() < Constants.SimulationSettings.MinimumAcceleration / 20.0) {
throw new VectoSimulationException("Could not achieve minimum acceleration");
}
searchInterval /= 2.0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment