steweb

35 Reputation

4 Badges

14 years, 9 days

MaplePrimes Activity


These are answers submitted by steweb

Although, the use of "local" seems to work in the example discussed, it does not work in my actual problem. For example, using "local" in the definition of my procedure has the negative sideeffect that my function returns partially unevaluated: Meaning that the result of g(1)(x); (in my more complicated definition) contains unevaluated g(0).

 

Also, whats still very strange is the following: I defined my function g(0) using an integral. I noticed that I can calculate this first integral explicitly and defined a new function gnew(0) using this explicit expression. Maple confirms that g(0)=gnew(0). However, g(1) is unequal to gnew(1) even though the induction is exactly the same apart from changing to an equivalent induction start. This happens with and without "local".

 

Litte sidenote @Erik Postma:

I find your first answer very unmathematical. Mathematically, the three definitions f:=a->int(a*x,x=0..1); and f:=a->int(a*y,y=0..1); and f:=a->a/2; are equivalent, since the name of a bounded variable has no meaning. Also, writing f(x) does not mean "substitute for x", it means "give me the number assigned to x by the relation f". Thus, the one and only correct answer is f(x)=x/2.

 

Also, I do not understand the logic behind "local": Why does it make sense to define a local variable x in the procedure g? The integration variable x should be local variable of the procedure int.

Page 1 of 1