Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Improved radial objective function
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed May 28, 2021
1 parent b7a13be commit 7711ceb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/symba/symba_frag_pos.f90
Original file line number Diff line number Diff line change
Expand Up @@ -759,12 +759,12 @@ function radial_objective_function(v_r_mag_input) result(fval)

allocate(v_shift, mold=vb_frag)
v_shift(:,:) = vmag_to_vb(v_r_mag_input, v_r_unit, v_t_mag, v_t_unit, m_frag, vcom)
fval = -ke_frag_budget + ke_frag_spin
fval = -2 * ke_frag_budget
do i = 1, nfrag
fval = fval + 0.5_DP * m_frag(i) * dot_product(v_shift(:, i), v_shift(:, i))
fval = fval + m_frag(i) * (Ip_frag(3, i) * rad_frag(i)**2 * dot_product(rot_frag(:, i), rot_frag(:, i)) + dot_product(v_shift(:, i), v_shift(:, i)))
end do
! The following ensures that fval = 0 is a local minimum, which is what the BFGS method is searching for
fval = (fval / ke_frag_budget)**2
fval = (0.5_DP * fval / ke_frag_budget)**2

return

Expand Down

0 comments on commit 7711ceb

Please sign in to comment.