Calculation method and device for frequency characteristics of transfer function model in Modelica modeling environment

The method addresses the inability of Modelica to calculate frequency characteristics by defining transfer function coefficients and delay time, performing complex number operations, and visualizing results, enhancing control system design with frequency domain analysis.

CN114117807BActive Publication Date: 2025-07-15SUZHOU TONGYUAN SOFT CONTROL INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111445999.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2025-07-15
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

In the Modelica modeling environment, transfer function models cannot calculate frequency characteristics and lack effective solutions.

Method used

Through the Modelica language, the frequency characteristic calculation range and frequency point distribution are determined, the complex operator symbols are overloaded, the delay link is processed, and the trigonometric function form is converted, and the custom logarithmic coordinate system is visualized.

Benefits of technology

The frequency characteristic calculation of the transfer function model with delay links is realized in the Modelica modeling environment, and the complex operation results can be converted into amplitude and phase frequency characteristic data, and continuous processing and visualization are carried out.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114117807B_ABST
    Figure CN114117807B_ABST
Patent Text Reader

Abstract

The present application discloses a method and a device for calculating the frequency characteristics of a transfer function model in a Modelica modeling environment. The method includes defining the preset transfer function model based on the Modelica language; determining the frequency characteristic calculation range and the frequency point distribution; implementing the overloading of the operation symbols for complex number operations through the Modelica language to perform the operations on complex number data; after processing the delay link, performing complex number operations according to the frequency characteristic calculation range and the frequency point distribution; converting the results of the complex number operations into the amplitude-frequency characteristic data and the phase-frequency characteristic data of the system; performing continuous processing on the amplitude-frequency characteristic data and the phase-frequency characteristic data calculated at different frequency points, and realizing the visualization of the system frequency characteristics through a custom logarithmic coordinate system. The present application solves the technical problem that the transfer function model cannot calculate the frequency characteristics in the Modelica modeling environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Modelica control systems. Specifically, it relates to a method and device for calculating the frequency characteristics of a transfer function model in a Modelica modeling environment. Background Technique

[0002] For a system model constructed using the Modelica language, the time-domain response of the system can be obtained through simulation and solution, but the frequency characteristics of the system cannot be obtained. In fact, a transfer function model can be constructed through the Modelica standard library, and then a transfer function model with a delay link can be obtained by cascading a delay module. In the process of control system analysis and design, the calculation of the frequency characteristics of the transfer function model is essential as the basis for control law design.

[0003] Calculating the frequency characteristics of a transfer function model based on Modelica with a delay link will lay a necessary foundation for subsequent control system design.

[0004] Aiming at the problem that the frequency characteristics of the transfer function model cannot be calculated in the Modelica modeling environment in the related art, no effective solution has been proposed yet. Summary of the Invention

[0005] The main purpose of this application is to provide a method and device for calculating the frequency characteristics of a transfer function model in a Modelica modeling environment, so as to solve the problem that the frequency characteristics of the transfer function model cannot be calculated in the Modelica modeling environment.

[0006] To achieve the above purpose, according to one aspect of this application, a method for calculating the frequency characteristics of a transfer function model in a Modelica modeling environment is provided.

[0007] The method for calculating the frequency characteristics of the transfer function model according to this application includes: based on the definition of the preset transfer function model in the Modelica language, where the definition of the transfer function model includes the coefficients of the numerator and denominator of the transfer function and the definition of the delay time; determining the frequency characteristic calculation range and the frequency point distribution; implementing overloading of the operation symbols for complex number operations through the Modelica language to perform operations on complex number data; after processing the delay link, performing complex number operations according to the frequency characteristic calculation range and the frequency point distribution; converting the results of the complex number operations into the amplitude-frequency characteristic data and phase-frequency characteristic data of the system; performing continuous processing on the amplitude-frequency characteristic data and the phase-frequency characteristic data calculated at different frequency points, and realizing the visualization of the system frequency characteristics through a custom logarithmic coordinate system.

