Questions tagged [differentiation]

The process of finding a derivative.

In calculus, a branch of mathematics, the derivative is a measure of how a function changes as its input changes. Loosely speaking, a derivative can be thought of as how much one quantity is changing in response to changes in some other quantity.

The derivative of a function at a chosen input value describes the best linear approximation of the function near that input value. For a real-valued function of a single real variable, the derivative at a point equals the slope of the tangent line to the graph of the function at that point. In higher dimensions, the derivative of a function at a point is a linear transformation called the linearization.[1] A closely related notion is the differential of a function.

236 questions
4
votes
1 answer

How do I use mathematica to implicitly solve differential equations of a single variable?

I'm trying to force Mathematica to implicitly differentiate an ellipse equation of the form: x^2/a^2+y^2/b^2 == 100 with a = 8 and b = 6. The command I'm using looks like this: D[x^2/a^2 + y^2/b^2 == 100/. y -> 3/4*Sqrt[6400-x^2], x] where,…
franklin
  • 1,800
  • 7
  • 32
  • 59
4
votes
1 answer

Creating and working with exact differentials in SymPy

I am trying to figure out how to create and manipulate exact differentials (algebraic treatment of Leibniz notation) in SymPy. To be clear, it is well known that from sympy import * init_printing() x, y=symbols('x, y') f=Function('f')(x,…
SKArm
  • 71
  • 1
  • 7
4
votes
2 answers

How to take the derivative of a Signal in Python?

I am new at Python language and coding. I am trying to acquire and differentiate a live signal from a Arduino UNO Board using the USB Serial. So far, I am acquiring the data with no problems, but I cant get information about how to differentiate…
Hugo Oliveira
  • 197
  • 2
  • 3
  • 8
4
votes
3 answers

Obtain the difference between two files

First of all, i searched on the web and stackoverflow for around 3 days and haven't found anything i've been looking for. I am doing a weekly security audit where i get back a .csv file with the IPs and the open ports. They look like…
Daniel S.
  • 53
  • 1
  • 6
4
votes
1 answer

Theano gradient with function on tensors

I have a function that calculates a value of a scalar field on a 3D space, so I feed it 3D tensors for x, y and z coordinates (obtained by numpy.meshgrid) and use elementwise operations everywhere. This works as expected. Now I need to calculate a…
cube
  • 3,867
  • 7
  • 32
  • 52
4
votes
6 answers

Derivative Calculator

I'm interested in building a derivative calculator. I've racked my brains over solving the problem, but I haven't found a right solution at all. May you have a hint how to start? Thanks I'm sorry! I clearly want to make symbolic…
burki
  • 2,946
  • 6
  • 37
  • 51
4
votes
0 answers

Calculating Relative Vorticity Using Python numpy

I am trying to calculate relative vorticity i.e dV/dX - dU/dY and I am currently using the gradient function on numpy. Here is my code below. I would like to know if there is a better way of doing this instead of trying to reshape the array when I…
4
votes
1 answer

Computing the Jacobian matrix for x^2*y, 5*x+sin(y)

If I have an R^n --> R^m function, how can I create its Jacobian matrix? For instance: expression( x^2*y, 5*x+sin(y) ) # f : R^2 --> R^2 I'd like to have a matrix of expressions like: expression(2*x*y) expression(x^2) expression(5)…
David Angyal
  • 231
  • 4
  • 13
4
votes
1 answer

Differentiation of a buffer with Delphi

I receive a buffer of data periodically that contains a number of values that are a fixed distance in time apart. I need to differentiate them. It is soo long since I did calculus at school .... What I have come up with is this: function…
user745323
  • 153
  • 1
  • 1
  • 8
4
votes
2 answers

Java - Computation of Derivations with Apache Commons Mathematic Library

I have a problem in using the apache commons math library. I just want to create functions like f(x) = 4x^2 + 2x and I want to compute the derivative of this function --> f'(x) = 8x + 2 I read the article about Differentiation…
3
votes
1 answer

Julia: Zygote.@adjoint from Enzyme.autodiff

Given the function f! below : function f!(s::Vector, a::Vector, b::Vector) s .= a .+ b return nothing end # f! How can I define an adjoint for Zygote based on Enzyme.autodiff(f!, Const, Duplicated(s, dz_ds). Duplicated(a, zero(a)),…
3
votes
1 answer

sympy - is there a way to differentiate over an abstract variable?

I'm learning SymPy now, and I wonder if there's a way to differentiate a function over one of its variables in the general form. Consider this example: There a vector, lets write its components as x_1, x_2, x_3. The length r of such vector will be r…
Bbllaaddee
  • 145
  • 1
  • 9
3
votes
2 answers

Perplexing behaviour when approximating the derivative in haskell

I have defined a typeclass Differentiable to be implemented by any type which can operate on infinitesimals. Here is an example: class Fractional a => Differentiable a where dif :: (a -> a) -> (a -> a) difs :: (a -> a) -> [a -> a] difs =…
user13507303
3
votes
1 answer

How to implement differentiable hamming loss in pytorch?

How to implement a differentiable loss function that counts the number of wrong predictions? output = [1,0,4,10] target = [1,2,4,15] loss = np.count_nonzero(output != target) / len(output) # [0,1,0,1] -> 2 / 4 -> 0.5 I have tried a few…
Oleg Dats
  • 3,933
  • 9
  • 38
  • 61
3
votes
2 answers

Differentiation of a multivariate function via SymPy and evaluation at a point

I want to take the derivative of a multivariable function using SymPy and then for a) the symbolic result to be printed and then b) the result of the derivative at a point to be printed. I'm using the following code import math as m import numpy …
CAF
  • 329
  • 3
  • 14
1
2
3
15 16