# Maple: How to give values to assumptions for plotting?

So I have a simple example of what I want to do:

restart;
assume(can, real);
f := {g = x+can*x*y, t = x+x*y};
assign(f[1]); g;
can := 2;
plot3d(g, x = 0 .. 100, y = 0 .. 100);


while this works:

restart;
f := {g = x+can*x*y, t = x+x*y};
assign(f[1]);
can := 2;
plot3d(g, x = 0 .. 100, y = 0 .. 100);


But that assumptions are really important for my real life case (for some optimisations with complex numbers) so I cant just leve can not preassumed.

Why it plots nothuing for me and how to make it plot?

-
I also tried asuming(can = 2) and assign(can = 2) –  Kabumbus Sep 11 '11 at 17:58
And I can not simply just create g –  Kabumbus Sep 11 '11 at 17:59

## 1 Answer

Your statement "assume(can,real);" produces a new variable (can~) and assigns it as the value of can. Your statement "assign(f[1]);" evaluates f[1] as g = x + can~*x*y and then assigns x + can~*x*y as the value of g. Now "can := 2;" assigns the new value 2 to can (removing the assumption), but this doesn't affect the value of g which has already been assigned and contains "can~" rather than "can". So when you try to plot g, it contains an unassigned parameter.

One thing you might do, instead of assigning a value to can (which removes an assumption you said is really important), is to evaluate g at the value can = 2. Thus omit the "can := 2" and try

plot3d(eval(g, can = 2), x = 0 .. 100, y = 0 .. 100);

-
Is it possible to feed an array to eval? (for example) something like Gtemp := eval(g, {can = t, cod = 10, p[1] = 10}) –  Kabumbus Sep 11 '11 at 18:33
That's not an array, that's a set. Yes, you can feed a set or list to eval. –  Robert Israel Sep 12 '11 at 0:37