[0008] Furthermore, based on the definition of the preset transfer function model in Modelica language, wherein the definition of the transfer function model includes the coefficients of the numerator and denominator of the transfer function and the definition of the delay time:

[0009]

[0010] wherein, e -Ts represents the delay link, and T is the delay time.

[0011] Furthermore, the visualization of the system frequency characteristics through the custom logarithmic coordinate system further includes: using the logarithmic coordinate system of the Bode plot to visualize the system frequency characteristics.

[0012] Furthermore, the determination of the frequency characteristic calculation range and the frequency point distribution includes: determining the start frequency (rad / s) and end frequency (rad / s) of the frequency characteristics; determining the number of frequency points calculated within the frequency characteristic calculation range; and processing the number of frequency points according to the logarithmic distribution.

[0013] Furthermore, the overloading of the operation symbols for complex number operations is implemented through the Modelica language to perform operations on complex number data, including: implementing the overloading of the operation symbols for complex number operations through the Modelica language for performing complex number operations, wherein the operation symbols at least include the following functions: addition, subtraction, multiplication, division, and modulus.

[0014] Furthermore, after processing the delay link, complex number operations are performed according to the frequency characteristic calculation range and the frequency point distribution, including:

[0015] Converting the delay link into a trigonometric function form based on Euler's formula:

[0016] e -Ts | s=jω = e -Tjω = cos(-Tω) + j×sin(-Tω)

[0017] wherein, e -Ts represents the delay link, T is the delay time, and ω is the frequency;

[0018] Furthermore, convert the transfer function containing the delay link into a frequency characteristic function expression:

[0019]

[0020] According to the frequency characteristic calculation range and the number of calculation points, perform complex number operations and convert the calculation results into the amplitude-frequency characteristic and the phase-frequency characteristic of the system.

[0021] To achieve the above object, according to another aspect of the present application, there is provided a frequency characteristic calculation device for a transfer function model in a Modelica modeling environment.

[0022] The frequency characteristic calculation device for the transfer function model in the Modelica modeling environment according to the present application includes: a definition module for defining the preset transfer function model based on the Modelica language, wherein the definition of the transfer function model includes the coefficients of each term of the numerator and denominator of the transfer function and the definition of the delay time; a determination module for determining the frequency characteristic calculation range and the frequency point distribution; an operator overloading module for overloading the operation symbols of complex number operations through the Modelica language to perform operations on complex number data; a complex number operation module for performing complex number operations according to the frequency characteristic calculation range and the frequency point distribution after processing the delay link; a conversion module for converting the result of the complex number operation into the amplitude-frequency characteristic data and phase-frequency characteristic data of the system; a continuousization module for continuously processing the amplitude-frequency characteristic data and the phase-frequency characteristic data calculated at different frequency points and realizing the visualization of the system frequency characteristics through a custom logarithmic coordinate system.

[0023] To achieve the above object, according to yet another aspect of the present application, there is provided a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the method when running.

[0024] To achieve the above object, according to still another aspect of the present application, there is provided an electronic device including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the method.

[0025] In the embodiments of the present application, a method and a device for calculating the frequency characteristics of a transfer function model in a Modelica modeling environment. By using the Modelica language to define the preset transfer function model, determine the frequency characteristic calculation range and the frequency point distribution, and realizing the overloading of the operation symbols for complex number operations through the Modelica language to perform complex number data operations. After processing the delay link, complex number operations are performed according to the frequency characteristic calculation range and the frequency point distribution; the results of the complex number operations are converted into the amplitude-frequency characteristic data and phase-frequency characteristic data of the system, achieving the purpose of continuously processing the amplitude-frequency characteristic data and the phase-frequency characteristic data calculated at different frequency points and visualizing the system frequency characteristics through a custom logarithmic coordinate system. Thus, the technical effect of solving the frequency characteristic calculation method of a class of transfer function models with delay links in the Modelica modeling environment is realized, and further the technical problem that the transfer function model cannot calculate the frequency characteristics in the Modelica modeling environment is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The drawings constituting a part of this application are used to provide a further understanding of this application, making other features, objectives, and advantages of this application more obvious. The schematic embodiments of this application and their descriptions are used to explain this application and do not constitute an improper limitation to this application. In the drawings:

