Skip to content
Snippets Groups Projects
Unverified Commit 29491fca authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Set secondary cost to drive pulse phase and frequency to zero

parent 454b9a60
No related branches found
No related tags found
No related merge requests found
Pipeline #24991 failed
module ConstantPulses
import JuMP: @constraint
import ...AbstractTypes: RFPulseComponent, split_timestep
import ....Variables: VariableType, set_simple_constraints!, make_generic, get_free_variable, adjust_internal, variables, @defvar, apply_simple_constraint!
import ....Variables: VariableType, set_simple_constraints!, make_generic, get_free_variable, adjust_internal, variables, @defvar, apply_simple_constraint!, add_cost_function!
import ..GenericPulses: GenericPulse
"""
......@@ -34,6 +34,7 @@ function ConstantPulse(; amplitude=nothing, duration=nothing, phase=nothing, fre
)
apply_simple_constraint!(res.amplitude, :>=, 0)
set_simple_constraints!(res, kwargs)
add_cost_function!(res.frequency^2 + res.phase^2)
return res
end
......
......@@ -28,6 +28,7 @@ function InstantPulse(; flip_angle=nothing, phase=nothing, group=nothing)
group
)
apply_simple_constraint!(res.flip_angle, :>=, 0)
add_cost_function!(res.phase^2)
return res
end
......
......@@ -55,6 +55,7 @@ function SincPulse(;
apply_simple_constraint!(res.lobe_duration, :>=, 0)
end
set_simple_constraints!(res, kwargs)
add_cost_function!(res.frequency^2 + res.phase^2)
return res
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment