class MainRun::RunInit
Attributes
power[RW]
t0[RW]
ts[RW]
Public Class Methods
new(hash_data, option = 0, file_name = 'default.txt')
click to toggle source
# File lib/decay_heat_with_nuclear/main_run.rb, line 5 def initialize(hash_data, option = 0, file_name = 'default.txt') @ts = hash_data[:ts] @t0 = hash_data[:t0] @power = [] @option = option @file_name = file_name @output_hash = { ts: [], p_p0: [], p_p0_without_k: [] } end
Public Instance Methods
dataout(ts, p_p0, p_p0_without_k = nil)
click to toggle source
# File lib/decay_heat_with_nuclear/main_run.rb, line 18 def dataout(ts, p_p0, p_p0_without_k = nil) @output_hash[:ts] << ts @output_hash[:p_p0] << p_p0 @output_hash[:p_p0_without_k] << p_p0_without_k if p_p0_without_k end
day2sec(day)
click to toggle source
day2sec(day)
# File lib/decay_heat_with_nuclear/main_run.rb, line 25 def day2sec(day) if day < 86400 * 10 day * 24 * 3600.0 end end
sec2day(sec)
click to toggle source
sec2day(sec)
# File lib/decay_heat_with_nuclear/main_run.rb, line 32 def sec2day(sec) sec / 24 / 3600.0 end