[0027] Figure 1 is a schematic diagram of the frequency characteristics of the method for calculating the frequency characteristics of a transfer function model in a Modelica modeling environment according to an embodiment of the present application;

[0028] Figure 2 is a schematic flowchart of the method for calculating the frequency characteristics of a transfer function model in a Modelica modeling environment according to an embodiment of the present application;

[0029] Figure 3 is a schematic structural diagram of the device for calculating the frequency characteristics of a transfer function model in a Modelica modeling environment according to an embodiment of the present application;

[0030] Figure 4 is a schematic flowchart of the method for calculating the frequency characteristics of a transfer function model in a Modelica modeling environment according to an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0031] To enable those skilled in the art to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without making creative efforts shall fall within the scope of protection of this application.

[0032] It should be noted that the terms "first", "second", etc. in the specification, claims and the above-mentioned drawings of this application are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so as to implement the embodiments of this application described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0033] In this application, the orientation or positional relationship indicated by the terms "upper", "lower", "left", "right", "front", "rear", "top", "bottom", "inner", "outer", "middle", "vertical", "horizontal", "lateral", "longitudinal", etc. is based on the orientation or positional relationship shown in the accompanying drawings. These terms are mainly used to better describe this application and its embodiments, and are not used to limit that the indicated devices, elements or components must have a specific orientation or be constructed and operated in a specific orientation.

[0034] Moreover, in addition to being able to represent an orientation or positional relationship, some of the above terms may also be used to represent other meanings. For example, the term "upper" may also be used to represent a certain attachment relationship or connection relationship in some cases. For those of ordinary skill in the art, the specific meanings of these terms in this application can be understood according to specific circumstances.

[0035] In addition, the terms "install", "set", "provided with", "connect", "connected", "socketed" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral structure; it can be a mechanical connection or an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or there can also be internal communication between two devices, elements or components. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0036] The inventors have found that, compared with the time-domain characteristics of a system, the frequency-domain characteristics can describe the system in a more in-depth manner. The reason why the frequency-domain response method is popular for designing the system control loop is as follows: Engineering systems are often difficult to be described by accurate mathematical models. When there are uncertainties in the model of the controlled object (such as a black-box model) or in unknown cases, the frequency-response method can provide good design effects; on the other hand, it is the easiest method for designing compensation links. The premise of control design based on the frequency-response method is to obtain the frequency characteristics of the system, that is, to perform frequency-domain analysis on the system. In classical control theory, a system can be described respectively in the time domain, the complex frequency domain, and the frequency domain. In the time domain, a system is described by a differential equation, which describes the behavior of a dynamic system with the time axis as the coordinate. The time-domain method is the most direct and intuitive way to describe a system; the complex frequency domain is to characterize the system by the system transfer function obtained after performing Laplace transform on the time-domain differential equation; while the frequency domain describes the system from different aspects. Frequency-domain analysis is more concise than time-domain analysis and can analyze the deeper inherent properties of the system. The time domain and the frequency domain are interrelated and complementary to each other.

[0037] It should be noted that, without conflict, the embodiments in this application and the features in the embodiments can be combined with each other. The following will describe this application in detail with reference to the drawings and in combination with the embodiments.

[0038] As Figure 1 shown, the frequency characteristics describe the steady-state response of a system to a sinusoidal signal. For a stable linear time-invariant system, when it is subjected to a sinusoidal excitation, the steady-state output of the system is a sinusoidal signal with the same frequency as the input signal, but there may be differences in amplitude and phase, as Figure 1 shown. The frequency characteristics include: amplitude-frequency characteristics (amplitude ratio), phase-frequency characteristics (phase difference), that is:

[0039]

