Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Integration with non-numeric parameters
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
ingramfina...@gmail.com  
View profile   Translate to Translated (View Original)
 More options 3 Aug 2007, 11:51
Newsgroups: comp.soft-sys.math.mathematica
From: ingramfina...@gmail.com
Date: Fri, 3 Aug 2007 10:51:55 +0000 (UTC)
Local: Fri 3 Aug 2007 11:51
Subject: Integration with non-numeric parameters
When I use Mathematica to solve the following
y=x1/(2*sigma^2*t)

Integrate[y, {t, .5, 1}]

I get the following answer:

(0.34657*x1/sigma^2)

OK, so far, so good. It appears that I can generate an answer with a
non-numeric parameter. Note that I am looking for an answer in terms
of x1.

But when I try

 q=Exp[-(x1-t)^2/2*sigma^2*t]

Integrate[q, {t, .5,1}]

Now Mathematica does not solve this integral, it just repeats the
command

I am trying to get an expression in terms of x1. Why do I get a
statement like this instead of an answer?  There is something about
the functional form of the integrand that is causing the problem, I
just don't know what it is.

Any help you can give me is much appreciated!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jean-Marc Gulliet  
View profile   Translate to Translated (View Original)
 More options 4 Aug 2007, 10:48
Newsgroups: comp.soft-sys.math.mathematica
From: Jean-Marc Gulliet <jeanmarc.gull...@gmail.com>
Date: Sat, 4 Aug 2007 09:48:22 +0000 (UTC)
Local: Sat 4 Aug 2007 10:48
Subject: Re: Integration with non-numeric parameters

ingramfina...@gmail.com wrote:

(*snip*)

> But when I try

>  q=Exp[-(x1-t)^2/2*sigma^2*t]

> Integrate[q, {t, .5,1}]

> Now Mathematica does not solve this integral, it just repeats the
> command

> I am trying to get an expression in terms of x1. Why do I get a
> statement like this instead of an answer?

(*snip*)

It is conventional (by design) that Mathematica returns an expression
unevaluated when Mathematica does not know how to evaluate this
expression. This can happen for user-defined functions as well as
built-in functions (though in special circumstances).

For instance, having started a new Mathematica session, if we try to
evaluate f[2], Mathematica just returns f[2] since it has not  the
slightest idea of what the function f can possibly do.

In[1]:= f[2]

Out[1]= f[2]

Now, we give a definition (a meaning) to the symbol f.

In[2]:= f[x_] = 2 x

Out[2]= 2 x

 From now on, evaluating f will return a value.

In[3]:= f[2]

Out[3]= 4

Of course, *Integrate* is a built-in function that has already a
meaning. Still, if Mathematica does not know how to find a definite or
indefinite integral, it returns the original expression as answer.

For instance, Mathematica knows how to integrate E^(-x^2) (in terms of
error function) and E^(-x^3) (in terms of gamma function) but not
E^(-x^3 - x^2) (the expression is returned unevaluated).

In[1]:= Integrate[Exp[-x^2], x]

Out[1]= 1/2 Sqrt[\[Pi]] Erf[x]

In[2]:= Integrate[Exp[-x^3], x]

Out[2]= -((x Gamma[1/3, x^3])/(3 (x^3)^(1/3)))

In[3]:= Integrate[Exp[-x^3 - x^2], x]

Out[3]= Integrate[E^(-x^2 - x^3), x]

Regards,
Jean-Marc


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dimitris  
View profile   Translate to Translated (View Original)
 More options 4 Aug 2007, 10:56
Newsgroups: comp.soft-sys.math.mathematica
From: dimitris <dimmec...@yahoo.com>
Date: Sat, 4 Aug 2007 09:56:30 +0000 (UTC)
Local: Sat 4 Aug 2007 10:56
Subject: Re: Integration with non-numeric parameters
On 3    , 13:51, ingramfina...@gmail.com wrote:

Do not mix arbitrary precision numbers with symbolic built in
functions.
Use 1/2 instead of 0.5!

So,

In[43]:=
Clear["Global`*"]

In[44]:=
y = x1/(2*sigma^2*t)

Out[44]=
x1/(2*sigma^2*t)

In[45]:=
Integrate[y, {t, 1/2, 1}]

Out[45]=
(x1*Log[2])/(2*sigma^2)

In[46]:=
q = Exp[(-((x1 - t)^2/2))*sigma^2*t]

Out[46]=
E^((-(1/2))*sigma^2*t*(-t + x1)^2)

In[47]:=
Integrate[q, {t, 1/2, 1}]

