Items tagged with integration integration Tagged Items Feed

Hello everyone,

I'm using Maple18, I tried to integrate the function including natural logarithm:

 

But we get the answer:

Is there any simple way to directly convert the answer to the kind of form we want? I cannot not finish the conversion:

 

So the toolbox "IntegrationTools" was used, but finally, we couldn't compute the integral:

 

 However, we can get the correct answer by manually inputting the formula.

 

Using IntegrationTools is pretty nasty and not very convenient, such as the problem I mentioned.

Does anyone have another solution?

The problem is The square root of 16-x^2 over the interval [0,-4]  0 being the upper bound, -4 being the lower bound.  I have solved 3/4s of this problem but I don't understand what they mean by "Solve the definite integral exactly by geometry". 

test.mw

restart; with(LinearAlgebra)

``

dF := -.525*exp(-7*t)+2.625*exp(-3*t)+.8*exp(-4*t);

-.525*exp(-7*t)+2.625*exp(-3*t)+.8*exp(-4*t)

(1)

``

e3 := `<,>`(1, 1, 1); E := proc (m) options operator, arrow; IdentityMatrix(m) end proc; beta := `<|>`(.1, .6, .3); S := `<|>`(`<,>`(-3, 1, 1), `<,>`(1, -5, 2), `<,>`(0, 2, -4)); S0 := -S.e3

beta := Vector[row](3, {(1) = .1, (2) = .6, (3) = .3})

 

S := Matrix(3, 3, {(1, 1) = -3, (1, 2) = 1, (1, 3) = 0, (2, 1) = 1, (2, 2) = -5, (2, 3) = 2, (3, 1) = 1, (3, 2) = 2, (3, 3) = -4})

 

S0 := Vector(3, {(1) = 2, (2) = 2, (3) = 1})

(2)

Z := `<|>`(x, y, z)

Z := Vector[row](3, {(1) = x, (2) = y, (3) = z})

(3)

ME := MatrixExponential(S+Typesetting:-delayDotProduct(S0, Z), t);

`[Length of output exceeds limit of 1000000]`

(4)

MEint := map(int, ME.dF, t = 0 .. infinity)

Error, (in int) wrong number (or type) of arguments: wrong type of integrand passed to definite integration.

 

`&beta;plus&Assign;solve`(Z = beta.MEint, Z)

"(RTABLE(18446744074195006390,VECTOR([x, y, z]),Vector[row])=RTABLE(18446744074193876574,VECTOR([.1, .6, .3]),Vector[row]).MEint) betaplus:=solve (RTABLE(18446744074195006390,VECTOR([x, y, z]),Vector[row]))"

(5)

``

1step- I want to integrate the (ME*dF) from t=0 to ∞ .

2step- Evaluate Z=<x,y,z> by solving Z=β*MEint.

Download test.mw

I have updated  Maple from 18.01 to 18.02, but there is something strange happened to me. I can not use int anymore. Here is my codes:

restart;
int(sin(x),x);
Error, (in int) wrong number (or type) of arguments: invalid option value passed to indefinite integration: {}

kernelopts(version);
print(`output redirected...`); # input placeholder
    Maple 18.00, X86 64 LINUX, Feb 10 2014, Build ID 922027

 

Here is the screenshot:

A customer on Twitter recently asked why Maple gives the following result:

 

 


The issue here is that the t in f(t) is the same as the integration variable. 140 characters is not a lot to work with for a reply, so here is a longer explanation.

 

First, note that the process of integration treats the integration variable differently than the other variables, so that replacing another variable by the integration variable has a different effect depending on whether the replacement is done before or after the integration is performed. Consider this simple example:

 

a := int(t, t)

(1/2)*t^2

(4)

eval(a, t = x)

(1/2)*x^2

(5)

a := int(x, t)

x*t

(6)

   

eval(a, t = x)

x^2

(7)

 

In other words, integration does not commute with substitution. This is a fundamental property of integration and in fact, Maple's eval has special rules to take this into account when you ask it to replace the integration variable.  For example, if you evaluate the inert form of the integral at x = y, the substitution is performed explicitly:

 

 

eval(Int(x-t, t = 0 .. x), x = y)

Int(y-t, t = 0 .. y)

(8)

value(Int(y-t, t = 0 .. y))

(1/2)*y^2

(9)

 

However, if you try to evaluate at x = t, the evaluation is delayed until after the integral is evaluated:

 

eval(Int(x-t, t = 0 .. x), x = t)

eval(Int(x-t, t = 0 .. x), {x = t})

(10)

 