[0040] When the frequency ω changes, the characteristics presented by the amplitude-frequency characteristics and the phase-frequency characteristics following the change of ω are the frequency characteristics of the system.

[0041] This application can calculate the frequency characteristics of the following transfer function model with a delay link in general form:

[0042]

[0043] where, e -Ts represents the delay link, and T is the delay time.

[0044] As Figure 2 shown, the method includes the following steps S201 to step S207:

[0045] Step S201: Based on the definition of the preset transfer function model in Modelica language, where the definition of the transfer function model includes the coefficients of the numerator and denominator of the transfer function and the definition of the delay time;

[0046] Step S202: Determine the frequency characteristic calculation range and the frequency point distribution;

[0047] Step S203: Construct the defined transfer function into a frequency characteristic transfer function expression;

[0048] Step S204: Implement operator overloading for complex number operations through Modelica language to perform operations on complex number data;

[0049] Step S205: After processing the delay link, perform complex number operations according to the frequency characteristic calculation range and the frequency point distribution;

[0050] Step S206: Perform complex number operations on the entire frequency characteristic function expression according to the frequency characteristic calculation range and the frequency point distribution;

[0051] Step S207: Convert the result of performing complex number operations on the frequency characteristic function expression to obtain the amplitude-frequency characteristic and phase-frequency characteristic of the system, which are the frequency characteristics of the system. Continuously process the amplitude-frequency characteristic data and the phase-frequency characteristic data calculated at different frequency points, and realize the visualization of the system frequency characteristics through a custom logarithmic coordinate system.

[0052] From the above description, it can be seen that the present application achieves the following technical effects:

[0053] By using the method of defining the preset transfer function model in Modelica language and determining the frequency characteristic calculation range and the frequency point distribution, implementing operator overloading for complex number operations through Modelica language to perform operations on complex number data, processing the delay link, and then performing complex number operations according to the frequency characteristic calculation range and the frequency point distribution; converting the result of the complex number operations into the amplitude-frequency characteristic data and the phase-frequency characteristic data of the system, the purpose of continuously processing the amplitude-frequency characteristic data and the phase-frequency characteristic data calculated at different frequency points and realizing the visualization of the system frequency characteristics through a custom logarithmic coordinate system is achieved, thereby achieving the technical effect of solving the frequency characteristic calculation method of a class of transfer function models with delay links in the Modelica modeling environment, and further solving the technical problem that the transfer function model cannot calculate the frequency characteristics in the Modelica modeling environment.

[0054] In the above step S201, the definition of the transfer function is implemented through Modelica language.

[0055] In a specific embodiment, the definition of the transfer function includes the coefficients of each term in the numerator and denominator of the transfer function and the definition of the delay time.

[0056] In a preferred embodiment, the definition of the preset transfer function model based on the Modelica language, wherein the definition of the transfer function model includes the coefficients of each term in the numerator and denominator of the transfer function, the definition of the delay time, including: the numerator and denominator coefficients, the delay time, the starting calculation frequency, the ending calculation frequency, and the number of calculation points in the definition of the preset transfer function model based on the Modelica language.

[0057] Determine the frequency characteristic calculation range and the frequency point distribution in the above step S202.

[0058] This step realizes the definition of the frequency characteristic calculation range and the frequency point distribution, specifically including the starting frequency (rad / s) and the ending frequency (rad / s) of the calculated frequency characteristics, and the number of frequency points calculated within this frequency range.

[0059] In a specific embodiment, the above number of frequency points will be processed in a logarithmic distribution.

[0060] In a preferred embodiment, for the transfer function definition and calculation settings, define the coefficients of the numerator and denominator of the transfer function, the delay time, the starting calculation frequency, the ending calculation frequency, and the number of calculation points based on the model parameter panel.

[0061] In the above step S203, further, construct the defined transfer function into a frequency characteristic transfer function expression.

[0062] In the above step S204, further, overload the operation symbols for complex number operations through the Modelica language to perform operations on complex number data.

