private void TauSigmaInertia() { double.TryParse(textBox1.Text, out a); double.TryParse(textBox9.Text, out b); double.TryParse(textBox8.Text, out c); double.TryParse(textBox7.Text, out d); if (a == 0 || b == 0 || c == 0 || d == 0) { MessageBox.Show("Invalid input"); } if (d > b / 2) { MessageBox.Show("d<b/2 !"); } if (c > a / 2) { MessageBox.Show("c<a/2 !"); } Ix = ((a * a * a * b) - ((b - d) * (b - d) * (b - d) * (a - c - c))) / 12; textBox4.Text = "Ix = " + Ix.ToString() + "mm4"; Tau = T1 / ((a * b) - (a - c - c) * (b - d)); textBox5.Text = Tau.ToString(); Sigma = (M1 * a) / (Ix * 2); textBox6.Text = Sigma.ToString(); }
//Methods /// <summary> /// Checks consistency /// </summary> protected override void Check() { if (Tau < 2 || Tau > 18) { throw new ArgumentException($"Invalid Tau {Tau.ToString(CultureInfo.InvariantCulture)}. Tau must be GE to 2 and LE to 18.", "Tau"); } return; }
private void ShowEquationDetails() { lblTau.Text = Tau.ToString(); lblDeltaLC.Text = delta.ToString(); lblt.Text = t.ToString(); lblF.Text = F.ToString(); lblDeltaUC.Text = Delta.ToString(); lblThetaMax.Text = ThetaMax.ToString(); }
public static void tau_test() //****************************************************************************80 // // Purpose: // // TAU_TEST tests TAU. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 23 May 2007 // // Author: // // John Burkardt // { int c = 0; int n = 0; Console.WriteLine(""); Console.WriteLine("TAU_TEST"); Console.WriteLine(" TAU computes the Tau function."); Console.WriteLine(""); Console.WriteLine(" N exact C(I) computed C(I)"); Console.WriteLine(""); int n_data = 0; for (;;) { Burkardt.Values.Tau.tau_values(ref n_data, ref n, ref c); if (n_data == 0) { break; } Console.WriteLine(" " + n.ToString().PadLeft(4) + " " + c.ToString().PadLeft(10) + " " + Tau.tau(n).ToString().PadLeft(10) + ""); } }
public static void tau_values_test() //****************************************************************************80 // // Purpose: // // TAU_VALUES_TEST tests TAU_VALUES. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 08 February 2007 // // Author: // // John Burkardt // { int fn = 0; int n = 0; Console.WriteLine(""); Console.WriteLine("TAU_VALUES_TEST:"); Console.WriteLine(" TAU_VALUES returns values of"); Console.WriteLine(" the TAU function."); Console.WriteLine(""); Console.WriteLine(" N TAU(N)"); Console.WriteLine(""); int n_data = 0; for (;;) { Tau.tau_values(ref n_data, ref n, ref fn); if (n_data == 0) { break; } Console.WriteLine(" " + n.ToString().PadLeft(6) + " " + fn.ToString().PadLeft(12) + ""); } }
/// <summary> /// Generates xml element containing the settings. /// </summary> /// <param name="rootElemName">Name to be used as a name of the root element.</param> /// <param name="suppressDefaults">Specifies whether to ommit optional nodes having set default values</param> /// <returns>XElement containing the settings</returns> public override XElement GetXml(string rootElemName, bool suppressDefaults) { XElement rootElem = new XElement(rootElemName); if (!suppressDefaults || !IsDefaultTau) { rootElem.Add(new XAttribute("tau", Tau.ToString(CultureInfo.InvariantCulture))); } if (!suppressDefaults || !IsDefaultB) { rootElem.Add(new XAttribute("b", B.ToString(CultureInfo.InvariantCulture))); } if (!suppressDefaults || !IsDefaultC) { rootElem.Add(new XAttribute("c", C.ToString(CultureInfo.InvariantCulture))); } Validate(rootElem, XsdTypeName); return(rootElem); }