# # kihon6.rb # $Id: kihon6.rb,v 1.2 2000/11/18 19:03:33 keiko Exp $ # require "narray" require "numru/dcl" include NumRu include Math nmax = 50 x = NArray.sfloat(nmax+1) y = NArray.sfloat(nmax+1) #-- data ---- r = 3.7 x.indgen(1950.0, 1.0) y[0] = 0.5 for n in 0..nmax-1 y[n+1] = r*y[n]*(1-y[n]) end y = -4 * y + 20.0 #-- graph ---- iws = (ARGV[0] || (puts ' WORKSTATION ID (I) ? ;'; DCL::sgpwsn; gets)).to_i DCL::sgopn iws DCL::sgfrm DCL::grswnd(1950.0, 2000.0, 15.0, 20.0) DCL::grsvpt(0.2, 0.8, 0.2, 0.8) DCL::grstrn(1) DCL::grstrf DCL::usdaxs DCL::sgplu(x, y) DCL::grcls