value(eval(Int(x-t, t = 0 .. x), {x = t}))

(1/2)*t^2

(11)

 

The eval command knows it shouldn't substitute into an integral when the substitution involves the variable of integration.

 

However, in the user's example, asking Maple for f(t) is equivalent to substitution directly before the integration is performed, like this:

 

subs(x = t, Int(x-t, t = 0 .. x))

Int(0, t = 0 .. t)

(12)

which of course gives:

 

value(%)

0

(13)

 

Another way to have the two t variables be considered distinct is to explicitly make the integration variable a dummy by declaring it local:

 

f := proc (x) local t; int(x-t, t = 0 .. x) end proc
 

Now the ts are treated differently:

 

f(t)

(1/2)*t^2

(14)

``

Austin Roche

Senior Math Developer

Maplesoft

 

Download integration_variables.mw

int(int(y, 0 <= y, x^2+y^2+z^2 <= 1));

Error, (in int) integration range or variable must be specified in the second argument, got 0 <= y

int(int(y, y = 0, x^2+y^2+z^2 = 1));

Error, (in int) integration range or variable must be specified in the second argument, got y = 0

Hi,

I have been trying to solve 2D Diffusion Equation with zero Neumann BC over the unit disk. If I use Gaussian type function with a sharp peak as initial condition, I get huge errors between initial values. Let's say u(r,phi,t) is the solution of the PDE and f(r,phi) is initial value function. The expectation is for the point (r*,phi*) ,  u(r*,phi*,0)=f(r*,phi*), but it is not.

Is Numerical integration in Maple not able to handle such sharp peak? I tried some of the built-in methods such as MonteCarlo,CubaVegas but no difference.

It might be a good idea to specify some nodes arround the peak. There is a command called "peaks", but I could not use it, error message says "invalid arguments".

Thanks in advance.

Soln_2D_Gaussian.mw

I have an integral that maple can not solve but I can solve it by hand. How can I add this to maple integration database?

f:=int(r^2*BesselJ(0,a*r)*BesselI(1,b*r),r)

Please see the file below.

Integral.mw

 

Many many thanks! :)

I have a complicated equation which you can find in the file below. I want to multiply both sides of equaiton by cos(beta[1,j__1]*z) and integrate from 1 to L. I have many such similar equations so I decided to write a procedure to do these staffs for me.

Can you give me simple suggestions on how to write such a procedure. The procedure will take the "equation", "multiplier" and "limits of integration" as inputs and gives the "integrated equation" as the output. Integration is perfomed by the inert function "Int".

Many thanks.

Equation.mw

i have the following equation:

