Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
z-integration in spherical coordinates

Subject: z-integration in spherical coordinates

From: KS

Date: 29 Jan, 2009 02:54:40

Message: 1 of 4

Hi all,

I need to integrate a 2d vector in spherical coordinates (radius and
colatitude) along the z direction. Does anyone have advice or a
script to do this?

Thanks,
KS

Subject: z-integration in spherical coordinates

From: vedenev

Date: 29 Jan, 2009 10:07:51

Message: 2 of 4

triplequad function can integrate 3 variable integrals numericly.

------------------------------------
Maxim Vedenev, Matlab freelancer
vedenev@ngs.ru
http://simulations.narod.ru/

Subject: z-integration in spherical coordinates

From: KS

Date: 29 Jan, 2009 15:24:15

Message: 3 of 4

On Jan 29, 2:07=A0am, vedenev <vedenev.ma...@gmail.com> wrote:
> triplequad function can integrate 3 variable integrals numericly.
>
> ------------------------------------
> Maxim Vedenev, Matlab freelancer
> vede...@ngs.ruhttp://simulations.narod.ru/

Thanks for the suggestion. It seems that triplequad is only for a
function f=3D(x,y,z), (eg., f=3Dy*sin(x)+z*cos(x)). However, my data is
not defined this way; I only have data at discrete points in a
spherical shell. Is there a way to accommodate for this using
triplequad?

Subject: z-integration in spherical coordinates

From: Roger Stafford

Date: 29 Jan, 2009 17:30:19

Message: 4 of 4

KS <KSoderlund@gmail.com> wrote in message <9f121c6c-68ea-49ad-a8aa-eab0025e3413@k36g2000pri.googlegroups.com>...
> ......
> Thanks for the suggestion. It seems that triplequad is only for a
> function f=3D(x,y,z), (eg., f=3Dy*sin(x)+z*cos(x)). However, my data is
> not defined this way; I only have data at discrete points in a
> spherical shell. Is there a way to accommodate for this using
> triplequad?

  You need to state more clearly what you are trying to do, KS. What is it you are integrating as z changes? It sounds as if for each z you have a circle intersection with the sphere on which many discrete points have values but it isn't clear how you wish these values to be included in an integration process in the z direction. If you have discrete values distributed over the spherical surface it takes a double integration of some kind to get a single answer, but that would involve integrating in more than just the z-direction; double integrals require integrations taken with respect to two variables.

  Please think things out carefully and then give a much more complete description of your problem. People in this newsgroup generally dislike having to continually make guesses as to what users really want. That can cause a lot of wasted effort.

  You should also realize that if you are dealing with discrete values, you will ordinarily not be able to use such functions as 'quad', 'dblquad', or 'triplequad' which require a continuous function be defined. Instead you will have to make use of routines which deal with discrete values such as 'trapz' or some of the higher order integration routines in the Matlab File Exchange.

Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us