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-1.14.6 | examples/complex/oscillator.rb |
gsl-1.14.5 | examples/complex/oscillator.rb |