Ask Your Question

saggio's profile - activity

2014-11-19 17:52:43 +0200 commented answer Exponentiation makes a formula go crazy?

Tanks, that actually solved it! You made my day... :D

2014-11-19 17:52:17 +0200 received badge  Scholar (source)
2014-11-19 01:05:17 +0200 asked a question Exponentiation makes a formula go crazy?

Hi guys,

I'm new to Sage, so I hope that somebody will help me, because I've been wasting a whole day tring to fix a (relatively) simple plot that just won't work. Here's the code:

k = var('k')
f(x) = (1 - e ^ (- (k *33 * x) / 1024)) ^ k
g(y) = sum(f(x),x,y,15)
h(z) = f(z) - g(z+1)
plot([h(l) for l in range(1,15)], (k,10,15))

It fails saying (after a lot of other things): ValueError: Variable 'x' not found

Now, I believe the error is in the f(x) formula, because if I cahge it to something simpler, but still with x and k I get the correct result and it plots. But why is the one above not working? Does it have something to do with the exponentiation?

Thank you so much for any clue on what's wrong!