From: Jaime V. <vi...@fe...> - 2024-04-06 18:00:08
|
On 06/04/24 17:44, Pierre CAMPET wrote: > > when i try your solution i get > > plot2d: expression g > should depend only on x, or be an expression of 2 variables > Strange, this works for me in all the Lisp versions I have: f(x):=1/(1+x)$ E(f,x,n,a,b):=block(if x=b then return(f(b)) else for i:1 thru n do if (x < a+i*(b-a)/n) then return(f(a+(i-1)/n)) ); g(x):=E(f,x,10,0,1)$ plot2d([f,g], [x,0,1]); What version of Maxima are you using? what operating system and what Lisp flavor? I assume you are using Wxmaxima? Regards, Jaime |