Items tagged with evaluation evaluation Tagged Items Feed

Hello everyone,

I'm working on a simulation for standing wave to prove that the combination of 2 waves in opposite direction can create standing wave. So I use these:

> restart;
> with(plots):
> W1:=A*cos(omega*t-k*x);

> W2:=A*cos(omega*t+k*x);

> W:=W1+W2;

> SW:=(A,omega,k)->animate(plot,[{W1,W2,W},x=-4..4,y=-4..4,color=[red,green,blue],scaling=constrained],t=0..5,frames=10);

> display(SW(2,2*Pi,5),insequence);

It did work if SW is a function with one variable, now I need 3 variables (A,omega,k);

It said: "Plotting error, empty plot"

Please show me my mistake or an another method. Thank you

I have this matrix


uA := Matrix([[-w^2+x^2+y^2-z^2, -2*(w*y+x*z), 2*(-w*x+y*z)], [2*(-w*y+x*z), w^2+x^2-y^2-z^2, -2*(w*z+x*y)], [2*(w*x+y*z), 2*(-w*z+x*y), -w^2+x^2-y^2+z^2]])

and I would like to evaluate the variables like this


x = -x, y = -y, z = -z, w = -w

I tried this

Eval(uA, x = -x, y = -y, z = -z, w = -w)

but it didnt work.


Any suggestions??


Thank you so much



Hi!! i am working on assignment.

h:= x-> (x^17-x*sin(x^16))/x^49+exp(sqrt(x+8))*ln(abs((cos^4*(x)-5)));


i want to find the value of the h(10)

i use eval , but it comes out a function, not a solution.!!

I have been here before...  My head is full of cotton, as usual.


f := proc (t) 2*t^3+9*t^2-60*t+1 end proc;
df := t->deq;  ## this is most likely one of my problems.
isneg := x -> if is(df(x) < 0) then df(x) else 0 end if;  ## and, another??

The if statement is not fully evauated.

I am missing something.  What?

Tom Dean

Hi everyone,

I have a great problem with the evaluation of following definite integral

> restart;

> int((t-x)^2)/(1+2t+(1/2)t^2-ln(t^2+2t+2)t-ln(t^2+2t+2)+arctan(1+t)t^2+2arctan(1+t)t+ln(2)t+ln(2)-(pi/4)t^2-(pi/2)t)^2,t=0..x)

I have tried different classical commands but Maple doesn't give an answer. Probably, it's just a silly fault.

Does anyone knows how to solve it?


I have this (which finds each Fourier term of a sequence)

term := proc(lst,k::integer)
    local n;
    n := nops(lst);     
    seq(lst[m+1]*exp(-I * 2*Pi/n *(k*m)),m=0..n-1);
end proc;

Now I call it as


and it returns

So it evaluated and convert the exp(-I * 2*Pi/n *(k*m)) terms. I wanted to keep these as is, so I can compare result with textbook. Then do simplify if I wanted to above output. 

I can do that if I use small pi instead of large Pi, like this

term := proc(lst,k::integer)
    local n;
    n := nops(lst);     
    seq(lst[m+1]*exp(-I * 2*pi/n *(k*m)),m=0..n-1);
end proc;

and now r:=term([1,2,3],1); return

Which is what I wanted, but with Pi instead of pi.  now how would I evaluate the above?

I tried to use subs to replace small pi with large Pi, but it does not work

subs(pi=Pi,r); #error

Then I tried eval, which worked


So, I can use the above method.

My question is: Is the above a common way to handle such case? Is there another way to use Pi but at the same time prevent Maple from automatic simplification of the exp() terms?







  I have the following code for using "PolynomialSystem" solve equations of polynomial




f:=PolynomialSystem({x+y-3, x^2+y^2-5}, {x, y}):




The output is


x, y
{x = 2, y = 1}, {x = 1, y = 2}
{x = 2, y = 1}
{x = 1, y = 2}
x = 2
y = 1
x = 2, y = 1
-x = -2.
-y = -1.


From what I have seen, I cannot subtract the values of x and y as 2 and 1. Is there any way that I can get the values of solutions of variables, namely I can assign a variable "a" as 2, and the other variable "b" as 1?


