Innovators at NASA’s Dryden Flight Research Center have developed a method for resolving algebraic loops that occur in closed-loop systems when using MathWorks® Simulink® modeling and simulation tools. This variable fidelity method improves accuracy and reduces runtime significantly for users of Simulink Coder™ applications. This Dryden-derived method improves the Simulink Coder tool’s ability to more efficiently and quickly generate C code based on algorithms modeled in the simulation tool. By replacing transfer functions that require high sampling rates with embedded function integration schemes, users can achieve continuous transfer function accuracy at almost no computational cost. The innovation also enables computationally intensive block diagrams to run faster in real time and satisfies Nyquist frequency requirements in models. Algebraic loops are resolved through fast sampling, making the innovation especially applicable to high speed systems with saturation limits, dead-bands, and other constraints that create fast dynamics.
The innovation was designed to resolve algebraic loops in the Simulink Coder application, reduce simulation runtime, and at the same time achieve variable fidelity without changing base sampling rates. NASA engineers developed the method while working to autocode and run several different electrical system models for aircraft actuator dynamics on a single board processor. Problems occurred when the memory blocks required to reduce algebraic loops during system autocoding introduced a lag into the system that invalidated results. Conventional fixes (increasing sampling rate, introducing function generators) proved unworkable.
The Dryden-derived software innovation is unique in that it uses embedded MATLAB® code to resolve algebraic loops introduced during autocoding, achieving higher accuracies while running at the lower base sample rate (see Figures 1 and 2.)
|Figure 1. Simplified system illustrates innovation |
› View larger image
|Figure 2. Embedded Matlab function structure |
› View larger image
Discrete transfer functions tend to attenuate signals before their continuous counterparts. This may be problematic for designers who would like to replicate the continuous transfer function attenuation or other behavior exactly. This method presents a workaround, allowing users to iterate between the base step size, which effectively increases the Nyquist frequency of discrete transfer functions, and allowing accuracy in discrete systems comparable to continuous systems. By bypassing the Simulink tool’s complex methods for solving algebraic loops, designers can run computationally intensive systems at much faster rates while staying within the Simulink environment in order to accomplish autocoding and interact with all of the Simulink toolboxes. A demonstration model running at 100 kilohertz (kHz) with a base sample rate of 800 hertz (Hz) ran 13.4 times faster than an equivalent model solved using the Simulink tool.
Within Simulink, designers must resolve algebraic loops with memory blocks, which cause a time delay that can cause inaccuracies due to data sampling requirements. Workarounds such as function generators, rate transitions, atomic subsystems, and higher sampling rates are not successful for various reasons. When changing the sample rate, users sacrifice runtime. When changing the overall model, users may sacrifice accuracy. In either case, time is wasted in attempting to determine the best compromise. The Dryden method is most useful for increasing the accuracy of systems that require a boost in sampling rate above the base rate.
MathWorks, Simulink, and MATLAB are registered trademarks, and Simulink Coder (formerly Real-Time Workshop®) is a trademark of The MathWorks, Inc.
This technology is part of NASA’s Innovative Partnerships Office which seeks to transfer technology into and out of NASA to benefit the space program and U.S. industry. NASA invites companies to consider opportunities for partnership and usage of the Method for Resolving Algebraic Loops in Simulink with Variable Fidelity and Reduced Computational Time (DRC-009-027).