Out[47]=
Integrate[E^((-(1/2))*sigma^2*t*(-t + x1)^2), {t, 1/2, 1}]

The latter integral is not a trivial one!

In another CAS,

convert("Integrate[E^((-(1/2))*sigma^2*t*(-t + x1)^2), {t, 1/2,
1}]",FromMma,evaluate);

                    1
                   /              2            2
                  |          sigma  t (-t + x1)
                  |    exp(- -------------------) dt
                  |                   2
                 /
                   1/2

Again the integral is stated unevaluated.

Dimitris


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jens-Peer Kuska  
View profile   Translate to Translated (View Original)
 More options 4 Aug 2007, 10:57
Newsgroups: comp.soft-sys.math.mathematica
From: Jens-Peer Kuska <ku...@informatik.uni-leipzig.de>
Date: Sat, 4 Aug 2007 09:57:30 +0000 (UTC)
Local: Sat 4 Aug 2007 10:57
Subject: Re: Integration with non-numeric parameters
Hi,

there is no analytical expression for integrals of the form

Integrate[Exp[a*t^n],t]

for n>2.

Regards
   Jens


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ben  
View profile   Translate to Translated (View Original)
 More options 4 Aug 2007, 11:00
Newsgroups: comp.soft-sys.math.mathematica
From: ben <benjamin.friedr...@gmail.com>
Date: Sat, 4 Aug 2007 10:00:33 +0000 (UTC)
Local: Sat 4 Aug 2007 11:00
Subject: Re: Integration with non-numeric parameters
On 3 Aug., 12:51, ingramfina...@gmail.com wrote:
> When I use Mathematica to solve the following
> y=x1/(2*sigma^2*t)

> Integrate[y, {t, .5, 1}]

> I get the following answer:

> (0.34657*x1/sigma^2)

> OK, so far, so good. It appears that I can generate an answer with a
> non-numeric parameter. Note that I am looking for an answer in terms
> of x1.

> But when I try

It could well be, that this integral cannot be expressed in terms
of simple functions.
Already the case x1=0 gives you nasty ExpIntegralE-functions.

Bye
Ben


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Pein  
View profile   Translate to Translated (View Original)
 More options 4 Aug 2007, 11:14
Newsgroups: comp.soft-sys.math.mathematica
From: Peter Pein <pet...@dordos.net>
Date: Sat, 4 Aug 2007 10:14:52 +0000 (UTC)
Local: Sat 4 Aug 2007 11:14
Subject: Re: Integration with non-numeric parameters
ingramfina...@gmail.com schrieb:

Hi,

I did not get a value for your integral, but I want to give an advice:

If you use the exact function Integrate[], do not use inexact numbers as
boundaries! Or use NIntegrate.

I want to demonstrate this with a function, which is in an optical way
similar to yours (I moved one factor t out of the exponential function):

In[1]:=
q = t*Exp[(-(x1 - t)^2/2)*sigma^2];

In[2]:=
Timing[FullSimplify[Integrate[q, {t, 1/2, 1}, Assumptions -> sigma >= 0]]]

Out[2]=
{11.024688*Second, ((2*(E^((3*sigma^2)/8) - E^((sigma^2*x1)/2)))/
     E^((1/2)*sigma^2*(1 + (-1 + x1)*x1)) - Sqrt[2*Pi]*sigma*x1*
     (Erf[(sigma*(1 - 2*x1))/(2*Sqrt[2])] + Erf[(sigma*(-1 +
x1))/Sqrt[2]]))/(2*sigma^2)}

Now let's try the same with .5 instead of 1/2 and constrained to 10
times the time, Integrate has used for exact numbers:

In[3]:=
TimeConstrained[
Integrate[q,{t,.5,1},Assumptions\[Rule]sigma\[GreaterEqual]0]//FullSimplify //
    Timing,10*%[[1]]/Second,$Failed]

Out[3]=
$Failed

Back to _your_ q:

But you are using inexat numbers, therefore I will assume, you're
interested in floats (Reals) as result.

Use NIntegrate[]. NIntegrate needs all constants in its integrand to be
specific numeric values. So the definition

theIntegral[x1_?NumericQ, sigma_?NumericQ] :=
  NIntegrate[Exp[-t*(x1 - t)^2/2*sigma^2], {t, 1/2, 1}]

gives you a function which can be used for other functions (like
FindMaximum, NIntegrate, NLimit[], Plot3D[], etc.)

e.g.: Plot3D[theIntegral[x, s], {x, 0, 2}, {s, 0, 1}, PlotRange -> All]

Peter


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google