The y values correspond to an x domain ranging from -3 to 6


Write a C program that reads in the Y values of a function provided in data.txt. The Y values correspond to an X domain ranging from -3 to 6 with a step size of 0.01. The program must use a function that performs the numerical differentiation method described below to calculate the derivative of the input data and write the resulting X and Y values to a CSV file. Corresponding X and Y values must be separated by a comma and subsequent data points must be separated by new lines.
m=Δf(x)/Δx=[f(x+h)-f(x)]/h
In our case the size of h is our step size and if we perform this calculation between each data point we will get the derivative of the function.
• A function must be used to calculate the derivative between 2 values, it must accept the 2 Y values currently being evaluated and return the derivative at that point.
• When a file is opened it must be confirmed that the file was opened correctly.
• The lower and upper bound values and step size must be defined as constants
Next the produced CSV file must be imported into Microsoft Excel and the X and Y data must be plotted in a chart. The axes must be labelled appropriately and the chart must be given a title. Once the data is plotted a trendline of the appropriate type must be fitted to the data.
Finally you must calculate the variance of the Y values imported into Excel without using the built in variance function. You may only use the built in SUM and AVERAGE functions. Variance is defined in the equation below:
σ2=(Σ(X-μ)2)/N

Where σ2 is the variance, X is the actual data, μ is the average of all the data and N is the total number of data elements. You will make a cell that contains the average of all the Y values. Then for each Y value a formula must produce a cell that contains the value of (X- μ)2 where X is the individual data elements and then you must average all of the resulting values.

Request for Solution File

Ask an Expert for Answer!!
Electrical Engineering: The y values correspond to an x domain ranging from -3 to 6
Reference No:- TGS0612528

Expected delivery within 24 Hours