Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Calculate and display on the screen in the form of a table the values of the function specified using the Taylor series

$
0
0

Calculate and display on the screen in the form of a table the values of the function specified using the Taylor series in the interval from Xstart to Xend with a step of dx with an accuracy of E. Provide the table with a header and a header. Each row of the table must contain the value of the argument, the value of the function and the number of summed members of the series.Taylor series

I just can't understand what does lnx on the left side mean? This is not Taylor series for lnx..

using System;namespace LabWorks1k2s{    internal class Program    {        static void Main()        {            double y, xmin, xmax, dx, e;            int n, nmax;            string buf;            do {                Console.WriteLine("x start: ");                buf = Console.ReadLine();                xmin = Convert.ToDouble(buf);            }            while (xmin < 0.5);            do            {                Console.WriteLine("x end: ");                buf = Console.ReadLine();                xmax = Convert.ToDouble(buf);            }            while (xmax < 0.5);            Console.WriteLine("dх: ");            buf = Console.ReadLine();            dx = Convert.ToDouble(buf);            Console.WriteLine("Iterations: ");            buf = Console.ReadLine();            nmax = Convert.ToInt32(buf);            Console.WriteLine("accuracy e: ");            buf = Console.ReadLine();            e = Convert.ToDouble(buf);            n = 0;            double sum = 0;            Console.WriteLine("Arg\t                           Func\t       N");            while (xmin<=xmax)            {                do                {                    y = Math.Pow((xmin - 1), n + 1) / (n + 1) * Math.Pow(xmin, n + 1);                    sum = sum + y;                    n++;                    xmin += dx;                    Console.WriteLine("{0}\t{1,50}\t{2}", xmin, sum, n);                    if (n>=nmax) {                        Console.WriteLine("Too much iterations!");                        break;                    }                }                while (Math.Abs(sum) >= e);            }            Console.ReadKey();        }    }}

Made this code, but I don't actually understand task :c


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>