C.29.2:5.4 - Obtain different computations from the same circuit relations
Model and questions. An ideal resistor and capacitor are connected in series to a voltage source. Let i flow toward the capacitor’s positive plate, v_R be the resistor’s voltage drop in that direction, and v_C the capacitor voltage. Use R = 10 ohm, C = 0.1 F and these relations:
v_s = v_R + v_C
v_R = R*i
i = C*dv_C/dt
The equalities do not assign a computational direction. One question supplies the source voltage and asks for current; another supplies a desired current and asks for the source voltage. Keep the component relations while changing which quantities are given and which must be obtained.
Voltage given: construct the trajectory and its readouts. Take constant v_s = 12 V and the initial condition v_C(0) = 2 V. Substitute the first two relations into the third:
dv_C/dt = (v_s - v_C)/(R*C).
The reduced differential state is v_C. Retain v_R = v_s - v_C and i = (v_s - v_C)/R as readout expressions, so eliminating those variables from the state does not remove the requested outputs.
Here tau = R*C = 1 s. Put z = v_s - v_C; then dz/dt = -z/tau and z(0) = 10 V. Thus z(t) = (10 V)*exp(-t/tau): differentiation gives dz/dt = -z/tau, and substitution at zero gives the prescribed initial value. Recover the original quantities as v_C = 12 V - z, v_R = z and i = z/R. At t = tau*ln(2), the exponential is 1/2, so the returned quantities are v_C = 7 V, v_R = 5 V and i = 0.5 A.
Current given: choose another computational dependency. Now require i(t) = 0.5 A and keep v_C(0) = 2 V; the source voltage is to be found. The same relations give dv_C/dt = i/C = 5 V/s, hence v_C(t) = 2 V + (5 V/s)*t. Then v_R = R*i = 5 V and v_s(t) = 7 V + (5 V/s)*t. At t = 0.1 s, return v_C = 2.5 V, v_R = 5 V and the required v_s = 7.5 V.
Release the earlier condition v_s = 12 V when making v_s an unknown. Keeping it would contradict the new question already at t=0, where the relations require v_s = 7 V. This change chooses another computation from the model; whether a source can deliver the resulting waveform is a C.29.3 question.
Structural reduction and numerical choice are separate. The substitutions remove algebraic unknowns and retain their reconstruction formulas under R,C > 0. They do not select a time-stepping algorithm. The closed form is adequate for the constant-voltage question above. A numerical variant could instead take a forward Euler step:
v_C_next = v_C + h*(v_s - v_C)/(R*C).
With h = 0.1 s, its first step gives v_C_next = 3 V, from which the readouts are v_R = 9 V and i = 0.9 A. The closed form gives v_C(0.1 s) = 12 V - (10 V)*exp(-0.1) ≈ 2.95162582 V; this step’s voltage error is about 0.04837418 V. Selecting a step rule and size therefore needs the requested accuracy. The exact elimination of v_R and i did not cause that time-discretization error.
Consistent initialization is another problem. In the voltage-given question, the prescribed v_C(0)=2 V and v_s(0)=12 V force v_R(0)=10 V, i(0)=1 A and dv_C/dt(0)=10 V/s. An initializer’s guess i(0)=0 A may be replaced while finding these values. Making i(0)=0 A an additional required condition instead contradicts the relations. The capacitor’s prescribed initial voltage represents an initial physical condition in this model. A starting guess guides numerical search; the resulting numerical approximation is assessed against the initial constraints and required accuracy.
For a larger differential-algebraic model, obtain the needed consistent-initialization, tearing or index-reduction Method from that discipline. Return the actual equations, givens, initial constraints and requested readouts with the unresolved question. A numerical initialization failure alone does not establish that the constraints are inconsistent; the contradiction in this small case follows from the displayed algebra.