Sha256: 6e6a2d9738292bc30b051e015cfc8fdf271eaf452dce523e03d94dafd0725f59

Contents?: true

Size: 446 Bytes

Versions: 22

Compression:

Stored size: 446 Bytes

Contents

#!/usr/bin/env ruby
require("gsl")

m = 1.0
k = 1.0
b = 1.0
mode = GSL::Poly.complex_solve_quadratic(m, b, k)
p mode.class

f = GSL::Vector.linspace(0.01, 100, 1000)
p f.class
tf0 = 1.0/((m*mode[0]*f + b)*mode[0]*f + k)
tf1 = 1.0/((m*mode[1]*f + b)*mode[1]*f + k)
p tf0.class
GSL::graph(f, tf0.amp, tf1.amp, "-C -g 3 -l x -l y -L 'Transfer function: amplitude'")
GSL::graph(f, tf0.phase, tf1.phase, "-C -g 3 -l x -L 'Transfer function: phase'")

Version data entries

22 entries across 22 versions & 4 rubygems

Version Path
gsl-2.1.0.3 examples/complex/oscillator.rb
gsl-2.1.0.2 examples/complex/oscillator.rb
gsl-2.1.0.1 examples/complex/oscillator.rb
gsl-2.1.0 examples/complex/oscillator.rb
gsl-1.16.0.6 examples/complex/oscillator.rb
rb-gsl-1.16.0.5 examples/complex/oscillator.rb
rb-gsl-1.16.0.4 examples/complex/oscillator.rb
rb-gsl-1.16.0.3 examples/complex/oscillator.rb
rb-gsl-1.16.0.3.rc1 examples/complex/oscillator.rb
gsl-nmatrix-1.15.3.2 examples/complex/oscillator.rb
gsl-nmatrix-1.15.3.1 examples/complex/oscillator.rb
rb-gsl-1.16.0.2 examples/complex/oscillator.rb
rb-gsl-1.16.0.1 examples/complex/oscillator.rb
rb-gsl-1.16.0 examples/complex/oscillator.rb
rb-gsl-1.15.3.2 examples/complex/oscillator.rb
rb-gsl-1.15.3.1 examples/complex/oscillator.rb
blackwinter-gsl-1.15.3.2 examples/complex/oscillator.rb
gsl-nmatrix-1.15.3.0 examples/complex/oscillator.rb
gsl-1.15.3 examples/complex/oscillator.rb
gsl-1.14.7 examples/complex/oscillator.rb