kill(all);

appendix : def linspace : values between  tb[1] & tb[2], nv = number of points
peter.vlasschaert@gmail.com,07/01/2020

1e) load packages:
===============

load(lrats);

2e) list of two values
================

tb:[10,0];

3e)  number of points
=================

nv : 100;

4e)   xrange 'min ,max'
=========
lmin : minumum list ( = value)
lmax : max list         ( =  value)

p1:xmin = lmin(tb);
p2:xmax =lmax(tb);

5e)  equation x values
=================
linear function :q1=a+i*b =>
scaled linear function : p3

p3:q=(a+i*b)/(nv-1);

p3a:  x = xmin + q*(xmax-xmin);

p3b:subst([p3],p3a);

6e) find a,b
========
?  x=xmin   i:1 
?  x=xmax  i:nv

p4:subst([i=1,x=xmin],p3b);
p4a :subst([i=nv,x=xmax],p3b);

p4b:solve([p4,p4a],[a,b])[1];

7e)  find formula  x
===============

p5:subst(p4b,p3);

kill(nv);

nv;

p5a:lhs(p5) = (b*i+a)/(nv-1);

p5b:subst([p5a],p3a);

p5b1:subst(p4b,p5b);

p5b2:subst([x=x[i]],p5b1);

check:xmin,xmax

p5a:subst([i=1],p5b2);
p5b:subst([i=nv],p5b2),ratsimp;

x[1],x[2],x[3],.....
=========

p6:makelist(ev(p5b2),i,1,5);

example  'from above'
=================

p6a:subst([p1,p2],p6);

set : nv = 100,number of points

p6b:subst([nv=100],ev(p6a));

p6c:p6b,float;

find x[98]
=======
use p5b2  , i=98,nv =100 given :xmin,xmax

p6d:subst([i=98,nv=100],ev(p5b2))$

p6d1:subst([p1,p2],p6d),float;

for all values x[i], i=1..nv,given xmin,xmax
===============================

xval(i,nv,xmin,xmax):= block(
x[i]:ev(xmin+((i-1)*(xmax-xmin))/(nv-1)));

xval(98,100,0,10),float;

show for i:1..11 (not for i=1..nv)
------------------------------------------

xvals :makelist(float(xval(i,100,0,10)),i,1,11);