Re: How to interpret this integral?
- To: mathgroup at smc.vnet.net
- Subject: [mg112616] Re: How to interpret this integral?
- From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
- Date: Thu, 23 Sep 2010 04:21:35 -0400 (EDT)
Hi Julian, The problem for aW==0 can be solved by using the following expression when aW equals zero: In[129]:== Limit[result, aW -> 0] Out[129]== (1/(w0^2))(-aV Cos[th0] + aV Cos[th0 + Ts w0] + w0 (-v0 Sin[th0] + aV Ts Sin[th0 + Ts w0] + v0 Sin[th0 + Ts w0])) For aW <0 I think you'll be able to solve the problem if you realize that FresnelC[a I] == I FresnelC[a] and FresnelS[a I] == -I FresnelS[a]. So replacing Sqrt[wA] with I Sqrt[-wA] and canceling the common factors of I (there's a wA^(3/2) in front) will yield your expression for wA < 0. Cheers -- Sjoerd -----Original Message----- From: Julian Stoev / =D0=AE=D0=BB=D0=B8=D0=B0=D0=BD =D0=A1=D1=82=D0=BE=D0= =B5=D0=B2 [mailto:julian.stoev at gmail.com] Sent: Wednesday 22 September 2010 16:02 To: Sjoerd C. de Vries Subject: [mg112616] Re: How to interpret this integral? Hello Sjoerd, I have no problems with Fresnel integrals. There is free code available, which can evaluate them quite well for real arguments. http://mymathlib.webtrellis.net/functions/fresnel_sin_cos_integrals.html However Sqrt[negative] and 1/0 should be avoided for any possible numerical values. best! --JS On Wed, Sep 22, 2010 at 3:55 PM, Sjoerd C. de Vries <sjoerd.c.devries at gmail.com> wrote: > Hi Julian, > > I don't know how to get rid of the Fresnel integrals, but for use in C > programs couldn't you just generate a (large) table of Fresnel > integral values and interpolate where needed? They both converge to a > fixed value rather rapidly, so that should be doable. > > For instance, you could sample the integrals at their local maxima at > +/- Sqrt[2/\[Pi]] Sqrt[\[Pi] + 2 \[Pi] k] with k integer and minima at > 2 Sqrt[k]. > > Cheers -- Sjoerd > > On Sep 22, 7:57 am, Julian <julian.st... at gmail.com> wrote: >> Hello All, >> >> After long interruption with symbolic computing, I am struggling how >> to make a useful result out of this integral. >> >> Integrate[(aV*t + v0)*Cos[(aW*t^2)/2 + th0 + t*w0, {t, 0, Ts}] >> >> It comes from the differential equations describing the motion of a >> wheeled robot. aV and aW are accelerations and v0, w0, th0 are initial >> conditions. The numerical solution clearly exists for different real >> accelerations, including positive, negative and zero. >> >> However the symbolic solution of Mathematica is: >> (Sqrt[Pi]*(-(aW*v0) + aV*w0)*Cos[th0 - w0^2/(2*aW)]* >> FresnelC[w0/(Sqrt[aW]*Sqrt[Pi])] + Sqrt[Pi]*(aW*v0 - aV*w0)* >> Cos[th0 - w0^2/(2*aW)]*FresnelC[(aW*Ts + w0)/(Sqrt[aW]*Sqrt[Pi])] >> + >> aV*Sqrt[aW]*(-Sin[th0] + Sin[th0 + (aW*Ts^2)/2 + Ts*w0]) + >> Sqrt[Pi]*(aW*v0 - aV*w0)*(FresnelS[w0/(Sqrt[aW]*Sqrt[Pi])] - >> FresnelS[(aW*Ts + w0)/(Sqrt[aW]*Sqrt[Pi])])*Sin[th0 - w0^2/ >> (2*aW)])/ >> aW^(3/2) >> >> Note that aW can be found inside a Sqrt function and also in the >> denominator. While I can see that FresnelS[Infinity] is well defined, >> so aW====0 should not be a real problem, it is still very problematic >> how to use this result at this particular point. The case of negative >> aW is also interesting, because it will require a complex FresnelS and >> FresnelC. I somehow managed to remove this problem using >> ComplexExpand, but I am not sure this is the good solution. >> >> I tried to give Assumptions -> Element[{aW, aV, w0, v0, Ts, th0}, >> Reals] to the integral, but there is no change in the solution. >> >> While I understand that the solution of Mathematica is correct in the >> strict mathematical sense, I have to use the result to generate a C- >> code, which will be evaluated numerically and the solution I have now >> is not working for this. >> >> Can some experienced user give a good advice how use get a solution of >> the problem? >> >> Thank you in advance! >> >> --JS > > -- Julian Stoev, PhD. Control Researcher