Thank you very much!





Sorry for basic question, Maple newbie here and I could not find answer using google.

I understand in Maple one uses the back quote key (or rather the apostrophe, 0X27) to prevent one time evaluation of expression. Hence when writing

'sin(Pi)'; #this remain sin(Pi)
%; # now we get 0

But when I tried it on fraction, it did not hold it:

'16/4'; #maple replied with 4

This might indicate that the front end parser did this simplification before the main evaluator got hold of it, so it was too late?

Either way, how would one make Maple return 16/4 when the input is '16/4'?


I'm having a problem with the statements inside a for-loop somehow being read in a different way than outside the loop. 

I've defined some functions earlier, and then I need to perform an integration using these functions, while I change one variable a little for each loop of the for-loop. 

The problem is that IN the for-loop, I get the same value from my integration for all loops. But when I execute the exsact same code OUTSIDE of the loop, I get the correct values, which are changing whenever i change the one variable. 

Here is the loop:

for i from 0 to 42 do

rotorshift := evalf[6](2*((1/180)* *Pi*((1/2)*Ø[gap]))/N[m]-1/2*(tau[p]-tau[s]));

PMmmf_func := x-> proc (x) if type(x-rotorshift, nonnegative) then if type(trunc((x-rotorshift)/tau[p]), odd) = true then -H[c]*l[m] else H[c]*l[m] end if else if type(trunc((x-rotorshift)/tau[p]), odd) = true then H[c]*l[m] else -H[c]*l[m] end if end if end proc

B[g] := proc (x) -> 1000*mu[0]*(PMmmf_func(x)+MMF_func(x))/d[eff, stator](x) end proc;

Flux(i+1) := (int(B[g](x), 0 .. tau[s])+int(B[g](x), 3*tau[s] .. 4*tau[s])+int(B[g](x), 6*tau[s] .. 7*tau[s])+int(B[g](x), 9*tau[s] .. 10*tau[s]))*10^(-3)*L[ro];

end do;

And for all the values in the "Flux" vector, I get the same value. But when I remove the loop, and change the value of manually, I get the correct (changing) values of flux!! 

Any ideas why this may be? This is really dricing me nuts. I've spent the beter part of the day on this, and I just can't seem to find a workaround, much less a reason for this behaviour.

many thanks!

I want to print 2+3= in the input and get exactly the same output.

And how can i do it in a program?

Is it possible to evaluate a function at multiple points described by an array or something of that sort and have Maple return the evaluations as an array. I need approximations of a function at various values of its argument so it would be nice to do it with a single command.


Hello everybody. I'm newbie and my english are not very good. Please help me debug an error in my files "Error, (in ans) cannot determine if this expression is true or false"

I have an indexed equation that contains serval definite integrals in it. I want maple to evaluate the equation for different indices. But when I set the parameter "N=100" in the code, it takes maple lots of time for the evaluation. I am looking for some tricks to make the code numerically more efficient. I will be so thankful for any opinion and help.
you can find my code below. The code is so simple and just contains few lines. I will appreciate any help.

Thanks in advance.

I am having problems with the curly brackets in math mode. I am using a Danish keyboard, and since changing to Maple 17, the inline evaluation (usually [CTRL]+=) has been placed as [CTRL]+[ALT]+0 which - by Maple - is interpreted the same way as [ALT-GR]+0. Unfortunately [ALT-GR]+0 is the way to get the end-bracket for curly brackets, i.e. }

Therefore, I am not able to write } in math mode. Maple interprets my keystrokes as a wish to do inline evaluation when trying to write }.

Has anyone experienced this issue - and if so: Is there a way to fix it?

Is there a way to change the shortcut keys in Maple (e.g. make an alternative shortcut for inline evaluations)?


Suppose i am trying to do a sequential if command as follows:

seq(`if`(a[i] < b[i], c[i], d[i]), i = 1 .. 10);

now this doesnot evaluate the i's in c[i] and d[i].

please help me with complete evaluation of this statement.

1 2 3 Page 1 of 3