Items tagged with integral integral Tagged Items Feed

I use Maple 15 to calculate some (nasty) integrals at my university. Because our university also offers a server on which I can run my Maple program, I would like to do that. (instead of occupying a workspace). But at the computer on my workspace the integrals are evaluated fine, but on the server the integrals are just returned with no numerical evaluation.

I constructed a MWE to look where it goes wrong. I set the printlevel to 25 so I could see what was going on. The MWE was suprisingly simple, on both machines (via ssh) I executed within maple:

evalf(Int(1/sqrt(x), x=0..2))

This of course would normally just give 2*sqrt(2). On my workplace-pc it worked fine and it found 2.828427125. The server just returned the integral. After looking at the steps, they where both exactly the same until the following part:

Workplace-PC:

         General_flags := {_NoNAG, _DEFAULT, _NoMultiple}

            NAG_methods := {_d01ajc, _d01akc, _d01amc}

                        Method := _DEFAULT

                          HFDigits := 15

                                       -12
                        HFeps := 0.1 10

                                            -9
                    HFeps := 0.5000000000 10

   oldEvents := overflow = default, division_by_zero = default

                         callNAG := true

                            fcns := {}

                  result := 2.82842712474618807

Server:

        General_flags := {_NoNAG, _DEFAULT, _NoMultiple}

           NAG_methods := {_d01ajc, _d01akc, _d01amc}

                       Method := _DEFAULT

                         HFDigits := 15

                                      -12
                       HFeps := 0.1 10

                                           -9
                   HFeps := 0.5000000000 10

   oldEvents := overflow = default, division_by_zero = default

                         callNAG := true

                           fcns := {}

       overflow = exception, division_by_zero = exception

It seems that the server has a problem with the singularity and thus throwing an exception, but I just don't get why. The Maple-versions are both the same.

Does somebody know what this could be?

Dear community,

The VectorCalculus package in Maple 18 exhibits some rather odd behaviour when calculating an integral over a 3D-domain (an elipsoid centered at (0,0,1) with length of semi-axes 2, 2, and 1) given by a 'Region'. It also reports an incorrect result when calculating the flux of a vector field through the surface of this ellipsoid.

See below for a minimal working example:

 

// integrate several functions over ellipsoid

int(2*x+2*y, [x, y, z] = Region(-2 .. 2, -sqrt(-x^2+4) .. sqrt(-x^2+4), -sqrt(1-(1/4)*x^2-(1/4)*y^2)+1 .. sqrt(1-(1/4)*x^2-(1/4)*y^2)+1));    ---- output: 0

int(2*z, [x, y, z] = Region(-2 .. 2, -sqrt(-x^2+4) .. sqrt(-x^2+4), -sqrt(1-(1/4)*x^2-(1/4)*y^2)+1 .. sqrt(1-(1/4)*x^2-(1/4)*y^2)+1));    ---- output: 32*Pi/3

int(2*x+2*y+2*z, [x, y, z] = Region(-2 .. 2, -sqrt(-x^2+4) .. sqrt(-x^2+4), -sqrt(1-(1/4)*x^2-(1/4)*y^2)+1 .. sqrt(1-(1/4)*x^2-(1/4)*y^2)+1));    ---- output: -32*Pi/3

 

Why does the integral change sign?

 

// Calculate flux of vector field over surface of ellipsoid

F2 := VectorField(`<,>`(x^2, y^2, z^2));

S2 := Surface(`<,>`(2*sin(t)*cos(s), 2*sin(t)*sin(s), 1+cos(t)), s = 0 .. 2*Pi, t = 0 .. Pi);

Flux(F2, S2, 'outward');   ---- output: -32*Pi/3

 

However, since 'z' is positive over the entire ellipsoid, by the Divergence Theorem we know the result should be positive (in fact, equal to +32*Pi/3). Changing 'outward' to 'inward' does not change the sign, by the way.

 

Is this a bug inside the VectorCalculus package which appears more often, or have I done something wrong?

Thank you for responding and apologies if a similar question has already been answered in another thread.

Best wishes,

QQ

