DataMuseum.dk

Presents historical artifacts from the history of:

RC4000/8000/9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC4000/8000/9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦99292eb6a⟧ TextFile

    Length: 2304 (0x900)
    Types: TextFile
    Names: »linsim«

Derivation

└─⟦621cfb9a2⟧ Bits:30002817 RC8000 Dump tape fra HCØ.  Detaljer om "HC8000" projekt.
    └─⟦0364f57e3⟧ 
        └─⟦720b7e52e⟧ »calprog« 
└─⟦667bb35d6⟧ Bits:30007480 RC8000 Dump tape fra HCØ.
    └─⟦4334b4c0b⟧ 
        └─⟦720b7e52e⟧ »calprog« 
            └─⟦this⟧ 

TextFile

begin
integer i,i1,i2,j,n,fp;
array FP,P(1:2);
boolean plot;
real r,r1,r2,r3,r4,a,b,s,x0,dx,a1,b1,sa1,sb1,ymin,ymax,x;
plot:=false;
fp:=readparam(FP);
if fp<>0 then begin
  if fp=-1 then readparam(P);
  readparam(P);
  if P(1)=real <:plot:> then plot:=true;
  end;
i1:=readi(<:ran1:>);
i2:=readi(<:ran2:>);
n:=readi(<:no of points:>);
read(in,a,b,s,x0,dx);
x:=x0;
r3:=r4:=0;
begin
   array X,Y(1:n);
   for j:=1 step 1 until n do
      begin
       X(j):=x;
       r1:=random(i1); r2:=random(i2);
       r3:=r3+r1; r4:=r4+r2;
       r:=sqrt(-2*ln(r1))*cos(2*pi*r2);
       Y(j):=a*x+b+s*r;
       x:=x+dx;
       end;
   write(out,<:<10>r1 = :>,r3/n,
             <:<10>r2 = :>,r4/n);
   if -,linfit(n,a1,sa1,b1,sb1,Y,X) then system(9,0,<:linfit:>);
  if fp=-1 then begin
    reservesegm(FP,3);
   permentry(FP,13);
    stackcuro;
    connectcuro(FP);
    end;
  write(out,<:<10>a =  :>,string minlay(a1,sa1/10,0),a1,
    <: +- :>,<<d.d'd>,sa1,
    <:<10>b = :>,string minlay(b1,sb1/10,0),b1,
    <: +- :>,<<d.d'd>,sb1);
  write(out,false add 10,2,<:    X(j)           Y(j):>);
  for j:=1 step 1 until n do
      write(out,<:<10>:>,<<-d.dddd'dd>,X(j),<:  , :>,Y(j));
   if fp=-1 then begin
    write(out,false add 10,3);
    closeout;
    end;
if plot then begin
   plotform(0,10,10);
   ymin:=ymax:=Y(1);
   for i:=1 step 1 until n do begin
       if Y(i)>ymax then ymax:=Y(i) else
       if Y(i)<ymin then ymin:=Y(i); end;
       setmargin(2,plotyform-1);
       writeplot(<:<12>a =  :>,string minlay(a1,sa1/10,0),a1,
                <: +- :>,<<d.d'd>,sa1,
                <:<10>b =  :>,string minlay(b1,sb1/10,0),b1,
                <: +- :>,<<d.d'd>,sb1);
       plotadmini(X(1),X(n),ymin,ymax,0);
       for i:=1 step 1 until n do
           plotpoint(X(i),Y(i),2);
           plotmove(X(n),a1*X(n)+b1);
           pendown;
           plotmove(X(1),a1*X(1)+b1);
           penup;
       end;
   end;
end;
▶EOF◀