[0063] By overloading the basic operators, including but not limited to addition, subtraction, multiplication, division, modulus, etc., that support complex number operations through the Modelica language, the relevant operations for complex numbers can be realized.

[0064] In a specific embodiment, the implementation of this step will be the core of the frequency characteristic calculation.

[0065] After processing the delay link in the above step S205, perform complex number operations according to the frequency characteristic calculation range and the frequency point distribution. In addition, process the delay link and convert the delay link into a trigonometric function form through Euler's formula.

[0066] In a preferred embodiment, after processing the delay link, complex operations are performed according to the calculated range of the frequency characteristics and the distribution of the frequency points, including:

[0067] Based on Euler's formula, convert the delay link into a trigonometric function form:

[0068] e -Ts | s=jω =e -Tjω =cos(-Tω)+j×sin(-Tω)

[0069] where e -Ts represents the delay link, T is the delay time, and ω is the frequency;

[0070] Convert the transfer function containing the delay link into a frequency characteristic function, and perform complex operations according to the calculated range of the frequency characteristics and the number of calculation points.

[0071] In the above step S206, complex operations are performed on the entire frequency characteristic function expression according to the calculated range of the frequency characteristics and the distribution of the frequency points.

[0072] In the above step S207, the result of performing complex operations on the frequency characteristic function expression is converted to obtain the amplitude-frequency characteristic and phase-frequency characteristic of the system, which are the frequency characteristics of the system. The amplitude-frequency characteristic data and phase-frequency characteristic data calculated at different frequency points are continuously processed, and the visualization of the system frequency characteristics is realized through a custom logarithmic coordinate system.

[0073] In a specific embodiment, the visualization of the system frequency characteristics is realized through a custom logarithmic coordinate system, that is, presented through a Bode plot.

[0074] In a preferred embodiment, the transfer function model includes: a transfer function model with a delay link, and the frequency characteristics of the transfer function model with a delay link are calculated:

[0075]

[0076] where e -Ts represents the delay link, and T is the delay time.

[0077] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0078] According to an embodiment of the present application, there is also provided a frequency characteristic calculation device of a transfer function model for implementing the above method in a Modelica modeling environment, as Figure 3 shown, the device includes:

[0079] A definition module 301, configured to define the preset transfer function model based on the Modelica language, where the definition of the transfer function model includes the coefficients of each term of the numerator and denominator of the transfer function and the definition of the delay time;

[0080] A determination module 302, configured to determine the frequency characteristic calculation range and the frequency point distribution;

[0081] An operator overloading module 303, configured to implement overloading of the operation symbols for complex number operations through the Modelica language to perform operations on complex number data;

[0082] A complex number operation module 304, configured to perform complex number operations on the overall frequency characteristic function expression obtained by converting the transfer function including the delay link after processing the delay link, according to the frequency characteristic calculation range and the frequency point distribution;

[0083] A conversion module 305, configured to convert the result of the complex number operation into the amplitude-frequency characteristic data and phase-frequency characteristic data of the system;

[0084] A continuousization module 306, configured to perform continuousization processing on the amplitude-frequency characteristic data and the phase-frequency characteristic data calculated at different frequency points, and implement visualization of the system frequency characteristics through a custom logarithmic coordinate system.

[0085] In the definition module 301 of the embodiment of the present application, the definition of the transfer function is implemented through the Modelica language.

[0086] In a specific implementation manner, the definition of the transfer function includes the definition of the coefficients of each term of the numerator and denominator of the transfer function and the delay time.

[0087] In a preferred implementation manner, the definition of the preset transfer function model based on the Modelica language, where the definition of the transfer function model includes the coefficients of each term of the numerator and denominator of the transfer function, the definition of the delay time, includes: the numerator and denominator coefficients, the delay time, the starting calculation frequency, the ending calculation frequency, and the number of calculation points in the definition of the preset transfer function model based on the Modelica language.

[0088] In the determination module 302 of the embodiment of the present application, the frequency characteristic calculation range and the frequency point distribution are determined.

