Items tagged with eval eval Tagged Items Feed

Evalb and verify

April 21 2012 by serena88 20

Hi,

I am trying to proof that the right hand side is equal to the left hand side. When i do step by step, it clearly shows that my "c" and "d" are exactly the same thing. But when i use "evalb" and "verify", it comes out with "false". May I kwow what went wrong please?

Thanks.

Check the correctness of the solution by substituting for all found roots.

This are my found roots:

a:=12+10x^4+7x^3-89x^2+65x

and i found my roots (e.g);

b:= -3.5666666666,1.238969999,5.7777777,8888888888

 

I have two inequalities in the complex variable z, called "ineq" and "ineq2".  When I issue the following plotting command, I can show the region of the complex plane that satisfies both inequalities:  It appears as a black region:

 

plots[implicitplot](eval(ineq = ineq2, z = x+I*y), x = -8 .. 8, y = -8 .. 8, gridrefine = 3, filled = true)

 

Now, I would like to generate a similar overlap plot, but for three inequalities,...

Matrix Evaluation

March 01 2012 by CHW 0 Maple

What are the equivalents of eval and evalf for Matricies. In particular how would you display a Matrix which appears in symbolic form to appear with numeric entries.

Why in next code i must apply operator twice?

zzz.mw

 

 

-------

inert form eval procedure

Have s:={'a', 'b'};

a:=4;

naturally s[1] resolves to 4. Moreover, eval(s[1],1)=4, so s successfully should forget about a.

But...

a:='a'; and s[1] returms... again a.

So, why dereferencing of pointers  is not the same as 'eval 1-level' resolving?

How actually can i unassign 'a' having s only?

Or (not obviously, but same!) related question:

how to obtain s1:={'a', 'b'} having s={a,b} with nonresolvable a and b .i.e. eval(smth, -1)?

Please help me to check this procedure for solving complex DAE, I want to plot this error figures

There are some errors for the initial conditions?

restart;
with(plots);
w := 10;
L :=0.001;
R :=1;
u(t) :=exp(I*w*t) + 2* exp(I * 2 * w * t);
daesys:={diff(I3(t),t) = 1/L*u(t), I1(t) = I3(t) + 1/R * u(t), I1(0)=0, I3(0)=0};
dsys1:= map(eq -> (evalc(Re(eq)), evalc(Im(eq))), eval(daesys, {x(t) = xre(t) + I*xim(t), y(t) = yre(t) + I*yim(t)}));

Why doesn't Maple evaluate ln(x) assuming x<0 to ln(-x) instead of ln(x).  I know that it can evaluate negative operands into complex numbers, but sometime I would just like it to say ln(-x).  It seems to work OK for sqrt(x) assuming x<0. 

Ratch

I wrote the following lines in MAPLE:

I have the numerical solution of Phi(r,t) which is a numerical solution of a pde..

I want to find the following energy integral at fixed time say t=10 ,

Energy = int(a*r^2*Phi(r,10)^2 + 2*b*r*Phi(r,10)^3,r=0..infinity)... I could not find help in maple.. I guess I had to do the following

 

1. select the numerical solution dependent only on r at t=10 slice..

2.Use numerical methods to evaluate the integral..

 

Hello. I need to solve a problem where:

  A is defined over a real inteval [c...d]   and   B is defined over another real interval [d....e]. 

I want maple  to take max(A,B) and tell me which interval is larger( asume no intersection)

For example

A=[0....1] and B=[2...3]

Answer should be max(A,B)=B

Thank you

After understanding how one part of code works i also see that it uses trick of eval (namely "procedural substitution"):

restart;
r:=f(g(u), h(w)):
eval(r, [g=proc() ll; end proc]):

gets full substitution with arguments

and

restart;
r:=f(g(u), h(w)):
eval(r, [g=ll]):

do simple one 'by name'.

Where can i read about that?

How to do subj? Straightforward way doesn't compile:

restart;

myint:= proc(u::float)::float;
return int(exp(x^6), x=0.0..u);
end proc:


createcomp:=proc (expr::evaln, exprfunc::evaln);
exprfunc:=(v::float)->unapply(evaln(expr),a)(v);
return Compiler:-Compile(exprfunc,optimize);
end proc:
global_expr:=myint(a)+a^a;
s:=createcomp(global_expr, global_exprfunc);


"Error, (in Print) cannot translate value of lexically...

I have a module to overload the * operator for the function f such that:

a*f(b,c,d) = f(a*b,a*c,a*d)

FPackage :=  module()option package;    export `*`;    `*` :=    overload    (      [        proc(a::algebraic, b::specfunc(anything, f))          option overload;          map2(:-`*`, a, b...

Hello,

 

I'm doing a math assignment for numerical methods and I had to answer a question - solving Newton's method in maple to submit. I need to solve the question to an accuracy of 10^-5. I don't have access to the software right now as I only have it on the computers at our school, but I did take a maple course in my first year of university and have some experience with it. I wrote up this formula, but I'm not 100% sure if its correct. Could someone...

1 2 3 Page 1 of 3