1.003225155^(l)-((&int;)[0]^1[((((0.6 r^2+1)^1.813666667)/((0.375 r^2+1)^2.666666667))^())^(l)r &DifferentialD;r)=0

 

and throws me the error:

Error, Got internal error in unknown : "invalid input: lhs received sattr, which is not valid for its 1st argument, expr"

 

do  you know the meaning of the error and why this equation cant be solved for l?

hello

we have an exam next week and I want to know

how I can write (fordo) in maple for numerical integration

in different methods such as trapezoid , newton cotes and so on.

thanks

Please I want to know how to solve this integration.

 

int(exp(-(ln(y)-2*sigma^2)^2/(8*sigma^2))/(y*sqrt(8*Pi*sigma^2))*exp(-(ln(y+z)-2*sigma^2)^2/(8*sigma^2))/((y+z)*sqrt(8*Pi*sigma^2)), y = 0 .. infinity)

int((1-r^3+3*r^2-3*r)(r^3-3*r^2+3*r), r = 0 .. 1);
print(`output redirected...`); # input placeholder
/ 3 2
| / 3 2 \ / 3 2 \
int\-r\r - 3 r + 3 r/ + 3 r\r - 3 r + 3 r/

\
/ 3 2 \ |
- 3 r\r - 3 r + 3 r/ + 1, r = 0 .. 1/

Hi All,

I would like to request information the representation of the following result from Mathematica :

Mathematica result:    MeijerG[{{0, 1/2}, {}}, {{0, 1}, {-1, -1}}, a, 1/2]

Maple is able to take: MeijerG[{{0, 1/2}, {}}, {{0, 1}, {-1, -1}}, a] which is represented as
                                MeijerG([[0, 1/2], []], [[0, 1], [-1, -1]], a)

Could you please advise me on how to implement this function in maple. I would be grateful if you also include matlab in the discussion.

The matiematica output is a result of the following integration:

Integrate[r*(BesselI[1, al*r]* BesselK[1, al*r]), r]

 

Looking forward to your reply. Thanks in advance.

Regards

Raj

Dear all,

I am trying to use Maple for Finite Element calculations. I have a 2d setup with linear basis functions and a 2d gaussian kernel that can rotate with respect to the axes. Attached please find the work sheet I am using.

Basis_function:

B := (x1,y1,x,y) -> max(0, 1-abs(x-x1))*max(0, 1-abs(y-y1))

transmissibility function:

t_hat:= (x1,y1,x,y) -> A*exp(-a*(x-x1)^2-2*b*(x-x1)*(y-y1)-c*(y-y1)^2)

where A  and a,b,c are positive constants. a,b,c are calculated based on an angle phi and the two variances of the gaussian function.

I want to calculate the following function for different points (x1,y1) , (x2,y2):

trans := (x1, y1, x2, y2) -> int(int(B(x1, y1, xz, yz)*(int(int(t_hat(xz, yz, xp, yp)*(B(x2, y2, xz, yz)-B(x2, y2, xp, yp)), xp = x2-10*sigma1 .. x2+10*sigma1), yp = y2-10*sigma2 .. y2+10*sigma2)), xz = x1-hx .. x1+hx), yz = y1-hy .. y1+hy);

this integral in the form that is in the work sheet, works well for phi=0 and the results are what I want (numbers that go to zero as we move points 1 and 2 away from each other). for other values for phi it either gives an error (too many levels of recursion) or it returns expressions that seem unreasonable when I evaluate them (they don't go to zero).

for example, it doesn't work for phi = 0.5 at all. for phi = Pi/4 it will calculate some expression,

but as you move away from a point (e.g. trans(0,0,100,100)) the value does not become smaller than a certain value, but they should go to zero.

It seems that what I am trying to do is very sensitive to a,b,c, but actually it shouldn't be so different. I like to avoid exact integration, and just get a number, but I have no idea how to do this numerically. and I don't know how to write the problem in a way that would work for every angle phi.

any ideas?

thanks in advace,2d_maple_primes.mw

with(plots); with(LinearAlgebra); with(ArrayTools)

``

Transmissibility function specifications

alpha := 1;

1

 

4

 

1

 

(1/4)*Pi

(1)

 

a := (1/2)*(cos(phi)/sigma1)^2+(1/2)*(sin(phi)/sigma2)^2;

17/64

 

15/64

 

17/64

 

A = (1/8)/Pi

(2)

 

 

Transmissibility*Kernel

t_hat := proc (x1, y1, x, y) options operator, arrow; A*exp(-a*(x-x1)^2-2*b*(x-x1)*(y-y1)-c*(y-y1)^2) end proc

proc (x1, y1, x, y) options operator, arrow; A*exp(-a*(x-x1)^2-2*b*(x-x1)*(y-y1)-c*(y-y1)^2) end proc

(3)

B := proc (a, b, x, y) options operator, arrow; max(0, 1-abs(x-a))*max(0, 1-abs(y-b)) end proc

proc (a, b, x, y) options operator, arrow; max(0, 1-abs(x-a))*max(0, 1-abs(y-b)) end proc

(4)

trans := proc (x1, y1, x2, y2) options operator, arrow; int(int(B(x1, y1, xz, yz)*(int(int(t_hat(xz, yz, xp, yp)*(B(x2, y2, xz, yz)-B(x2, y2, xp, yp)), xp = x2-10*sigma1 .. x2+10*sigma1), yp = y2-10*sigma2 .. y2+10*sigma2)), xz = x1-hx .. x1+hx), yz = y1-hy .. y1+hy) end proc

proc (x1, y1, x2, y2) options operator, arrow; int(int(B(x1, y1, xz, yz)*(int(int(t_hat(xz, yz, xp, yp)*(B(x2, y2, xz, yz)-B(x2, y2, xp, yp)), xp = x2-10*sigma1 .. x2+10*sigma1), yp = y2-10*sigma2 .. y2+10*sigma2)), xz = x1-hx .. x1+hx), yz = y1-hy .. y1+hy) end proc

(5)

 

#####testing here######

#for phi == 0 the results are what i want, numbers that go to zero as the points go far from each other. for phi != 0 trans returns an expression and the evaluation of that expression doesn't go to zero as we move the points far apart.

NULL

trans(0, 0, 0, 1)

trans(0, 0, 1, 0)

trans(0, 0, 5, 5)

``

This should be zero for any angle

trans(0, 0, 50, 50)

 

 

 

``


Download 2d_maple_primes.mw

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