[0089] This step realizes the definition of the calculation range and frequency point distribution of the frequency characteristics, specifically including the starting frequency (rad / s) and ending frequency (rad / s) of the calculated frequency characteristics, as well as the number of frequency points calculated within this frequency range.

[0090] In a specific embodiment, the above number of frequency points will be processed in a logarithmic distribution.

[0091] In a preferred embodiment, for the definition and calculation settings of the transfer function, based on the numerator and denominator coefficients, delay time, starting calculation frequency, ending calculation frequency, and number of calculations defined in the model parameter panel.

[0092] Furthermore, in the operator overloading module 303 of the embodiment of the present application, the overloading of the operation symbols for complex number operations is realized through the Modelica language to perform operations on complex number data.

[0093] By implementing the overloading of basic operators through the Modelica language, including but not limited to addition, subtraction, multiplication, division, modulo, etc., which support complex number operations, the relevant operations for complex numbers can be realized.

[0094] In a specific embodiment, the implementation of this step will be the core of the frequency characteristic calculation.

[0095] After the delay link is processed in the complex number operation module 304 of the embodiment of the present application, complex number operations are performed according to the frequency characteristic calculation range and the frequency point distribution. In addition, when processing the delay link, the delay link is converted into a trigonometric function form through Euler's formula.

[0096] In a preferred embodiment, after the delay link is processed, performing complex number operations according to the frequency characteristic calculation range and the frequency point distribution includes:

[0097] Converting the delay link into a trigonometric function form based on Euler's formula:

[0098] e -Ts | s=jω = e -Tjω = cos(-Tω) + j×sin(-Tω)

[0099] where, e -Ts represents the delay link, T is the delay time, and ω is the frequency;

[0100] Convert the transfer function containing the delay link into a frequency characteristic function expression, and according to the frequency characteristic calculation range and the number of calculations, perform complex number operations to convert the calculation results into the amplitude-frequency characteristic and the phase-frequency characteristic of the system.

[0101] In the conversion module 305 of the embodiment of the present application, the result of the complex number operation is converted into the amplitude-frequency characteristic data and phase-frequency characteristic data of the system.

[0102] The amplitude-frequency characteristic and phase-frequency characteristic data calculated at each frequency point are subjected to continuous processing to obtain curves of the amplitude-frequency characteristic and phase-frequency characteristic changing with frequency.

[0103] In the continuous processing module 306 of the embodiment of the present application, the amplitude-frequency characteristic data and phase-frequency characteristic data calculated at different frequency points are subjected to continuous processing, and the visualization of the system frequency characteristics is realized through a custom logarithmic coordinate system.

[0104] In a specific implementation manner, the visualization of the system frequency characteristics is realized through a custom logarithmic coordinate system, that is, presented through a Bode plot.

[0105] In a preferred implementation manner, the transfer function model includes: a transfer function model with a delay link, and the frequency characteristics of the transfer function model with a delay link are calculated:

[0106]

[0107] where, e -Ts represents the delay link, and T is the delay time.

[0108] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present application can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be implemented by program codes executable by the computing device, so that they can be stored in the storage device and executed by the computing device, or they can be separately made into individual integrated circuit modules, or multiple modules or steps of them can be made into a single integrated circuit module to be implemented. In this way, the present application is not limited to any specific combination of hardware and software.

[0109] In order to better understand the above-mentioned frequency characteristic calculation method flow of the transfer function model in the Modelica modeling environment, the above-mentioned technical solutions will be explained below in conjunction with preferred embodiments, but are not used to limit the technical solutions of the embodiments of the present invention.

[0110] The method for calculating the frequency characteristics of the transfer function model in the Modelica modeling environment in the embodiments of the present application is a method for calculating the frequency characteristics of a class of transfer function models with a delay link in the Modelica modeling environment. The proposed method is implemented through the Modelica language. Considering the distribution of the calculation frequency points of the model and its wide applicability, an intuitive and user-friendly parameter panel is designed for users to set calculation parameters, and the final calculation results are presented using Bode diagrams.

