diff --git a/Project.toml b/Project.toml index e5be776c1eda805de482db49f1fd85f13a4e4253..83c65d6915cf2aab631d26d0effb483c2341524a 100644 --- a/Project.toml +++ b/Project.toml @@ -7,7 +7,6 @@ version = "0.0.0" Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9" JuMP = "4076af6c-e467-56ae-b986-b466b2749572" Juniper = "2ddba703-00a4-53a7-87a5-e8b9971dde84" -LinA = "f599c993-2677-4f60-8998-71feb0f665db" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MakieCore = "20f20a25-4f0e-4fdf-b5d1-57303727442b" Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45" diff --git a/src/components/abstract_types.jl b/src/components/abstract_types.jl index 7695919c68323064fd0af976a5a7156af28c87b7..6ef5cb2b30efa1c752b716a08af7c8c484b93926 100644 --- a/src/components/abstract_types.jl +++ b/src/components/abstract_types.jl @@ -40,8 +40,6 @@ abstract type ReadoutComponent <: EventComponent end split_times(component, t1, t2, precision) Indicates at what timepoints a given [`BaseComponent`](@ref) should be split during linearisation to achieve the given precision. - -For non-linear components this will use [`LinA.jl`](https://github.com/LICO-labs/LinA.jl) under the hood. """ function split_times end diff --git a/src/components/pulses/sinc_pulses.jl b/src/components/pulses/sinc_pulses.jl index ec343f0f6c6940e1caa53dfd538ef6efedebd354..fa562c9b91eaf2076b20d2c0942cd482d0bb0597 100644 --- a/src/components/pulses/sinc_pulses.jl +++ b/src/components/pulses/sinc_pulses.jl @@ -1,7 +1,6 @@ module SincPulses import JuMP: @constraint import QuadGK: quadgk -import LinA import ....BuildSequences: global_model import ....Variables: duration, amplitude, effective_time, flip_angle, phase, inverse_bandwidth, VariableType, set_simple_constraints!, frequency, make_generic, get_free_variable import ...AbstractTypes: RFPulseComponent, split_times @@ -103,11 +102,10 @@ function make_generic(block::SincPulse) end function split_times(block::SincPulse, t1, t2, precision) - real_amplitude_precision = precision * amplitude(block) - pwl = LinA.Linearize(t -> amplitude(block, t), t1, t2, LinA.Absolute(real_amplitude_precision)) - times = [part.xMin for part in pwl] - push!(times, t2) - return times + max_second_derivative = π^2/3 * (amplitude(block) / lobe_duration(block))^2 + step_size = sqrt(2 * precision / max_second_derivative) + npoints = Int(div(t2 - t1, step_size, RoundUp)) + return range(t1, t2, length=npoints) end end \ No newline at end of file diff --git a/src/containers/linearise.jl b/src/containers/linearise.jl index 6b170d613d32215486585cd43f26f06fef3c0364..5ca43bda44b0116e0cd93943c2c17e043281c9dd 100644 --- a/src/containers/linearise.jl +++ b/src/containers/linearise.jl @@ -1,5 +1,4 @@ module Linearise -import LinA import StaticArrays: SVector import ...Components: GradientWaveform, split_times import ...Variables: amplitude, phase, gradient_strength3, duration