Items tagged with evalf


Hi all

I have a mathematical problem and I asked it in various sites but the answers till yet are not correct.

Assume that we have:

b[n,m]:=unapply(piecewise(t>=(n-1)*tj/N and t<n*tj/N, T[m](N*t-(n-1)*tj), 0), t):

where n,N,tj are known constants. furthermore assume that we want to comute the following integral:

for following approximations:

I have written the following code but it seems to be incorrect:


the original program is :


I will be so grateful if any one can help me to solve it by maple

Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department

my codes list below.note the last line of the codes.evalf is not effective? the output is a long expression. how to force the maple to evaluate the long expression into a numeric value?


 ALL := [`$`(1 .. 3)]:
 solution_k := simplify(solve(map(proc (i) options operator, arrow:
 1/k[i] = (cos(Phi)*(x[i]-Tx)+sin(Phi)*(y[i]-Ty))/(-sin(Phi)*(x[i]-Tx)+cos(Phi)*(y[i]-Ty)) end proc, ALL), [Tx, Ty, Phi]), size):
 k := map(proc (i) options operator, arrow:
 tan(phi[i]) end proc, ALL):
 deg2rad := Tolerances:-`*`(Pi, Tolerances:-`^`(180, Tolerances:-`-`(1))):
 phi0[1] := Tolerances:-`*`(Pi, Tolerances:-`^`(3, Tolerances:-`-`(1))):
 phi0[2] := Pi:
 phi0[3] := Tolerances:-`-`(Tolerances:-`*`(Pi, Tolerances:-`^`(3, Tolerances:-`-`(1)))):
 alpha := Tolerances:-`*`(Pi, Tolerances:-`^`(10, Tolerances:-`-`(1))):
 L := 1:
 phi := phi0:
 x := map(proc (i) options operator, arrow:
 cos(phi0[i]+alpha)*L end proc, ALL):
 y := map(proc (i) options operator, arrow:
 sin(phi0[i]+alpha)*L end proc, ALL):
 angleError := Tolerances:-`&+-`(0, Tolerances:-`^`(10, -4)):
 locError := Tolerances:-`&+-`(0, Tolerances:-`^`(10, -4)):
 phi := map(proc (i) options operator, arrow:
 phi[i]+angleError end proc, ALL):
 x := map(proc (i) options operator, arrow:
 x[i]+locError end proc, ALL):
 y := map(proc (i) options operator, arrow:
 y[i]+locError end proc, ALL):



I would like to tell Maple to evaluate all numbers in an expression using floating point numbers (of a desired precision). Short example:




while I want it to print 


Note that the real expression may be arbitrarily complicated. I know that it is possible easily because I have already seen this somewhere, but I don't remember it. 

If i use expression with function add() it runs normaly, but if I use expression with Threads:-Add (parallel implementation) it causes error "Error, continuation task already created for the current task" or "Kernel connection has been lost"


Array(1 .. N,1 .. 1/2*N-NR-1,(i, m) -> evalf(Add(cosArr2[modp(k*i,N)]/kl[k],k = 1 .. NR+m-1)+Add(cosArr2[modp(k*i,N)]*alpha[k],k = NR+m .. 1/2*N)))


What am I doing wrong? Can I use two Add in one evalf?

The following limit does not return a value. Then the evalf gives a wrong answer.

The answer should be "undefined" or -infinity .. infinity.

limit(exp(n)/(-1)^n, n = infinity) assuming n::posint; evalf(%);

                       /exp(n)              \
                  limit|------, n = infinity|
                       |    n               |
                       \(-1)                /


The same happens if you delete the assumption.


A similar problem occurs with

limit(sin(Pi/2+2*Pi*n), n = infinity) assuming n::posint;
                            -1 .. 1
without the assumption this would be appropriate.

I was looking at a question on another forum, and tried in Maple also, and Maple also have a problem with this integral. Here is a simple version. The problem is that int() gives different numerical answer from evalf(Int). Maple can't solve this analytically, so values have to be used for the integrand before calling int()

eq2:=(a/(a + c*z))^L*exp(-z)/sqrt(z);

int(eq2,z=0..infinity);   # 177.245
evalf(Int(eq2,z=0..infinity));   # 1.7551

I think the 1.7551 is the correct value. My question is: Why did maple give wrong answer from int()? Is it analytical reason, or purely numerical?

Maple 17.02, windows 7.

Hi everyone. Long time reader, first time poster.

I have a rather nasty function that I need to use in various calculations (namely, one of them is a numerical integration). But, even evaluating this function at a given point takes exceedingly long (several seconds to tens, maybe even hundreds of seconds!). Is there any way I can make maple do all of the calculations numerically instead of doing all but the last evalf symbolically? I think that may be the problem. Anyway, here is my defined function:

How do I do to get a single number (decimal) when I evaluate an input.


For example, I write this:

evalf((546, 1/1000000000)*(7, 0)*sqrt(36+1/(7, 0)^2));

but I still get the same thing as I inputed as a response, how do I do to get an actual number?


Can somebody explain me this:

 I want to calculate successive roots of the following complex eq.

how can I set interval (?) for fsolve in the following code:

Why won't evalf give me a number.  I have solved for a variable "iDS" higher up in my sheet, and want the approximate value of an element in a matrix.  this element is a function of iDS and no matter what I do, I get the function of iDS!

I really want to use Maple.  I see what it can do, but I often get "stuck" and very frustrated when I can't get it to do what I need it to do.  Sometimes when you are doing assignments, you need a number!


Quite often, the result Maple gives involves exponents.

For example:


When I use "evalf", "simplify", or right-click and select "approximate," I always obtain a fraction with e^13/50. How an I get a numerical approximation!



when I use s:=evalf(...), maple give me reasonable results but when I use s1:=evalf(...) for the same problem the results are different from previous case!

Can you help me, please?

I have run into some queer behaviour of my Maple 9 software. I gave the following commands:

 xx := invcfrac([[0],[5,1,5,1,4,1]]);

An example:



Two digits lost.

And here is even worse:



Correct unswer:



The correct answer

1 2 3 4 5 Page 3 of 5