[0111] As Figure 4 shown, it is a schematic flowchart of the method for calculating the frequency characteristics of the transfer function model in the Modelica modeling environment in the embodiments of the present application.

[0112] Step S401, start.

[0113] Step S402, definition of the transfer function.

[0114] Step S403, definition of the frequency analysis range and distribution (N frequency points).

[0115] Step S404, construct the frequency characteristic expression G[jw(n).] at the frequency w(n).

[0116] Step S405, processing of the delay link.

[0117] Step S406, calculation of the amplitude-frequency / phase-frequency characteristics. Judge whether n < N. If not, enter step S407. If so, then n = n + 1 and return to step S404.

[0118] Step S407, continuous processing of the discrete amplitude-frequency / phase-frequency characteristics at each frequency point.

[0119] Step S408, create a logarithmic coordinate system and draw a Bode diagram.

[0120] Step S409, end.

[0121] The present application can implement the calculation of the frequency characteristics of the following transfer function model with a delay link in general form:

[0122]

[0123] where, e -Ts represents the delay link, and T is the delay time.

[0124] Implement the definition of the transfer function through the Modelica language, including the definition of the coefficients of the numerator and denominator of the transfer function and the delay time;

[0125] Define the calculation range and frequency point distribution of the frequency characteristics, specifically including the starting frequency (rad / s) and ending frequency (rad / s) of the calculated frequency characteristics, as well as the number of frequency points calculated within this frequency range. Here, the number of frequency points will be processed in logarithmic distribution;

[0126] Implement the overloading of basic operators (including addition, subtraction, multiplication, division, modulo, etc.) to support complex number operations through Modelica language, that is, implement relevant operations for complex numbers. The implementation of this step will be the core of the frequency characteristic calculation;

[0127] Process the delay link. Convert the delay link into a trigonometric function form through Euler's formula as follows:

[0128] e -Ts | s=jω =e -Tjω =cos(-Tω)+j×sin(-Tω)

[0129] Convert the transfer function containing the delay link into a frequency characteristic function, perform complex number operations according to the set calculation range and number of calculation points, and further convert the calculation results into the amplitude-frequency characteristic and phase-frequency characteristic of the system;

[0130] Continuously process the amplitude-frequency characteristic and phase-frequency characteristic data calculated at each frequency point to obtain the curves of the amplitude-frequency characteristic and phase-frequency characteristic changing with frequency;

[0131] Realize the visualization of the system frequency characteristics through a custom logarithmic coordinate system, that is, present it through a Bode plot.

[0132] The frequency characteristic calculation method for a class of transfer function models with delay in the Modelica modeling environment mainly includes the following processes:

[0133] S1, Load the model library (LinearSystemAnalysis.mo) implemented in this article and instantiate the Bode model.

[0134] S2, Transfer function definition and calculation settings. Define the numerator and denominator coefficients, delay time, starting calculation frequency, ending calculation frequency, and number of calculation points of the transfer function in the model parameter panel.

[0135] S3, Construction of the frequency characteristic function expression: Process the delay link and construct the frequency characteristic expression of the transfer function at each frequency point.

[0136] S4, Calculation of frequency characteristics: Through the implemented operator overloading, calculate the constructed frequency characteristic expression to obtain the amplitude-frequency characteristic and phase-frequency characteristic of the system at each frequency point.

[0137] S5, Continuous processing of frequency characteristic data: Continuously process the calculated frequency characteristics through Modelica language.

[0138] S6, Visual presentation: Customize the logarithmic coordinate system through the menu "Simulation" → "New Y(X) Curve Window", select Frequency of the calculation result as the custom X-axis, and the coordinate values of the X-axis represent powers of 10 respectively. For example, if the coordinate value is 1, it represents 10 1 rad / s. Present the amplitude-frequency characteristic and phase-frequency characteristic respectively.

