APPENDIX Mathematical modeling overview We used MATLAB and SIMULINK (Mathworks, Inc., Natick, USA) to create a mathematical model capable of simulating reaching kinematics under various conditions. To model the physical properties of the arm, the forearm and hand were represented as a uniform mass attached to a rotational joint. In mechanics, it is common to approximate the relationship between force and movement with a linear combination of three dynamic properties, inertia, damping, and stiffness, which are constants multiplied by acceleration, velocity, and distance from the equilibrium point, respectively. During preliminary analysis of the model, we found that inertial and damping terms accounted for much of the observed behavior and thus, we did not include stiffness in this study. The inertia (iarm), was estimated based on subject height and weight (Winter, 1990). The arm damping was selected as 0.22 Nms/rad (barm) in accordance with estimates of physiological values (Selen et al., 2006). The physical robot arm dynamics (irob, brob) were estimated from mechanical drawings and material densities in combination with a system identification procedure (Grow, 2011; Hollerbach et al., 2008). The virtual modifications of inertia and damping are denoted as ivir and bvir. The combination of the human arm, physical robot dynamics and virtual dynamics are referred to as the plant dynamics (iPL, bPL). The controller part of the model consisted of a feedforward signal (uFF) combined with a delayed online feedback correction signal (uFB, Fig. 4). The motor command was computed by the command generator based on the internal model estimate of plant dynamics (iIM, bIM) in addition to a desired trajectory (i.e. elbow angular position, velocity, and acceleration; θd, ωd, αd). In this scheme, the command generator is mathematically equivalent to an inverse dynamic model. Preliminary analysis of control subject reaches under null conditions showed that movements had stereotypical, “bell-shaped” velocity profiles (Hogan, 1984; Richardson and Flash, 2002). Thus, the desired trajectory was constrained to have a symmetric bell-shaped velocity profile for a 30° amplitude movement and designated movement duration (dur). The feedforward command at each time step, t, was computed as: t u FF bIM dt i IM dt . The feedforward command was combined with the feedback command (described in more detail below) to give the total motor command (utot). t t t utot u FF u FB 1 Based on utot, iPL, and bPL, the output of the model (i.e. the resulting kinematics of the plant, θo, ωo, αo) was computed by integrating the following equation of motion: t t utt otbP L o iP L o. The feedback signal was modeled as the unbiased output position and velocity of the arm. The sensory signal was constrained to be delayed by 100-120 ms (Δ), a period comparable to minimum latencies previously reported (Flanders and Cordo, 1989). Feedback error was computed as the difference between the delayed sensory signal and the desired trajectory with a corresponding delay. The position and velocity errors were multiplied by the position gain (KP) and velocity gain (Kv) and added to the outgoing feedforward torque. In summary, the feedback command was: t u FB K P ( dt ot ) KV (dt ot ) , where uFt B0 if t 0. Model simulations were computed for five seconds at a rate of 1 kHz. The model parameters were: trajectory duration (dur, ms), internal model inertia (iIM, kg-m2), internal model damping (bIM, N-m-s/rad), plant inertia (ipl, kg-m2), plant damping (bpl, N-m-s/rad), feedback delay (Δ, ms), position feedback gain (KP, Nm/rad), and velocity feedback gain (Kv, N-m-s/rad). The same model framework was used to (1) determine specific parameter values in order to match observed behavior and (2) predict behavior under certain conditions given estimates of the parameters. Modeling control subject perturbations The first step in modeling the control subject perturbations was to estimate the duration of the desired trajectory. A constrained optimization (MATLAB, fmincon.m) was used to find the duration value (dur), which minimized the norm of residuals between the actual trajectory in the null condition and the modeled trajectory for the first 900 ms (referred to as the “fit period”, the same time window was used for all fits described below). The internal model parameters were assumed to equal the plant parameters because movements were smooth and accurate. Based on this assumption, the model did not produce any error and the feedback gains and delay were irrelevant. Thus, only one free parameter dur, was used to find the best fit. The best-fit value of dur is denoted as durnull, and used for predicting behavior in other conditions described below. The parameter values used for modeling null reaches can be summarized as: 2 Control null reaches (fit) iI M iP Lia rir mo b bI M bP Lba rbr mo b t K P KV u FB 0 600 dur 1300 Next, the average of the kinematics in the negative damping (-b) condition was used to estimate the feedback parameters (Kp, Kv, and Δ) for a given subject. Here we assumed movements were planned for the null condition, since perturbations were infrequent and unpredictable. Thus, the estimated duration (dur) and internal model parameters, iIM and bIM, were set to the same values as the null condition while the plant parameter bPL, was modified by bvir, which in this condition was -0.31 N-m-s/rad. The fmincon.m function was used to find the best-fit feedback parameter values. These best-fit values are denoted as Kp_-b Kv_-b, and Δ -b. In summary: Control -b reaches (fit) i IM i arm i rob i PL i arm i rob bIM barm brob bPL barm brob bvir dur durnul l Finally, the behavior in the other three perturbation conditions (+i, -i, +b) was predicted using the estimated trajectory duration (based on the null condition), feedback gains (based on the –b condition) and appropriate virtual dynamics. The plant parameters, iPL and bPL, were modified based on the perturbation type. The following parameters were used to predict movement kinematics in three of the four perturbation conditions: Control +i, -i, +b reaches (prediction) i IM i arm i rob i PL i arm i rob ivir bIM barm brob bPL barm brob bvir 3 K P K P _ b K V K V _ b b dur durnull Values for ivir and bvir are specified for the different perturbations in the Experiment 2 section above. Modeling patient null reaches As described in the results section, patient movement during null reaches resembled control subject reaches in the +i and –i perturbation conditions. Based on this finding, we attempted to model patient behavior as the result of an internal model bias of the inertia value (i.e. iIM ≠ iPL). Thus an internal model inertial bias, iδ, as well as dur, KP, Kv, and Δ were all determined by using fmincon.m to find the best fit of the average position trace for each patient. The parameters for modeling patient reaches due to inertial bias (i-fit) were: Patient null reaches (i-fit) iIM iarm irob i iPL iarm irob bIM barm brob bPL barm brob iPL i iPL 0 K P 10 0 KV 5 100 120 600 dur1300 For comparison, we modeled patient behavior in two other ways. First, due to an internal model bias of only the damping value (i.e. bIM ≠ bPL; labeled b-fit) and second, as a result of an internal model bias of both the damping and inertia values (i.e. iIM ≠ iPL, bIM ≠ bPL; labeled i&b-fit). The parameters for the b-fit and the i&b-fit models were the same as i-fit (described above) with the following exceptions: Patient null reaches (b-fit) iI M ia r m ir o b bI M ba r m br o b b bP L b bP L 4 Patient null reaches (i&b fit) i IM iarm i rob i bIM barm brob b i PL i i PL bPL b bPL Forward model-based command generator The forward model-based mathematical model was very similar to the inverse model-based controller described above. The motor command was computed by the command generator based on the internal model estimate of plant dynamics (iIM, bIM), a feed-forward gain KFF, and a desired trajectory (i.e. elbow angular position, velocity, and acceleration; θd, ωd, αd). In this scheme, the outgoing command is proportional to the difference between the desired position and the position predicted by the forward dynamic model. First, the output of the forward model (i.e. the predicted kinematics of the plant, θp, ωp, αp) was computed by integrating the following equation of motion: 𝑡 𝑡=0 𝑢𝐹𝐹 = 𝑏𝐼𝑀 𝜔𝑝𝑡+1 + 𝑖𝑝 𝛼𝑝𝑡+1 , where 𝑢𝐹𝐹 =0 The difference in predicted position and desired position is then used to compute the next motor command. 𝑡 𝑢𝐹𝐹 = 𝐾𝐹𝐹 (𝜃𝑑𝑡 − 𝜃𝑝𝑡 ) For fitting, the range of KFF was limited: 0 ≤ 𝐾𝐹𝐹 ≤ 1000 5