#/*********************************************************** # chaos_g.rb -- カオスとアトラクタ # # gnuplot で表示を行う #***********************************************************/ printf("比例定数: "); k = gets.to_f printf("初期値 : "); p = gets.to_f gp = IO.popen("gnuplot -persist", "w") gp.puts 'plot "-" w l' for i in 1..50 gp.puts p p += k * p * (1 - p) end gp.puts "end" gp.close exit 0