Items tagged with integration integration Tagged Items Feed

with(CurveFitting);
f := PolynomialInterpolation([[0, x0], [1, x1], [2, x2], [3, x3]], x);
f2 := solve(f=y,x);
result := int(f2[1], y=0..1);

is it possible to return a polynomials result rather than integration result in this particular case?

how many number of points more than 2 that can have result which is polynomials?

Dear all,

I would like to compute numerically using Maple the following improper integral

``

Integrand := (1/4)*(((((6*I)*beta-3-6*C+(6*I)*C*beta)*s^4+((24*I)*C*beta-24*C-12)*s^2+(24*I)*(1+C)*beta)*BesselK(0, s)+12*BesselK(1, s)*(C+1/2)*s^3)*BesselI(1, s)^3+6*BesselI(0, s)*(-(2*(I*beta*C*s^2+(2*I)*beta*C+(2*I)*beta+4*C+2))*s*BesselK(0, s)+((I*beta*C+I*beta-C-1/2)*s^4+((4*I)*C*beta+4*C+2)*s^2+(4*I)*(1+C)*beta)*BesselK(1, s))*BesselI(1, s)^2-(12*(-(1/2*((C+1/2)*s^2+I*beta*C+I*beta+8*C+4))*s*BesselK(0, s)+((I*beta*C+2*C+1)*s^2+(2*I)*(1+C)*beta)*BesselK(1, s)))*s*BesselI(0, s)^2*BesselI(1, s)+6*s^2*((-2*C-1)*s*BesselK(0, s)+BesselK(1, s)*((C+1/2)*s^2+I*(1+C)*beta))*BesselI(0, s)^3)/((BesselI(0, s)^2*s-BesselI(1, s)^2*s-2*BesselI(1, s)*BesselI(0, s))^2*(C+1/2)*s*Pi):

``


However, Maple does seem to give a result for this integral. I have tried to compute from e.g. 0.001 as an approximation but it turns out that the integrand diverges as s goes to zero. I have also tried some options such as method = _d01amc but I get Error, (in evalf/int) powering may produce overflow.

 

I would appreciate it if someone here could provide with some help with regards to the computation of such improper integrals. Thank you.

 

Download question.mw

Hi everybody

In the following attached file, I try to evaluate an integration, K_fL. Unfortunately, Maple does not evaluate it and just puts integration symbol and its bounds. I want to have final integration value. Is there any solution to this integration or maybe Maple can not solve this integration because of the complexity of integrand?

Thanks in advance

Q1.mw

Hi
I want to solve this integration simbolic:


I use this cammand :

But Maple return this:

Would you Please Help me , thanks

I'm running into a very simple problem with the way that Maple integrates Heaviside functions. Naively, it should act like a step function, but it is not integrating properly. See the attached document.

int(int(Heaviside(-x^2-y^2+1), x = -1 .. 1), y = -1 .. 1)

0

(1)

evalf(Int(Heaviside(-x^2-y^2+1), [x = -1 .. 1, y = -1 .. 1]))

3.141592654

(2)

int(piecewise(-x^2-y^2+1 > 0, 1, 0), [x = -1 .. 1, y = -1 .. 1])

Pi

(3)

``


Note that the symbolic integration of the Heaviside function (defined to be 1 inside the unit circle and 0 outside) gives zero, whereas it should clearly give the area of the unit circle, which the numerical integration does. I even checked that the (suposedly equivalent) piecewise definition symbolically evaluates to the area, and it, too, gets the right answer.

Anyone have any clue as to why the symbolic integration of this Heaviside function is so wrong? My understanding is that if we do the integral as two nested 1D integrals, the returned function (as a function of y) is zero everywhere except at y=0, but that result cannot be right either.

Thoughts?

 

Download Heaviside-error.mw

Greetings to all. The title describes it well, I am writing about testing the limits of the Maple integration engine. A recent discussion at math.stackexchange.com features a family of integrals that involve the product of a power of the natural logarithm and a rational function, more precisely,

int((log(x))^n/(x^3+1), x=0..infinity);

These integrals can be evaluated recursively as described at the MSE link using a technique that generalizes to other types of rational factors. Unfortunately Maple apparently only finds a simple closed form for a few small initial values of n. The following transcript of a Maple session illustrates the problem. Mathematica was successful here. Also observe the memory allocation in the Maple session.

    |\^/|     Maple 18 (X86 64 LINUX)
._|\|   |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2014
 \  MAPLE  /  All rights reserved. Maple is a trademark of
 <____ ____>  Waterloo Maple Inc.
      |       Type ? for help.
> restart; read `cl.maple`;
alpha := (n, k) ->

                                                           n
    -1/3 exp(1/3 I Pi + 2/3 I Pi k) (1/3 I Pi + 2/3 I Pi k)

