Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Select Git revision
  • a2f4a1e31dd64793d75cd98b47631a497a918ef3
  • development default
  • bugfix/EDELIVERY-14172-domismp-accepts-requests-with-wrong-domain-header-value
  • EDELIVERY-15372-upgrade-libraries-and-plugins-and-update-httpclient-to-httpclient5
  • EDELIVERY-15377-migrate-to-angular-20
  • feature/EDELIVERY-15382-rest-api-jwt-authentication-for-dynamic-discovery-client
  • bugfix/EDELIVERY-14196-select-domain-select-resource-dropdown-should-be-order-alphabetically
  • feature/EDELIVERY-12753-sml-integration-migration-to-different-smp
  • feature/EDELIVERY-13757-extend-session-dialog-should-have-an-active-counter
  • EDELIVERY-15144-sql-update
  • bugfix/EDELIVERY-14326-ui-edit-resource-filters
  • feature/EDELIVERY-15144-domismp-system-notification-generalize-time-expiration-alerts
  • bugfix/EDELIVERY-15102-alert-is-not-appearing-when-adding-duplicated-certificate
  • bugfix/EDELIVERY-15203-small-left-grid-shows-no-data-found-for-1-2-seconds-before-loading-the-data
  • EDELIVERY-15219-search-filter-with-understore-char-does-not-work
  • bugfix/EDELIVERY-15226-certificates-error-when-trying-to-delete-certificates
  • bugfix/EDELIVERY-15224-error-when-trying-to-update-info-from-profile-page
  • bugfix/EDELIVERY-15225-emails-are-not-sent-in-domismp
  • release/5.1.x
  • feature/EDELIVERY-12746-external-secret-sharing-services-as-vaults
  • EDELIVERY-15229-upgrade-libraries-and-plugins
  • 5.1.1
  • 5.1
  • 5.1-TEST
  • 5.1-RC1
  • 5.0.1
  • 5.0
  • 5.0-RC1
  • 4.2
  • 4.2-RC1
  • 4.1.2
  • 4.1.1
  • 4.1.0
  • 4.1.0-RC1
  • 4.0.0
  • 4.0.0-RC1
  • 3.0.2
  • 3.0.1
  • 3.0.0
39 results

TestRunData.java

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    TorqueConverter.cs 1.88 KiB
    using System;
    using System.Data;
    using TUGraz.VectoCore.Utils;
    
    namespace TUGraz.VectoCore.Models.Declaration
    {
    	public class TorqueConverter : LookupData<double, TorqueConverter.TorqueConverterEntry>
    	{
    		protected const string ResourceId = "TUGraz.VectoCore.Resources.Declaration.DefaultTC.vtcc";
    
    
    		public TorqueConverter()
    		{
    			ParseData(ReadCsvResource(ResourceId));
    		}
    
    
    		[Obsolete("Default Lookup not availabel. Use LookupMu or LookupTorque instead.", true)]
    		protected new TorqueConverterEntry Lookup(double key)
    		{
    			throw new InvalidOperationException(
    				"Default Lookup not available. Use TorqueConverter.LookupMu() or TorqueConverter.LookupTorque() instead.");
    		}
    
    
    		public NewtonMeter LookupTorque(double nu, PerSecond angularSpeedIn, PerSecond referenceSpeed)
    		{
    			var sec = Data.GetSamples(kv => kv.Key < nu);
    
    			if (nu < sec.Item1.Key || sec.Item2.Key < nu) {
    				Log.Warn(string.Format("TCextrapol: nu = {0} [n_out/n_in]", nu));
    			}
    
    			var torque = VectoMath.Interpolate(sec.Item1.Key, sec.Item2.Key, sec.Item1.Value.Torque, sec.Item2.Value.Torque, nu);
    			return torque * Math.Pow((angularSpeedIn / referenceSpeed).Scalar(), 2);
    		}
    
    		public double LookupMu(double nu)
    		{
    			var sec = Data.GetSamples(kv => kv.Key < nu);
    
    			if (nu < sec.Item1.Key || sec.Item2.Key < nu) {
    				Log.Warn(string.Format("TCextrapol: nu = {0} [n_out/n_in]", nu));
    			}
    
    			return VectoMath.Interpolate(sec.Item1.Key, sec.Item2.Key, sec.Item1.Value.Mu, sec.Item2.Value.Mu, nu);
    		}
    
    
    		protected override void ParseData(DataTable table)
    		{
    			Data.Clear();
    			foreach (DataRow row in table.Rows) {
    				Data[row.ParseDouble("nue")] = new TorqueConverterEntry {
    					Mu = row.ParseDouble("mue"),
    					Torque = row.ParseDouble("MP1000 (1000/rpm)^2*Nm").SI<NewtonMeter>()
    				};
    			}
    		}
    
    		public class TorqueConverterEntry
    		{
    			public double Mu { get; set; }
    			public NewtonMeter Torque { get; set; }
    		}
    	}
    }