public double CalculatePower(double velocityKmh) { Forces forces = CalculateForces(velocityKmh); double wheelPower = forces.Total * (velocityKmh * 1000.0 / 3600.0); double legPower = wheelPower / (1.0 - (Parameters.DriveTrainLoss / 100.0)); return(legPower); }
private Forces CalculateForces(double velocityKmh) { var forces = new Forces(); var velocityMS = ConvertKmhToMS(velocityKmh); forces.Gravity = G * Parameters.WeightTotal * Math.Sin(Math.Atan(Parameters.ClimbGrade / 100)); forces.Rolling = G * Parameters.WeightTotal * Math.Cos(Math.Atan(Parameters.ClimbGrade / 100)) * Parameters.Crr; forces.Drag = 0.5 * Parameters.GetCdA() * Parameters.Rho * velocityMS * velocityMS; return(forces); }