Q := proc(n)
local res;
option remember;
    if n = 0 then return 2/9*sqrt(3)*Pi end if;
    res := -add(alpha(n + 1, k), k = 0 .. 2)/(n + 1) - add(
        binomial(n + 1, p)*(2*I*Pi)^(n - p)*Q(p),
        p = 0 .. n - 1)/(n + 1);
    simplify(res)
end proc

                               infinity
                              /               n
                             |          log(x)
              VERIF := n ->  |          ------- dx
                             |           3
                            /           x  + 1
                              0

> Q(6);
                                7  1/2
                          910 Pi  3
                          ------------
                              6561

> VERIF(6);
memory used=3.8MB, alloc=40.3MB, time=0.18
       7  1/2
9890 Pi  3       490    5  1/2
------------- + ----- Pi  3    Psi(1, 1/3)
   177147       19683

        490    5  1/2                10    3  1/2            2
     + ----- Pi  3    Psi(1, 2/3) + ---- Pi  3    Psi(1, 1/3)
       19683                        2187

        20   1/2   3
     + ---- 3    Pi  Psi(1, 2/3) Psi(1, 1/3)
       2187

        10    3  1/2            2    40                 4
     + ---- Pi  3    Psi(1, 2/3)  + ----- Psi(2, 2/3) Pi
       2187                         19683

        10   1/2               3
     + ---- 3    Pi Psi(1, 1/3)
       2187

       10               1/2               2
     + --- Psi(1, 2/3) 3    Pi Psi(1, 1/3)
       729

       10   1/2                           2
     + --- 3    Pi Psi(1, 1/3) Psi(1, 2/3)
       729

        10   1/2               3    40     4
     + ---- 3    Pi Psi(1, 2/3)  - ----- Pi  Psi(2, 1/3)
       2187                        19683

        20             2  1/2
     + ---- Psi(2, 2/3)  3    Pi
       6561

        40               1/2
     - ---- Psi(2, 2/3) 3    Psi(2, 1/3) Pi
       6561

        40    2
     + ---- Pi  Psi(2, 2/3) Psi(1, 1/3)
       2187

        40    2
     + ---- Pi  Psi(2, 2/3) Psi(1, 2/3)
       2187

        20   1/2            2
     + ---- 3    Psi(2, 1/3)  Pi
       6561

        40    2
     - ---- Pi  Psi(1, 1/3) Psi(2, 1/3)
       2187

        40    2
     - ---- Pi  Psi(1, 2/3) Psi(2, 1/3)
       2187

> evalf(Q(6));
                          725.5729634

> evalf(VERIF(6));
                          725.5729630

> quit
memory used=22.4MB, alloc=44.3MB, time=0.47
user@host:~/complex-logint$ math
Mathematica 10.0 for Linux x86 (64-bit)
Copyright 1988-2014 Wolfram Research, Inc.

In[1]:= Integrate[Log[z]^6/(1+z^3), {z, 0, Infinity}]

                7
          910 Pi
Out[1]= ------------
        2187 Sqrt[3]

In[2]:= N[Out[1]]

Out[2]= 725.573

In[3]:=
user@host:~/complex-logint$

My question for you all is what the appropriate techniques would be to get Maple to at least simplify the rather involved output from the integration engine to obtain a match of the closed form from the recursive equation.

Best regards, Marko Riedel.

cl-maple.txt

Hello Mapleprime users

I am having an issue with a numerical integration calculation. I have a large(ish) polynomial integrand and need to apply two integrations which I am using the _cuhre method for. See attached the minimum working example file.

Numerical_integration_HF.mw

Firstly some simplifications are done to the integrand and then a basic for loop which calculates the integration for r from 0 to 20 in steps of 0.1. The issue occurs when the loop hits r~2.5 (on my machine, Maple 2015, i5, 16GB ram). Up to that point the calculation is steady with the following stats per point calculated:

memory used=87.59MiB, alloc change=0 bytes, cpu time=3.45s, real time=3.15s, gc time=439.16ms


Then when the calculation gets to ~2.5 it just hangs and will not calculate past it. Any ideas as to what is going on here?

Any help would be appreciated with this issue.

Thank you in advance

Yeti

 

 

Hello,i cant solve this expression in maple,What is the integral result?

Thanks.

Hi, Maple community

I am trying to integrate a 3D data numerical set. I managed to execute an array interpolation algorithm and apply it to plot a smooth surface but I do not know how to integrate it numerically. I want to be able to integrate the data not only in its domain but also in sub-domains for multiple purposes.

I've found here a topic about it and tried to apply suggestions made with no success.

Here I copy the worksheet steps:

restart:
with(LinearAlgebra):
with(CurveFitting):
with(plots):

Initial Parameters

