How to get the laplacian of a scalar field?

In summary, the laplacian of a scalar field can be calculated by applying reaction diffusion on a 2d image, but it might need something else called laplacian. In 3d, it is not clear what the weights would be to sum the neighbors and the laplacian calculation produces different results than the built in tools.
  • #1
cvex
8
0
Hi,

I am trying to calculate the laplacian of a scalar field but I might actually need something else. So basically I am applying reaction diffusion on a 2d image. I am reading the neighbours, multiplying them with these weights and then add them.

4K0V1JA.png


This works great. I don't know if what I am doing is called laplacian but I was told that it is.

Now I am trying to do the same thing in 3d volumes:
http://www.openvdb.org/

But the problem is I don't know what weights to use to sum the neighbours. If I use the same weights on a 2d volume, it works just the same. But in 3d, I am not sure what the weights would be.

I also tried using actual laplacian (OpenVDB has tools to calculate it), but after 7-8 iterations the values in the volume go to infinity. Maybe what I need is not really laplacian. But whatever is coming from the neighbours has to be in balance so just like in the 2d image version, the values don't get bigger and bigger while nothing is getting smaller. That's my understanding.

I tried calculating the laplacian manually also by using the actual definition, and got different result that the build-in tools. Not sure if I am missing something:
http://paste.ofcode.org/QYUec5tu63AM6n2Bmax6C7

Do you guys know what I need?Cheers :)
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
Are the weights tied to the number of surrounding cells? So that for 3d you'd have 26 neighbors instead of 8 for 2d.

Or tied the number of lines through the point? so for 2d it would be 4 and for 3d it would be 4+9 or 13.

This is just my guess. It would be best if you knew how the weights are calculated.
 
Last edited:
  • Like
Likes cvex
  • #3
Thanks a lot for replying. It's tied to the number of surrounding cells. So for 2d, it's 8 and for 3d it's 26 just like you said.

Also the positive and negative weights have to cancel out, which is why in 2d the original cell has a weight of -1 and the surrounding cells have a total weight of 1.

So in a way the 3d volume is like a stack of 2d images.
 
  • #5
Thanks wolfman, I think that works. I tried it before I think but didn't divide the result by 6 :( Now it seems to work at least.

Thanks a lot :)
 

1. What is the Laplacian of a scalar field?

The Laplacian of a scalar field is a mathematical operator that describes the rate of change of a scalar quantity in space. It is commonly used in physics and engineering to model various physical phenomena.

2. How is the Laplacian of a scalar field calculated?

The Laplacian of a scalar field is calculated by taking the sum of the second partial derivatives of the field with respect to each spatial dimension. In other words, it is the sum of the rates of change of the field in the x, y, and z directions.

3. What is the physical interpretation of the Laplacian of a scalar field?

The Laplacian of a scalar field represents the amount of curvature or bending at a particular point in space. It can also be thought of as a measure of how much the field is changing at that point.

4. How is the Laplacian of a scalar field used in real-world applications?

The Laplacian of a scalar field is used in a variety of applications, such as fluid dynamics, heat transfer, and electromagnetic fields. It is also used in image processing and computer vision to detect edges and features in images.

5. Are there any alternative formulas or methods for calculating the Laplacian of a scalar field?

Yes, there are alternative formulas and methods for calculating the Laplacian of a scalar field, depending on the specific application and the type of field being studied. These may include vector calculus techniques, Fourier analysis, or numerical methods such as finite differences or finite element analysis.

Similar threads

Replies
3
Views
2K
  • General Math
Replies
1
Views
706
  • Cosmology
Replies
1
Views
979
  • Advanced Physics Homework Help
Replies
5
Views
2K
Replies
1
Views
2K
  • Special and General Relativity
Replies
15
Views
3K
  • Quantum Physics
Replies
4
Views
876
Replies
1
Views
1K
  • Introductory Physics Homework Help
Replies
16
Views
406
  • Classical Physics
Replies
22
Views
2K
Back
Top