of the improper integral of exp((1-x)/((1-x)^2+y^2)) over the unit disk x^2+y^2 <= 1 with Maple? For purists the function is assumed to be undefined at (1,0). It is not so difficult to verify that statement  by hand. It is not easy to prove that with Maple.

My try was

f := evalc(exp(Re(1/(1-x-I*y))));


VectorCalculus:-int(f, [x, y] = Circle(`<,>`(0, 0), 1), numeric);

and

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

Edit. The formula for f.                  

PS.

 

 

 

Hello everyone,

 

I am working on a program in Maple and got stuck in exchanging limits for integrals. For example, if I have an expression of following type.

Eq:=4*Int(f(x), x=0..1/3)+Int(x*f(x), x=0..2/3);

I want to convert it in to an expression of form

4*Int(f(x),x=0..x)-4*Int(y,x=1/3..x)+ Int(x*f(x), x=0..x)- Int(x*f(x), x=2/3..x)


In short, I want to split both the integral at x but flip in limits in the second integral. I tried as follows which did not work

applyrule(Int(f::anything,y=c::numeric..d::numeric)=Int(f,y=c..x)-Int(f,y=c..x), Eq)

Please, help me!

Thank you for your time.

hello i need plot integrale of siampson thank you

> Simpson := proc(f, a, b, n)
> local h, S1, S2, S, i;
> h := (b-a)/n;
> S1 := 0.0;
> for i from 0 to n-1 do
> S1 := S1 + f(a + (2*i+1)*h);
> end do;
> S2 := 0.0;
> for i from 1 to n-1 do
> S2 := S2 + f(a + (2*i)*h);
> end do;
> S := (h/3) * ( f(a)+f(b) + 4*S1 + 2*S2 );
> return S;
> end proc:
> Digits := 5;

                             Digits := 5

> f := x -> 1/sqrt(39.24*x-44.65*(x*arccos(x)-sqrt(1-x^2)-13.88*(1-x^2)^1.5));

  f := x -> 1/sqrt(39.24 x

                                          2                2 1.5
         - 44.65 (x arccos(x) - sqrt(1 - x ) - 13.88 (1 - x )   ))

> Simpson(f, 0, 1, 100):
>
> p:=int(f(x), x=0..0.1);

                            p := 0.0038931

> w:=int(f(x), x=0.1..0.2);

                            w := 0.0039570

> m:=int(f(x), x=0.2..0.3);

                            m := 0.0040826

> l:=int(f(x), x=0.3..0.4);

                            l := 0.0042836

> kohv:=int(f(x), x=0.4..0.5);

                          kohv := 0.0045860

> q:=int(f(x), x=0.5..0.6);

                            q := 0.0050373

> s:=int(f(x), x=0.6..0.7);

                            s := 0.0057306

> d:=int(f(x), x=0.8..0.9);

                            d := 0.0089874

> f:=int(f(x), x=0.9..1);

                            f := 0.013349

I am trying to numerically double integrate x^2+sqrt(y), with the bounds y=0..x and x=1..1.5.

Then I tried the following code:

 

int(int(x^2+sqrt(y),method=trapezoid,y=0..x),method=trapezoid,x=1..1.5);

 

I know how to write the code if instead of a 'x' in my upper limit for my integral, I had a real number, but I'm not sure how to remedy to code in order make it work. Any help would be appreciated. Thanks!

 

I am trying to solve the Morrison equation for a normal force acting on a cylinder in a viscous fluid by using the potentional theory. With my limited experience in Maple I do not get why my dubble integral cannot be computed. Any help would be appreciated, tips are also very welkom as I am trying to expand my knowledge of Maple. 

I am facing a kind of strange problem. Whenever I enter Int(exp(-s t) t^2,t) and try to see full solution using Student[Calculus1]:-ShowSolution(), it gives empty square brackets [ ] as superscripts of e. If I restart Maple engine and perform the same, sometimes it produces right solution. Kindly help, what is this? Same integral does not give problem if done with parameter 'r' instead of 's'.

At the internet site of The Heun Project, a strong declaration is made that only Maple incorporates Heun functions, which arise in the solution of differential equations that are extremely important in physics, such as the solution of Schroedinger's equation for the hydrogen atom.  Indeed solutions appear in Heun functions, which are highly obscure and complicated to use because of their five or six arguments, but when one tries to convert them to another function, nothing seems to work.  For instance, if one inquires of FunctionAdvisor(display, HeunG), the resulting list contains