Nx:=8;    Points in the x direction
Nz:=6;    Points in the z direction
Lx:=3;    This means x goes from 0 to 3
Lz:=2;    This means z goes from 0 to 2
Delta[ze]:=evalf(Lz/(Nz-1));
Delta[xe]:=evalf(Lx/(Nx-1));

DataPn:=Matrix(Nx,Nz,0):         Matrix to store values in the 3rd direction

The following step is a function that I used to simulate data that I will later on will get by measurings.

for i from 1 to Nx do
 for j from 1 to Nz do
  DataPn[i,j]:=evalf(sin(Pi*(i-1)*Delta[xe]/Lx)*sin(Pi*(j-1)*Delta[ze]/Lz)):
 end do;
end do;

Setting data to use ArrayInterpolation

datax:=Array([seq((i-1)*Delta[xe],i=1..Nx)]);
dataz:=Array([seq((j-1)*Delta[ze],j=1..Nz)]);

In this step here, I don't really understand what this argument [[a],[b]] means but ArrayInterpolation cannot work without it.

MI:=(a,b)->ArrayInterpolation([datax, dataz],Array(DataPn),[[a],[b]],'method' = 'spline')[1,1];

Plot and display the interpolation and the real function to compare the quality of the interpolation, actually it does an excellent job, at least with this data.

G1:=plot3d(MI, datax[1]..datax[Nx], dataz[1]..dataz[Nz],labels=[x,z,Pn]);
G2:=plot3d(evalf(sin(Pi*x/Lx)*sin(Pi*z/Lz)),x=0..3,z=0..2,color=red);
display(G1,G2);

And finally I found this integration method here in mapleprimes

evalf(Int(x->evalf(Int( y->MI(x,y), 0..3,method=_d01akc)),0..2,method=_d01akc));

And the result is 1.102279199. I thought maybe I was setting wrongly the integration limits or the order in the command but in any case the result was near the analytic case which was:

int(evalf(sin(Pi*x/Lx)*sin(Pi*z/Lz)),x=0..3,z=0..2);

2.431708408

In this scenario I know the result is wrong because I can compute the exact solution, but later on I won't be able to do so. Also, later I'm interested in the integration, let's say, x from 0..0.5 and later from 0.5..1 and so on (keeping z always from 0 to 2) So, the main questions are:

1. Am I setting something wrong?
2. If I delete the method option in the integral, it takes a lot of time for the program to compute any result. Why?
3. Is there any other way to integrate this? I mean, any other way to write the command to compute the integral.
4. What does the [[a],[b]] argument stands for in ArrayInterpolation?

Regards and thanks for your help.

Hello Everyone

 

I have an expression which I would like to integrate from x=0 to x=L. The expression is 

x1:=(sin(beta*x)*cos(m*Pi*x/L))/(1+alpha*x)

 

Here, beta, m, alpha are constant. However I want the result in terms of these quantities.

 

I will be grateful if you could help mw in this regard.

Thanks a lot.

Dear all,

I have somme difficulties to calculate this integral.

int(I*sqrt((R*exp(I*theta)+1)/(R*exp(I*theta)-a)), theta = 0 .. Pi);

Thanks

I have the following integration:

 

Int(c-sqrt(a+b*(v*x+u)^2), x = -(b*u+sqrt(b*c^2-a*b))/(b*v) .. (-b*u+sqrt(b*c^2-a*b))/(b*v));

This integration is equivalent to the following integration (between dashed lines):

-----------------------------

NumericEventHandler(invalid_operation = `Heaviside/EventHandler`(value_at_zero = 1)):

Heaviside(0)

Heaviside(x) = convert(Heaviside(x), piecewise)

Int(Heaviside(x+(b*u+sqrt(b*c^2-a*b))/(b*v))*(c-sqrt(a+b*(v*x+u)^2)), x = -infinity .. (-b*u+sqrt(b*c^2-a*b))/(b*v));

-----------------------------

In this form the function, which is to be integrated, is taken as equal to zero for x < -(b*u+sqrt(b*c^2-a*b))/(b*v).

Now I want to write a form such that the function is also taken as equal to zero for x > (-b*u+sqrt(b*c^2-a*b))/(b*v).

How should I do this? Can this also be done with Heaviside?

Hello people in mapleprimes,

 

I cannot obtain a proper result from the following code.

a:=int(((beta/beta[1,2])^(-theta/(1-theta))-kappa[1]^(-theta/(1-theta)))*m*beta^(m-1),beta=0 .. kappa[1]*beta[1,2]);

 

Please tell me if you know how to have maple calculate it.

 

Thanks in advance.

 

taro

Doing the following:

Why is int used when defining F not evaluated to x^2/2 when used to defined function F as shown in (2), when the int is evaluated when used separately in (3)?

1 2 3 4 5 6 7 Last Page 1 of 13