Differentiation in 2D for Non Uniformly Distributed Data
25 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello, My problem is quite simple, I think, but I cannot find a solution.
I have a 2d scatter plot of an electric field. So basically I have a nx3 matrix, let's call it M, where the 2 first columns are the x and y coordinates, and the 3rd column is a value between 0 and 1 Volts.
So I basically plot this as: scatter(M(:,1),M(:,2),5,M(:,3));
I would like to calculate the second order spatial derivative of this electric field in 2 Dimensions. But I don't know how to do that. I tried using the gradient function, but this doesn't work. I think this is due to the fact that my 2D space is not uniformly distributed (it was exported by a FEA in COMSOL).
Thank you in advance for your help.
Julia
2 comentarios
Alberto
el 10 de Abr. de 2014
Editada: Alberto
el 10 de Abr. de 2014
Hi Julia:
in a function like that, second order derivatives is the Hessian matrix. There are formulas for obtain the second order partial derivatives, I`m afraid you will have to implement them by yourself.
For example, for the first derivative, and you have the nodes x_0, x_1 and x_2:
f'(x_1)= [f(x_2) - f(x_0)]/(x_2 - x_0)
This first derivative aproximation doesn't need the spaces between the nodes. Once you have the functions derived, you can derived again in the same variable or the other one.
Respuestas (3)
Andrew Newell
el 10 de Abr. de 2014
Editada: Andrew Newell
el 10 de Abr. de 2014
Before using finite difference formulae, you should use TriScatteredInterp to create a gridded data set. You can't use the gradient function because it applies to functions, not fixed data points. Once you have obtained the Hessian, how you plot it depends on what you want to learn. For example, you might want to look at each component separately, or you might be interested in the norm.
0 comentarios
Gypaets
el 18 de Dic. de 2015
You can get the second order derivatives approximation with
[~, ~, Uxx, Uyy, Uxy]=trigradient2(M(:,1),M(:,2),M(:,3));
0 comentarios
jennifer
el 11 de Nov. de 2024 a las 13:48
Differentiating 2D data when it’s not uniformly distributed can be challenging because the data points are spaced unevenly, making standard methods less accurate. Specialized techniques, like using adaptive grids or interpolation, help achieve smoother results. For projects that involve complex data visualization, such as in animations, working with professionals can make a real difference. Partnering with a Video Animation Company in Dubai ensures accurate and visually engaging representation of data, helping audiences understand insights more effectively.
0 comentarios
Ver también
Categorías
Más información sobre Fractals en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!