Integral over sphere

Matthiasf

New member
Joined
Apr 1, 2020
Messages
2
Hi,

I've been looking the whole day to solve this problem and I cannot find a solution.

I have the general equation of a sphere:



I have also a function that gives a value for every point in the 3D space: f(x,y,z). This function describes amount of light falling in at a point / m2.

Now I want to know what is the total amount of light on the sphere. So I have to sum the function over the total area of the sphere. I would think this is an integral of the form int(f(x,y,z) * ds1 *ds2) with ds1 and ds2 some perpendicular vectors in the tangent plane to the sphere in the point x,y,z.

How can I calculate this? I believe I should write ds1 and ds2 in function of x and y and then sum somehow.

Much thanks to the people willing to help me.

Matthias
 

Jomo

Elite Member
Joined
Dec 30, 2014
Messages
7,036
Well your first problem is that you do not have the general equation of a sphere. Please fix that.

Why would you code your problem by not giving us the definition of f(x,y,z)???
 

topsquark

Full Member
Joined
Aug 27, 2012
Messages
920
I have the general equation of a sphere:



I have also a function that gives a value for every point in the 3D space: f(x,y,z). This function describes amount of light falling in at a point / m2.
To be a bit more direct, your equation is for an ellipsoid, not a sphere. The equation for a sphere is centered on the origin ia \(\displaystyle x^2 + y^2 + z^2 = r^2\)

I agree with Jomo... What is f(x, y, z)?

Since you are only dealing with the surface of the sphere you don't need to worry about r changing, so the differential surface element on the sphere will have dimensions \(\displaystyle (r ~ sin( \theta ) ~ d \theta )*( r ~ d \phi )\). Then integrate over the surface.

-Dan
 

Matthiasf

New member
Joined
Apr 1, 2020
Messages
2
Hi,

Thank you for your replies.

I meant indeed that I have the equation of an ellipsoid. So the equation I gave was correct. The word 'sphere' was not.

I agree with Jomo... What is f(x, y, z)?
f(x,y,z) is a complicated function. It's computed by computer in every point.

Maybe I need to say that I try to solve this by computer. So maybe there is a easier numerical way to do this. So what I was thinking about is to take the value at a point, take this as a constant over a small area and calculate the total amount of light. Then take the next point and so on (see attachment).
 

Attachments

Top