Thread Subject: Issues with symbolic integration

Subject: Issues with symbolic integration

From: Emile

Date: 21 Nov, 2009 16:42:00

Message: 1 of 4

Hi all, this is my first post on here. I'm a semi experienced Matlab user but I've run into some problems that l could use some assistance with. I've been searching for the past few days but could use some more specific information.

Basically my issue is getting the symbolic integration to give me an answer that makes physical sense. I am trying to get a temperature solution by use of Green's functions. One of the functions is dependent upon x' and tau, the second function is dependent upon y' and tau, and the third function is dependent upon z' and tau. First I integrate function 1 with respect to x' then integrate function 2 with respect to y' and then integrate function 3 with respect to z'. Up until this point the symbolic integration has matched my hand calculations. However the last step is to multiply all the functions together and integrate with respect to tau. This is where I'm running into issues. For your reference the functions I have are in the form:

Gx23=sum(m=1,inf)[C1*exp(-A1*(t-tau))*cos(x)]
Gy22=D1+sum(m=1,inf)[C2*exp(-A2*(t-tau))*cos(y)]
Gz22=D2+sum(m=2,inf)[C3*exp(-A3*(t-tau))*cos(z)]

These functions are after the integration w/respect to x',y',z'. Also, C1,A1,D1,C2,A2,D2,C3,A3 are all constants. x,y,z and t are all variables that give a temperature at a specific coordinate and time. Also the integration bounds for tau are 0 to t.

I performed a very careful hand calculation and put the result into matlab so I could compare it to what the matlab integration was giving me. With my hand calculations the results make sense (i.e. relatively small, positive numbers). However, matlab is giving me negative numbers and the answer is supposed to be in Kelvin so a negative number makes no sense. Is there anything I am doing wrong or is there a better way to do this?

Your help is greatly appreciated.

Emile

Subject: Issues with symbolic integration

From: Emile

Date: 21 Nov, 2009 17:05:05

Message: 2 of 4

Also, something else I noticed. If I reverse the order of integration i.e. going int(G,tau,t,0) as opposed to int(G,tau,0,t) I get the correct, positive answer? I'm not sure what is going on there.

Say that is the solution and I'm moving on. How would be the best way to go about plotting a 3D temperature plot from a symbolic integration over an array of x y and z values at a specific time interval? Ideally I'd like to have a color range that denotes the high temperatures with red and low tempeatures with blue.

Subject: Issues with symbolic integration

From: Emile

Date: 21 Nov, 2009 19:32:06

Message: 3 of 4

Also, something else I noticed. If I reverse the order of integration i.e. going int(G,tau,t,0) as opposed to int(G,tau,0,t) I get the correct, positive answer? I'm not sure what is going on there.

Say that is the solution and I'm moving on. How would be the best way to go about plotting a 3D temperature plot from a symbolic integration over an array of x y and z values at a specific time interval? Ideally I'd like to have a color range that denotes the high temperatures with red and low tempeatures with blue.

Subject: Issues with symbolic integration

From: Nasser M. Abbasi

Date: 21 Nov, 2009 22:14:48

Message: 4 of 4


"Emile " <e_menair20@msn.com> wrote in message
news:he96k1$lnm$1@fred.mathworks.com...
> Also, something else I noticed. If I reverse the order of integration i.e.
> going int(G,tau,t,0) as opposed to int(G,tau,0,t) I get the
> correct, positive answer? I'm not sure what is going on there.
>

I did not look in detailed into what you wrote earlier, but as far as the
above is concerned, isn't that what you would expect from basic calculus?
when you switch the limits of integration, you change the sign:

one point Gaussian quadrature approximation:

       int( f(t), t= a..b ) = (b-a) f( (a+b)/2 )

so if you reverse the range, you get

       int( f(t), t= b..a ) = (a-b) f( (b+a)/2 )

Hence, the weight now has different sign. in your case a=0, b=t, so, one
time the weight is t, and in the other time the weight is -t

So the sign change is making your final answer correct as you'd expect it?


> Say that is the solution and I'm moving on. How would be the best way to
> go about plotting a 3D temperature plot from a symbolic integration over
> an array of x y and z values at a specific time interval? Ideally I'd like
> to have a color range that denotes the high temperatures with red and low
> tempeatures with blue.

good luck,
--Nasser

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Contact us at files@mathworks.com