1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
chart3.Series[0].Points.Clear();
//valeur calcul
double W2;
double Fin = double.Parse(richTextBox92.Text);
double W0 = double.Parse(richTextBox6.Text);
double Pasdetemps = double.Parse(richTextBox54.Text);
double J = double.Parse(richTextBox3.Text) * 250;
double Couple;
double[,] Tab = new double[4,40000];
double W = W0;
double Temps = 0;
for (int i = 1; i <= 4000; i++)
{
Tab[1, i] = Temps;
Tab[2, i] = W * 30 / Math.PI;
Temps = Temps + Pasdetemps;
Couple = double.Parse(richTextBox148.Text) * Math.Pow(W, 2) + double.Parse(richTextBox149.Text) * W + double.Parse(richTextBox146.Text) * Math.Pow(W, 0.5) + double.Parse(richTextBox147.Text);
W2 = W + ((Couple * Pasdetemps) / J);
double Diff = W - W2;
Tab[1, i+1] = Temps;
Tab[2, i+1] = W * 30 / Math.PI;
if (Diff < Fin)
{
Tab[1, i + 2] = Temps;
Tab[2, i + 2] = W * 30 / Math.PI;
}
if (W < Fin)
{
Tab[1, i + 3] = Temps + Pasdetemps;
Tab[2, i + 3] = 0;
}
W = W2;
chart3.Series[0].Points.AddXY(Tab[1, i], Tab[2, i]);
richTextBox214.Text = Tab[2, i] > double.Parse(richTextBox92.Text) ? ">Max time" : Tab[1, i].ToString();
}
} |
Partager