[0139] The above are only the preferred embodiments of the present application and are not used to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for calculating the frequency characteristics of a transfer function model in a Modelica modeling environment, characterized in that including: defining the preset transfer function model based on the Modelica language, wherein the definition of the transfer function model includes the coefficients of the numerator and denominator of the transfer function and the definition of the delay time: Among them, e -Ts represents a delay link, and T is the delay time; determine the calculation range of the frequency characteristics and the distribution of frequency points; constructing the defined transfer function into a frequency characteristic function expression: implementing operator overloading for complex number operations through the Modelica language to perform operations on complex number data; after processing the delay link, performing complex number operations according to the frequency characteristic calculation range and the frequency point distribution; performing complex number operations on the entire frequency characteristic function expression according to the frequency characteristic calculation range and the frequency distribution points; converting the results of the complex number operations into the amplitude-frequency characteristic data and phase-frequency characteristic data of the system; continuously processing the amplitude-frequency characteristic data and phase-frequency characteristic data calculated at different frequency points and visualizing the system frequency characteristics through a custom logarithmic coordinate system; after processing the delay link, performing complex number operations according to the frequency characteristic calculation range and the frequency point distribution, including: converting the delay link into a trigonometric function form based on Euler's formula: Among them, e -Ts represents a delay link, T is the delay time, and ω is the frequency; converting the transfer function containing the delay link into a frequency characteristic function expression and performing complex number operations according to the frequency characteristic calculation range and the frequency point distribution: furthermore, converting the calculation results into the amplitude-frequency characteristic and phase-frequency characteristic of the system.

2. The method according to claim 1, wherein the visualizing the system frequency characteristics through a custom logarithmic coordinate system further includes: visualizing the system frequency characteristics using the logarithmic coordinate system of the Bode plot.

3. The method according to claim 1, characterized in that, determining the frequency characteristic calculation range and the frequency point distribution, including: determining the start frequency (rad / s) and end frequency (rad / s) of the frequency characteristic; determining the frequency point distribution calculated within the frequency characteristic calculation range; processing the frequency point distribution according to a logarithmic distribution.

4. The method according to claim 1, wherein implementing operator overloading for complex number operations through the Modelica language to perform operations on complex number data, including: implementing operator overloading for complex number operations through the Modelica language to perform complex number operations, wherein the operator at least includes the following functions: addition, subtraction, multiplication, division, and modulus.

5. A frequency characteristic calculation device of a transfer function model in a Modelica modeling environment, characterized in that including: a definition module for defining the preset transfer function model based on the Modelica language, wherein the definition of the transfer function model includes the coefficients of the numerator and denominator of the transfer function and the definition of the delay time; a determination module for determining the frequency characteristic calculation range and the frequency point distribution; an operator overloading module for implementing operator overloading for complex number operations through the Modelica language to perform operations on complex number data; a complex number operation module for performing complex number operations on the entire frequency characteristic function expression obtained by converting the transfer function containing the delay link after processing the delay link according to the frequency characteristic calculation range and the frequency point distribution; a conversion module for converting the results of the complex number operations into the amplitude-frequency characteristic data and phase-frequency characteristic data of the system; A continuousization module, configured to continuously process the amplitude-frequency characteristic data and the phase-frequency characteristic data calculated at different frequency points, and visualize the system frequency characteristics through a custom logarithmic coordinate system; After processing the delay link, complex number operations are performed according to the frequency characteristic calculation range and the frequency point distribution, including: Converting the delay link into a trigonometric function form based on Euler's formula: Among them, e -Ts represents a delay link, T is the delay time, and ω is the frequency; Converting the transfer function including the delay link into a frequency characteristic function expression, and performing complex number operations according to the frequency characteristic calculation range and the frequency point distribution: Furthermore, the calculation result is then converted into the amplitude-frequency characteristic and the phase-frequency characteristic of the system.

6. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute the method according to any one of claims 1 to 4 when running.

7. An electronic device, comprising a memory and a processor, characterized in that, A computer program is stored in the memory, and the processor is configured to run the computer program to execute the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Frequency characteristic estimation system and method of strong nonlinear Modelica system model

    CN109858170A