Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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);

enter image description here

while this works:

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

enter image description here

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?

share|cite|improve this question
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
up vote 2 down vote accepted

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);

share|cite|improve this answer
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.