Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace lab1tab1
- {
- internal class Program
- {
- private static void Main()
- {
- var tab1x1 = new[] { 0.46, 0.46, 0.46 };
- var tab2x1 = new[] { 0.3, 0.3, 0.3 };
- var tab3x1 = new[] { 0.4, 0.4, 0.4 };
- var tab4x1 = new[] { 0.37, 0.37, 0.37 };
- var tab5x1 = new[] { 0.34, 0.34, 0.34 };
- var tab1x4 = new[] { 0.38, 0.375, 0.365 };
- var tab2x4 = new[] { 0.36, 0.363, 0.37 };
- var tab3x4 = new[] { 0.34, 0.35, 0.345 };
- var tab4x4 = new[] { 0.38, 0.375, 0.34 };
- var tab5x4 = new[] { 0.355, 0.36, 0.36 };
- var del1t1 = new[] { 5.079, 5.675, 5.708 };
- var del2t2 = new[] { 4.778, 4.762, 4.640 };
- var del3t3 = new[] { 4.645, 4.369, 4.290 };
- var del4t4 = new[] { 3.770, 3.58, 4.072 };
- var del5t5 = new[] { 3.407, 3.375, 3.436 };
- double del1x4 = 0, del2x4 = 0, del3x4 = 0, del4x4 = 0, del5x4 = 0, x2 = 0, R = 0.085,
- del1t4 = 0, del2t4 = 0, del3t4 = 0, _del4t4 = 0, del5t4 = 0, x0 = 0.47,
- x3 = 0.03, full1form2 = (del1x4 / 3 - x0) / (2 * x3 - (x0 + del1x4 / 3)),
- full2form2 = (del2x4 / 3 - x0) / (2 * x3 - (x0 + del2x4 / 3)),
- full3form2 = (del3x4 / 3 - x0) / (2 * x3 - (x0 + del3x4 / 3)),
- full4form2 = (del4x4 / 3 - x0) / (2 * x3 - (x0 + del4x4 / 3)),
- full5form2 = (del5x4 / 3 - x0) / (2 * x3 - (x0 + del5x4 / 3)),
- dela1 = 0, dela2 = 0, dela3 = 0, dela4 = 0, dela5 = 0,
- delb1 = 0, delb2 = 0, delb3 = 0, delb4 = 0, delb5 = 0;
- double[] a1 = new double[3], a2 = new double[3], a3 = new double[3], a4 = new double[3], a5 = new double[3],
- b1 = new double[3], b2 = new double[3], b3 = new double[3], b4 = new double[3], b5 = new double[3],
- sqrtx1 = new double[3], sqrtx2 = new double[3], sqrtx3 = new double[3], sqrtx4 = new double[3], sqrtx5 = new double[3];
- for (var i = 0; i < 3; i++)
- {
- del1x4 += tab1x4[i];
- del2x4 += tab2x4[i];
- del3x4 += tab3x4[i];
- del4x4 += tab4x4[i];
- del5x4 += tab5x4[i];
- }
- Console.WriteLine(@"<x4> = {0:0.###}|{1:0.###}|{2:0.###}|{3:0.###}|{4:0.###}", del1x4 / 3, del2x4 / 3, del3x4 / 3, del4x4 / 3, del5x4 / 3);
- for (int i = 0; i < 3; i++)
- {
- del1t4 += del1t1[i];
- del2t4 += del2t2[i];
- del3t4 += del3t3[i];
- _del4t4 += del4t4[i];
- del5t4 += del5t5[i];
- }
- Console.WriteLine("<delt> = {0:0.###}|{1:0.###}|{2:0.###}|{3:0.###}|{4:0.###}", del1t4 / 3, del2t4 / 3, del3t4 / 3, _del4t4 / 3, del5t4 / 3);
- for (var i = 0; i < 3; i++)
- {
- sqrtx1[i] = Math.Sqrt(Math.Abs(tab1x1[i] - x0));
- sqrtx2[i] = Math.Sqrt(Math.Abs(tab2x1[i] - x0));
- sqrtx3[i] = Math.Sqrt(Math.Abs(tab3x1[i] - x0));
- sqrtx4[i] = Math.Sqrt(Math.Abs(tab4x1[i] - x0));
- sqrtx5[i] = Math.Sqrt(Math.Abs(tab5x1[i] - x0));
- Console.WriteLine("sqrt1(x1-x0) = {0:0.###}\nsqrt2(x1-x0) = {1:0.###}\nsqrt3(x1-x0) = {2:0.###}\nsqrt4(x1-x0) = {3:0.###}\nsqrt5(x1-x0) = {4:0.###}", sqrtx1[i], sqrtx2[i], sqrtx3[i], sqrtx4[i], sqrtx5[i]);
- }
- Console.WriteLine("fla = {0:0.###}|{1:0.###}|{2:0.###}|{3:0.###}|{4:0.###}", full1form2, full2form2, full3form2, full4form2, full5form2);
- for (var i = 0; i < 3; i++)
- {
- a1[i] = (2 * Math.Pow(Math.Sqrt(Math.Abs(x2 - x0)) - Math.Sqrt(Math.Abs(tab1x1[i] - x0)), 2)) / Math.Pow(del1t1[i], 2);
- a2[i] = (2 * Math.Pow(Math.Sqrt(Math.Abs(x2 - x0)) - Math.Sqrt(Math.Abs(tab2x1[i] - x0)), 2)) / Math.Pow(del2t2[i], 2);
- a3[i] = (2 * Math.Pow(Math.Sqrt(Math.Abs(x2 - x0)) - Math.Sqrt(Math.Abs(tab3x1[i] - x0)), 2)) / Math.Pow(del3t3[i], 2);
- a4[i] = (2 * Math.Pow(Math.Sqrt(Math.Abs(x2 - x0)) - Math.Sqrt(Math.Abs(tab4x1[i] - x0)), 2)) / Math.Pow(del4t4[i], 2);
- a5[i] = (2 * Math.Pow(Math.Sqrt(Math.Abs(x2 - x0)) - Math.Sqrt(Math.Abs(tab5x1[i] - x0)), 2)) / Math.Pow(del5t5[i], 2);
- Console.WriteLine("a1 = {0:0.###}\na2 = {1:0.###}\na3 = {2:0.###}\na4 = {3:0.###}\na5 = {4:0.###}", a1[i], a2[i], a3[i], a4[i], a5[i]);
- dela1 += a1[i];
- dela2 += a2[i];
- dela3 += a3[i];
- dela4 += a4[i];
- dela5 += a5[i];
- }
- Console.WriteLine("<a> = {0:0.###}|{1:0.###}|{2:0.###}|{3:0.###}|{4:0.###}", dela1 / 3, dela2 / 3, dela3 / 3, dela4 / 3, dela5 / 3);
- for (var i = 0; i < 3; i++)
- {
- b1[i] = (2 * Math.Pow(Math.Sqrt(Math.Abs(x2 - x0)) - Math.Sqrt(Math.Abs(tab1x1[i] - x0)), 2)) / (R * Math.Pow(del1t1[i], 2));
- b2[i] = (2 * Math.Pow(Math.Sqrt(Math.Abs(x2 - x0)) - Math.Sqrt(Math.Abs(tab2x1[i] - x0)), 2)) / (R * Math.Pow(del2t2[i], 2));
- b3[i] = (2 * Math.Pow(Math.Sqrt(Math.Abs(x2 - x0)) - Math.Sqrt(Math.Abs(tab3x1[i] - x0)), 2)) / (R * Math.Pow(del3t3[i], 2));
- b4[i] = (2 * Math.Pow(Math.Sqrt(Math.Abs(x2 - x0)) - Math.Sqrt(Math.Abs(tab4x1[i] - x0)), 2)) / (R * Math.Pow(del4t4[i], 2));
- b5[i] = (2 * Math.Pow(Math.Sqrt(Math.Abs(x2 - x0)) - Math.Sqrt(Math.Abs(tab5x1[i] - x0)), 2)) / (R * Math.Pow(del5t5[i], 2));
- Console.WriteLine("b1 = {0:0.###}\nb2 = {1:0.###}\nb3 = {2:0.###}\nb4 = {3:0.###}\nb5 = {4:0.###}", b1[i], b2[i], b3[i], b4[i], b5[i]);
- delb1 += b1[i];
- delb2 += b2[i];
- delb3 += b3[i];
- delb4 += b4[i];
- delb5 += b5[i];
- }
- Console.WriteLine("<b> = {0:0.###}|{1:0.###}|{2:0.###}|{3:0.###}|{4:0.###}", delb1 / 3, delb2 / 3, delb3 / 3, delb4 / 3, delb5 / 3);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement