  We develop a general description of how information propagates through a
magnetohydrodynamic (MHD) system based on the method of characteristics and use
that to formulate numerical boundary conditions (BCs) that are intrinsically
consistent with the MHD equations. Our formulation includes two major advances
for simulations of the Sun. First, we derive data-driven BCs that optimally
match the state of the plasma inferred from a time series of observations of a
boundary (e.g., the solar photosphere). Second, our method directly handles
random noise and systematic bias in the observations, and finds a solution for
the boundary evolution that is strictly consistent with MHD and maximally
consistent with the observations. We validate the method against a Ground Truth
(GT) simulation of an expanding spheromak. The data-driven simulation can
reproduce the GT simulation above the photosphere with high fidelity when
driven at high cadence. Errors progressively increase for lower driving cadence
until a threshold cadence is reached and the driven simulation can no longer
accurately reproduce the GT simulation. However, our characteristic formulation
of the BCs still requires adherence of the boundary evolution to the MHD
equations even when the driven solution departs from the true solution in the
driving layer. That increasing departure clearly indicates when additional
information at the boundary is needed to fully specify the correct evolution of
the system. The method functions even when no information about the evolution
of some variables on the lower boundary is available, albeit with a further
decrease in fidelity.
