Hi all
I need to find the derivate from a specific function....
How do u do it?
I need also the Runge kutta method to reach de derivate of a function as well
Any ideas?
Huicho
Printable View
Hi all
I need to find the derivate from a specific function....
How do u do it?
I need also the Runge kutta method to reach de derivate of a function as well
Any ideas?
Huicho
Derivative of f(x):Quote:
Originally Posted by huicho3000
df(x) / dx = lim (h -> 0) [f(x + h) - f(x)] / h
so now you must calculate this limit for your specific function... or else learn the basic derivatives and derivation rules and apply them.
As far as I know the Runge-Kutta method is a numeric method for solving differential equations.
Yes, Runge-Kutta is used for solving differential equations. Here's some code for finding the derivative:
Sub calcderiv()
Dim origx As Double
Dim h As Double
Dim df As Double
Dim f As Double
Dim x As Double
Dim fprime As Double
'set x
x = 500
'Define h as a very small value
h = 1 / 2109999999
'Hold original value of x to be used later
origx = x
'set x value to x plus a very small amount
x = x + h
'calculate the function with the slightly increased value of x
df = 200 + 0.05 * x + 0.0001 * x ^ 2
'set x back to original value
x = origx
'calculate the function with the original value of x
f = 200 + 0.05 * x + 0.0001 * x ^ 2
'find the numeric derivative
fprime = (df - f) / h
MsgBox fprime
End Sub