"The location of the "branch cuts" for HeunG are [sic, is] unknown ..." followed by several other "unknown" and an "unable". Such a solution of a differential equation is hollow.

Incidentally, Maple's treatment of integral equations is very weak -- only linear equations with simple solutions, although procedures by David Stoutemyer from 40 years ago are available to enhance this capability.

When can we expect these aspects of Maple to work properly, for applications in physics?

I've got the following double integral over a region A:

e^(1/x*y)/(y^2)*(x+1)^2 where A={(x,y):1/2<=x*y<=2,1<=x<=3}

to evaluate this:

I've tried :

int6:=int(int(e^(1/x*y)/((y^2)*(x+1)^2),x=1..3),y=(1/2)..(2/3));

since the largest lower bound and smallest upper bound for y based on 1/2<=xy<=2 are 1/2 and 2/3 respectively.

This statement however, only evaluates the inner integral; is my approach correct?

I want to solve a Laplace integral transform step-by-step its as follows:

 

f(t):=e^at

IntTutor(Int(e^-st f(t),t=0..infinity)

 

but it says that the expression can't be integrated, and secondly it does not work with 'infinity'. How I can solve this for step-by-step solution?

Thanxs

 

I had to use integration by parts to get the answer I need, but I do not think it is really needed for this. compare the output from:

r:=int(tan(x)^(n-2)*sec(x)^2,x);

(which is pages of very complicated output), with this:

r:=Int(tan(x)^(n-2)*sec(x)^2,x):
simplify(value(IntegrationTools:-Parts(r,tan(x))));

Does one really have to tell Maple to do integration by parts for this? I would have expected int() to do it as is.

Please compare to Mathematica:

Maple 18.02

added

The reason I think this should have been done by int() directly is that it is direct  application of the power rule of integration. I can't write Latex here, so I wrote it on my computer, and I copy the screen shot to explain for those interested:

Maple is so good in differential equations, but does not seem to be as good as it should when it comes to integration.

I solve numerically very simple boundary value problem for the following ordinary diff. equation:

-1.2*y''(t)+0.8*y(t)=2,

y(0)=1, y(1)=0.

So := dsolve([-1.2*diff(y(x), x$2)+0.8*y(x) = 2, y(0)=1, y(1)=0], y(x), 'numeric', 'output' = listprocedure);

Solution looks as needed

u := unapply(rhs(So[2])(x), x): plot(u(t), t=0 .. 1);
pic

and can be numerically integrated in usual way:

evalf(int(u(t), t = 0..1));

0.6041717543123311

But integral of u^2(t)  (evalf(int(u(t)^2, t = 0..1))) returns:

pic1

How to avoid this issue?

In Maple help on int, it says

"If Maple cannot find a closed form expression for the integral, the function call itself is returned"

But then, what is the correct way to check for this in the code? How do I know that the result returned is the call I made? (it would have been easier if these functions throw an error, or set some status code that one can check for success or failure).

Hello everybody,

I am working on a somewhat complicated analytical problem, which includes the evaluation of the following (finite and singularity free) double integral (the stated numerical parameters may vary):

Int(exp(18.1818*(Int((0.579160e-1*sqrt(x)*Ei(1., 0.500000e-4*x)+(1072.23*(.999950-1.*exp(-0.500000e-4*x)))/sqrt(x))/sqrt(x), x = 1. .. eta))-9.10000*eta)/eta, eta = 1. .. 100.)

There are no unevaluated variables inside (all the e's are real exp()s). However, when putting it through evalf(), Maple returns it (after calculating for some time) unevaluated. I have no idea why, as a simple box sum should succeed.

Any input would be appreciated. Best regards,

  K. Reuther

 

P.S.: Raw expression for further deliberations

Int(exp(18.1818*(Int((0.579160e-1*sqrt(x)*Ei(1., 0.500000e-4*x)+(1072.23*(.999950-1.*exp(-0.500000e-4*x)))/sqrt(x))/sqrt(x), x = 1. .. eta))-9.10000*eta)/eta, eta = 1. .. 100.)

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