1: function RKError({yi,k}, {yi,k′ }, {tk})
2: κ← 0 3: for k = 1 : Nt do 4: hk← tk− tk−1 5: ev ← b1− ˆb1 y′ s,k−1 6: for i = 1 : s do 7: ev ← ev + bi+1− ˆbi+1 yi,k′ 8: end for 9: ǫk ← hkkevkW 10: κ ← max (κ, kevkW) 11: end for 12: for k = 1 : Nt do 13: ǫk ← κ−1ǫk 14: end for 15: return {ǫk} 16: end function as ys,k− ˆys,k = hp−1k (p − 1)!x (p−1)(t k) + O (hp) (5.68)
where x(p) is the pth derivative of the true solution at t
k starting from x (tk−1) = ys,k−1. In
fact, the error estimate in and of itself is not of much interest. One is typically most interested in the error relative to the solution. We will use the relative error ǫk as an indicator of the
local discretization error for time step k where,
ǫk= kys,k− ˆys,kkW
max
k kys,kkW
, (5.69)
and k · kW is the seminorm described in Chapter 4. Algorithm 5.3 contains a pseudo–code
implementation for calculating the error indicators.
the lower order solution. In point of fact, the numerical integration procedure is nearly always advanced using the higher order solution and the term “error estimate” is somewhat of a misnomer in this context. The choice of continuing with the higher order solution is sometimes referred to as local extrapolation. In this sense, the ǫk are not strictly related to
Chapter 6
Steady-State Analysis Algorithms
The general continuous time steady-state analysis problem can be stated in the following form:
Solve Cx′+ g (t, x) = f (t) , until x(t) = x (t + T ) .
(6.1)
We assume that f and g are periodic with period T and that a unique solution satisfying the constraint x (t) = x (t + T ) exists independent of x (0). Under these conditions, the problem statement of (6.1) is equivalent to the problem
Solve Cx′+ g (t, x) = f (t) , for t∈ [0, T ] ,
s.t. x(0) = x (T ) .
(6.2)
The statement (6.1) views continuous periodicity as the fundamental characteristic of the steady–state solution without regard to any fixed interval. For stable systems, this suggests simulating an initial–value problem over a sufficiently long interval so that the contribution of the transients to the solution is negligible. This is the approach taken by the transient analysis algorithms in Section 6.1.1.
On the other hand, (6.2) is more closely related to a boundary–value problem. Shooting- methods are general strategies for solving boundary value problems and are applicable to problems like (6.2) having periodic boundary–value constraints. The shooting–Newton method of Section 6.1.2 formulates the discrete problem in terms of a single nonlinear boundary–value problem that is solved using Newton’s method. For this reason, the strategy is sometimes referred to as the single shooting method. The direct multiple shooting method of Section 6.1.3 introduces degrees of freedom in the interior of the interval [0, T ] and solves a system of coupled boundary–value problems.
Returning to (6.1), the periodicity constraint on the solution suggests an approach dif- ferent to transient analysis. By assuming the solution can be expressed as a weighted sum of sinusoidal basis functions, the periodicity of the solution can be satisfied a priori. The problem then becomes one of finding weights that approximate the solution in some best sense. This leads to the harmonic balance method of Section 6.2.
The order of presentation of the algorithms in this chapter has been chosen for a particular reason. Transient analysis is the de facto standard for steady–state analysis because of the ease of implementation and understanding, despite it being the least efficient of the methods. The inefficiency of transient analysis is the result of simulation time increasing with the ratio of excitation period to time–constant. Magnetic devices in particular are designed to be excited with signals having periods much shorter than the natural time constants. This implies that many periods of transient analysis are required to converge to the steady-state solution.
Algorithmically, the single shooting method is very similar to transient analysis. The main difference is that at the end of every transient analysis period a correction is made to the solution based on the periodic boundary–value formulation of the problem. The multi- ple shooting method takes the boundary–value view of the problem adopted by the single shooting method and pushes it to the limit. The introduction of internal degrees of free- dom removes the need to perform transient analysis all together. The tradeoff is that it
becomes necessary to deal with a much larger system of equations. Although perhaps not obvious at first, the harmonic balance method is similar to the multiple shooting method in most respects. Whereas the multiple shooting method uses numerical integration tech- niques to approximate the solution derivatives, the harmonic balance method appeals to the frequency–domain to perform derivative calculations. The frequency domain derivative ap- proximation results in discrete solutions that are more accurate, but also endows the problem with a much more difficult structure.
The unifying difference between transient analysis and the other steady–state algorithms is that the later solved using Newton’s method. This requires the solution of a linear system at each Newton iteration. Direct methods are generally unsuitable for the solution of these problems. Therefore, we use the generalized minimum residual method (GMRES) to solve linear equations resulting from the Newton iteration, which is briefly described in Appendix A.
6.1
Time–Domain Methods
6.1.1
Transient Analysis
Transient analysis refers to the direct application of numerical integration techniques to analyze (4.72) as an initial value problem with initial condition x (0). Transient analysis can be used to determine the steady–state solution with arbitrary precision by letting t → ∞. In reality, one monitors the norm of the error between the solution shifted in time by one period, kx (t)−x (t − T ) k, and terminates the analysis when this error falls below a threshold ǫ. When n periods have been simulated, the approximate steady–state solution is taken to be the solution over the last period, x (t) for t ∈ [nT − T, nT ]. The tolerance ǫ determines how close the approximate solution is to the true steady–state solution. The initial condition x(0) is an input to the problem, ideally chosen as close as possible to the true steady–state solution.