frasga

40 Reputation

One Badge

6 years, 258 days

MaplePrimes Activity


These are questions asked by frasga

I am trying to find the minimum of a function TF defined by a procedure over an interval. The function depends on variable x and fixed parameters x0, L, k, alpha_0, alpha_L. Here is the function

TF := proc(x, x0, L, k, alpha_0, alpha_L) if x0 <= x then evalc(abs(cos(k*(x - L) - alpha_L)*cos(k*x0 + alpha_0)/(cos(alpha_L)*cos(k*x0 + alpha_0)))); else evalc(abs(cos(k*(x0 - L) - alpha_L)*cos(k*x + alpha_0)/(cos(alpha_L)*cos(k*x0 + alpha_0)))); end if; end proc;

When I use

Minimize('TF'(x, 0, 0.03, 55.11566060, Pi/2, Pi/4), x = 0 .. 0.03);

I get an error "Error, (in Optimization:-NLPSolve) cannot determine if this expression is true or false: 0 <= x". What is my mistake ?

Thanks.

I am trying to calculate numerically a triple integral of a function (see below). However I could not get a result. I stopped the calculation after one hour of evaluation. One of the integral is from 0 to infinity and uses NAG d01amc. The 2 other integrals have finite bounds and use NAG _d01ajc. I also tried to use maple default integration algorithms for the 2 finite bounds integrals but without success. in the following xs, ys, zs, k, k_0, x, y, rho_0 and d are real numbers. k_m, rho_me, nu_m are complex numbers. The variable sof integration are k (from 0 to +infinity), x (from -1 to +1) and y (from -1.5 to 1.5). Here is the Maple script. restart; Digits := 15; nu_0 := sqrt(k^2 - k_0^2); nu_m := sqrt(k^2 - k_m^2); pref2 := 2*rho_me*exp(-nu_0*(zs + z))*BesselJ(0, k*sqrt((xs - x)^2 + (ys - y)^2))*k/(rho_me*nu_0 + rho_0*nu_m*tanh(nu_m*d)); (evalf@Int)(eval(0.5*Re(`~`[evalf@Int]((Re + Im*I)(eval(pref2, [z = 0, k_0 = 0.018371886863098, xs = 0, ys = 0, zs = 10, rho_0 = 1.2, d = 0.04, rho_me = 1.528516816439260 - 1235.297048886680*I, k_m = 0.490806242885258 - 0.490314205803914*I])), k = 0 .. infinity, epsilon = 0.1*10^(-5), method = _d01amc)), [z = 0, k_0 = 0.018371886863098, xs = 0, ys = 0, zs = 10, rho_0 = 1.2, d = 0.04, rho_me = 1.528516816439260 - 1235.297048886680*I, k_m = 0.490806242885258 - 0.490314205803914*I]), [x = -2/2 .. 2/2, y = -3/2 .. 3/2], epsilon = 0.1*10^(-5), method = _d01ajc); Thanks for the help.

I want to calculate the numerical value of the following integral at a given (r,z) where r and z are real numbers:

g(r,z)=int(exp(-sqrt(k^2 - k0^2)*z)*BesselJ(0, k*r)*k/sqrt(k^2 - k0^2), k = 0 .. infinity) where k0 is a real number.

In other words, it is the hankel transform g(r,z) of the function f(k):

f(k)=exp(-sqrt(k^2 - k0^2)*z)/sqrt(k^2 - k0^2)

The theoretical result is exp(-I*k0*R)/R with R=sqrt(r^2+z^2)

I tried to use the commande evalf(Int(exp(-sqrt(k^2 - k0^2)*z)*BesselJ(0, k*r)*k/sqrt(k^2 - k0^2), k = 0 .. infinity)) but it takes hours to evaluate and I did not get any results yet. I tried to calculate this integral with another software which uses a vectorized adaptive quadrature algorithm and I got the result in a few seconds.

How could I calculate this integral with Maple ?

Thanks.

Page 1 of 1