int main() {
    Model model("gait10dof18musc_subject01.osim");

    // Create a StatesTrajectory from a forward simulation.
    // ----------------------------------------------------
    // To assist with creating interesting (non-zero) coordinate values:
    model.updCoordinateSet().get("pelvis_ty").setDefaultLocked(true);
    auto& initState = model.initSystem();
    StatesTrajectory states = simulate(model, initState, 0.05);

    // Use trajectory.
    // ---------------
    for (const auto& state : states) {
        std::cout << state.getTime() << "s: "
                  << model.getStateVariableValue(state,
                          "ankle_r/ankle_angle_r/value")
                  << std::endl;
    }

    // Export to data table.
    // ---------------------
    auto table = states.exportToTable(model);

    return 0;
}