Skip to content

Commit

Permalink
Fix string and grip forces
Browse files Browse the repository at this point in the history
  • Loading branch information
stfnp committed Nov 4, 2017
1 parent a84526b commit febff17
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion source/model/BowModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,20 @@ void BowModel::add_state(BowStates& states) const
double e_kin_string_center = 2.0*system.get_elements().get_kinetic_energy("string center");
double e_kin_arrow = 2.0*system.get_elements().get_kinetic_energy("arrow");

double string_force = 0.0;
for(auto& element: system.get_elements().group<BarElement>("string"))
string_force = std::max(string_force, std::abs(element.get_normal_force()));

states.string_force.push_back(string_force);
states.strand_force.push_back(string_force/input.string_n_strands);
states.grip_force.push_back(-2.0*system.get_q(nodes_limb[0].y)); // *2 because of symmetry

states.e_pot_limbs.push_back(e_pot_limb + e_pot_limb_tip);
states.e_kin_limbs.push_back(e_kin_limb + e_kin_limb_tip);
states.e_pot_string.push_back(e_pot_string + e_pot_string_tip + e_pot_string_center);
states.e_kin_string.push_back(e_kin_string + e_kin_string_tip + e_kin_string_center);
states.e_kin_arrow.push_back(e_kin_arrow);


// Limb and string coordinates
states.x_limb.push_back(VectorXd(nodes_limb.size()));
states.y_limb.push_back(VectorXd(nodes_limb.size()));
Expand Down

0 comments on commit febff17

Please sign in to comment.