Question: Drawing a polygonal approximation of a curve C

I try to make a procedure for this 

Was it by a example of Riemann sum that  x-values in a array are stored for  numerical value, but in this task it seems that the array must be filled with the symbol x1,x2 , etc 

Should this be needed ?

 

blz64.pdf

blz_65.pdf

excset  3  task4

 

Was it first for a partition about a interval ( example Riemannn sum) that i got  a list of numeric values

 a:= 0: b:= 5: N:= 30: i= 0..N :

X:= Array(0..N, [seq(j, j=a..b, (b-a)/N)]);

Array(%id = 18446745862042054398)

(1)

Now i want  to get a list  of  x-values in Array X ,  starting from  0  to N  :

example: array X =[x0= 0, x1=1/6, ...]

x[i]:= a+(b-a)*i/N; # for i = 0..N # endpoints subintervals

Error, invalid terms in product: 0 .. 30

 

# generate X-values for interval [a,b]

X:= Array(0..N, [seq(j, j=a..b, x[i])]);

Error, invalid input: seq expects its 3rd argument, step, to be of type numeric, but received x[i]

 

 

the values  x1,x2....stored  in Array X are used in further calulations
If there is a need for naming x1= 0 , x2= ..  in the Array A ? , probably not .

 


 

Download vraag_excset3_task_4.mw

  

Please Wait...