Пример #1
0
        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();
        }
Пример #2
0
 //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;
 }
Пример #3
0
 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();
 }
Пример #4
0
        /// <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);
        }