badserve.blogg.se

How to plot a graph in excel and find its derivative
How to plot a graph in excel and find its derivative







The dollar signs tell your spreadsheet program to reference A2 regardless of which cell you copy the equation into. Then in the cell below (B2) type in "=B1+$A$2" without the quotation marks, hit enter. Put your initial value at the top of the next column over, the second picture below shows you what this should look like. For my computer, below 1000 cells usually works well. Once your columns are more than a few thousand cells long, it takes forever for your computer to process them all at once. You could also use 0.01 (it would be a bit more accurate) but you generally don't want to go smaller. Also set your step size, I set mine at 0.1. First, you want to put your x values down in your spreadsheet, I made mine go from -5 to 5. We chose this equation because finding it's derivative and antiderivative will be easy, so we can check our answer. It's the same equation shown in the picture below, which looks a lot nicer. To demonstrate, we're going to use the equation y=2x 3+6x 2-12x+4. If you don't know how to use any of these programs, don't worry, it's pretty easy learning. You'll figure out from here how to apply this to both levels and combine those points to the plot you like.First thing you're going to need is a spreadsheet program like Excel, Numbers, or OpenOffice.

how to plot a graph in excel and find its derivative

Plot(dX,dY,type="l",main="Derivative") #checkĪs you can see, this way you obtain the points for plotting the derivative.

how to plot a graph in excel and find its derivative

Plot(X$t,Y,type="l",main="Original fit") #checkĭY <- diff(Y)/diff(X$t) # the derivative of your functionĭX <- rowMeans(embed(X$t,2)) # centers the X values for plotting Y <- predict(model,newdata=X) # calculate predictions for that sequence It's a very good approximation if you take enough X points. You then simply define your derivative as diff(Y)/diff(X) based on your predicted values, as you would do for differentiation of a discrete function. Let me illustrate by using only one group : require(splines) #thx for the notice You'll have to construct the derivative yourself, and there are two possible ways for that.









How to plot a graph in excel and find its derivative