diff --git a/src/BallAndBeam.jl b/src/BallAndBeam.jl index d4a6a499a74d6a9a04614460fd830f5ac550f17b..812e6947dbea9d22cf478d8a5b73854b329c30fb 100644 --- a/src/BallAndBeam.jl +++ b/src/BallAndBeam.jl @@ -22,10 +22,10 @@ using LabProcesses, Plots, Polynomials, ControlSystems, ProgressMeter """ - run_experiment(P::BallAndBeamType, ω, duration, settling_time, amplitude, bias) + run_experiment(P::AbstractBeam, ω, duration, settling_time, amplitude, bias) Perform fra-experiemnt For a single frequency `ω`. Called from inside `fra` """ -function run_experiment(P::BallAndBeamType, ω, duration, settling_time, amplitude, bias) +function run_experiment(P::AbstractBeam, ω, duration, settling_time, amplitude, bias) h = sampletime(P) data = zeros(0:h:duration) LabProcesses.initialize(P) @@ -62,7 +62,7 @@ integrate(fun,data,ω,h) = h*sum(fun(ω*(i-1)*h).*data[i] for i = 1:length(data) - `nbr_of_periods = 10`: - `amplitude = 1`: Very low freqs might require smaller amplitude """ -function fra(P::BallAndBeamType, Ω::AbstractVector; +function fra(P::AbstractBeam, Ω::AbstractVector; bias = 0, settling_time = 2, nbr_of_periods = 10, diff --git a/src/FRTN35_lab1.jl b/src/FRTN35_lab1.jl index be7012f4556d969e41e9ceeaa6f7089182480ea2..3d8eaf7c8a325b926765b0b757566afce76a7729 100644 --- a/src/FRTN35_lab1.jl +++ b/src/FRTN35_lab1.jl @@ -2,7 +2,7 @@ using BallAndBeam, LabProcesses, ControlSystems, JLD # @load "workspace.jld" # Run this command to restore a saved workspace bias = 0 # Change this if your process drifts over time -P = LabProcesses.BallAndBeam(0.01, bias) +P = LabProcesses.BeamSimulator(0.01) h = sampletime(P) settling_time = 1