JP2008243042A - Simulation device, method, and program for hybrid model - Google Patents

Simulation device, method, and program for hybrid model Download PDF

Info

Publication number
JP2008243042A
JP2008243042A JP2007085697A JP2007085697A JP2008243042A JP 2008243042 A JP2008243042 A JP 2008243042A JP 2007085697 A JP2007085697 A JP 2007085697A JP 2007085697 A JP2007085697 A JP 2007085697A JP 2008243042 A JP2008243042 A JP 2008243042A
Authority
JP
Japan
Prior art keywords
simulation
continuous system
system equation
equation
hybrid model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007085697A
Other languages
Japanese (ja)
Inventor
Mitsunobu Yoshida
充伸 吉田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2007085697A priority Critical patent/JP2008243042A/en
Publication of JP2008243042A publication Critical patent/JP2008243042A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To extract necessary information without imposing any load on simulation execution, and to intuitively grasp the behavior of a hybrid model program during simulation execution. <P>SOLUTION: A simulation device is provided with a simulation part for executing simulation by using a hybrid model having the description of continuous system equation and description related with the switching of the continuous equation accompanied with state transition; a map generation means for generating a map in which the ID of the continuous system equation and the description line of the continuous system equation are associated with each other by analyzing the hybrid model; and an information generation means for generating information showing whether the continuous system equation having the ID is valid or invalid in each simulation time in executing simulation, wherein the map and the information are presented for the verification of the hybrid model. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明はハイブリッドモデル内部の動作を可視化するためのハイブリッドモデル検証を行うためのハイブリッドモデルのシミュレーション装置、方法及びプログラムに関する。   The present invention relates to a hybrid model simulation apparatus, method, and program for performing hybrid model verification for visualizing operations inside the hybrid model.

現在、コンピュータを用いて機械やプラント等の挙動のシミュレーションを行う際に、ハイブリッドモデリングと呼ばれる手法が使われている。ハイブリッドモデルを用いたシミュレーションは「ハイブリッドシミュレーション」と呼ばれている。このようなシミュレーション挙動をするシステムを「ハイブリッドシステム」と呼ぶこともある。   Currently, a technique called hybrid modeling is used when simulating the behavior of a machine or plant using a computer. The simulation using the hybrid model is called “hybrid simulation”. A system having such a simulation behavior is sometimes called a “hybrid system”.

シミュレーションの目的で作成されるハイブリッドモデルは、概念的には常微分方程式や代数方程式を連立させた連立方程式によって表現される連続系モデルと、イベント発生に伴う状態遷移を表現するための状態遷移モデルとを組み合わせたモデルである。ハイブリッドモデルによれば、連続系モデルで表現される状態が外部からのイベントなどにより瞬時に切り替わるシステムを表現することができる。   The hybrid model created for the purpose of simulation is conceptually a continuous system model that is expressed by simultaneous equations that are a combination of ordinary differential equations and algebraic equations, and a state transition model for expressing state transitions associated with event occurrences. It is a model that combines. According to the hybrid model, it is possible to express a system in which the state expressed by the continuous system model is instantaneously switched by an event from the outside.

ハイブリッドモデルのソースファイルは、連続系の記述と離散系の記述とが混在して記述された、少なくとも一行以上の文字列で構成されるテキストデータである。   The source file of the hybrid model is text data composed of a character string of at least one line described with a mixture of a continuous system description and a discrete system description.

(従来の技術1)
ハイブリッドシステムに用いられるDCML(Dynamics Constraint Modeling Language)コンパイラとして、例えば特許文献1に記載のものが公知である。
(Prior art 1)
As a DCML (Dynamics Constraint Modeling Language) compiler used in a hybrid system, for example, the one described in Patent Document 1 is known.

上記従来のDCMLコンパイラには次のような問題点を解決することが必要とされる。すなわち、ハイブリッドモデルプログラムがモデル方程式登録プログラムとイベント処理プログラムに変換される過程でモデル方程式やイベント処理がハイブリッドモデル中のどの行を示すかなどの対応関係が失われてしまう。したがって、シミュレーションが実行される過程で、ハイブリッドモデルがどの順序で実行されているかを把握することできない。   The conventional DCML compiler is required to solve the following problems. That is, in the process of converting the hybrid model program into the model equation registration program and the event processing program, the correspondence relationship such as which line in the hybrid model the model equation and event processing indicate is lost. Therefore, in the process of executing the simulation, it is impossible to grasp in which order the hybrid model is executed.

そこで、モータやセンサなどの挙動を記述するハイブリッドモデルが正しく動作するか確認するために、
(1)シミュレーション結果ログを見て期待値と結果を比較する、
(2)モデルがモデル記述ルールに従っているかをコンパイラが判定する、
(3)ハイブリッドモデルプログラム(並列型プログラム)を逐次型プログラム(C言語のプログラム)に変換し、その動作を動的に確認する、といった方法を用いている。
Therefore, in order to confirm that the hybrid model describing the behavior of motors and sensors works correctly,
(1) Look at the simulation result log and compare the expected value with the result.
(2) The compiler determines whether the model complies with the model description rules.
(3) The hybrid model program (parallel program) is converted into a sequential program (C language program) and its operation is dynamically confirmed.

しかし、この方法ではシミュレーション実行中にハイブリッドモデルプログラムの挙動を直感的に把握することが困難であり、ハイブリッドモデルプログラムの作成に時間がかかってしまう。   However, with this method, it is difficult to intuitively understand the behavior of the hybrid model program during simulation execution, and it takes time to create the hybrid model program.

(従来の技術2)(HCCインタプリタ)
ハイブリッドモデル言語の原型はゼロックスパロアルト研究所で開発されたHCC(Hybrid Concurrent Constraint Programming)言語である。HCC言語はインタプリタにより逐次解釈を行いながら内部の変数状態などを表示するデバッガ機能を持つ。HCC言語が持つデバッガはインタプリタ内部に実装されており、ハイブリッドモデルを解析しながら実行することができる。また、インタプリタ内部の変数情報を標準出力することができ、比較的容易にハイブリッドモデル内部の状態を可視化することができる。
(Prior art 2) (HCC interpreter)
The prototype of the hybrid model language is HCC (Hybrid Concurrent Constraint Programming) language developed at the Xerox Palo Alto Research Institute. The HCC language has a debugger function that displays internal variable states and the like while sequentially interpreting with an interpreter. The debugger possessed by the HCC language is mounted inside the interpreter and can be executed while analyzing the hybrid model. Moreover, the variable information inside the interpreter can be output as standard, and the state inside the hybrid model can be visualized relatively easily.

上記従来のHCCインタプリタには次のような問題点がある。すなわち、ハイブリッドモデルプログラムをモデル方程式プログラム及びイベント処理プログラムに変換してからシミュレーションを行う場合には、オブジェクトコードに変換される過程でオブジェクトコードとハイブリッドモデルのソースコードとの対応関係を知ることができないという問題点がある。   The conventional HCC interpreter has the following problems. That is, when the simulation is performed after the hybrid model program is converted into the model equation program and the event processing program, the correspondence between the object code and the source code of the hybrid model cannot be known in the process of being converted into the object code. There is a problem.

(従来の技術3)(統合開発環境)
Eclipse(例えば、非特許文献1を参照)やVisual Studio(マイクロソフト(登録商標)社製品)など、パーソナルコンピュータや組込みプロセッサ上で動作可能なプログラムを開発する統合開発環境が提供されている。この統合開発環境はソースコードを表示するエディターやコンパイラを備えており、ソースコードをパーソナルコンピュータ上のプロセッサ上で実行可能なオブジェクトコードに変換することが可能である。
(Conventional technology 3) (Integrated development environment)
Integrated development environments for developing programs that can operate on personal computers and embedded processors, such as Eclipse (see, for example, Non-Patent Document 1) and Visual Studio (product of Microsoft (registered trademark)), are provided. This integrated development environment includes an editor and a compiler that display source code, and can convert the source code into object code that can be executed on a processor on a personal computer.

また統合開発環境はデバッガを備えており、デバッグに関する付加的な情報をコンパイラがオブジェクトコードに追加し、ユーザからのキーボード入力やマウス操作によってソースコードを一行ずつ実行するステップ実行機能を行うことが可能である。   The integrated development environment also includes a debugger, which allows the compiler to add additional information about debugging to the object code and perform a step execution function that executes the source code line by line by user keyboard input or mouse operation. It is.

ステップ実行時には、現在のプログラム有効ステップに対応したソースコードの行数をフラグで表示することができる。デバッガはプロセッサの動作をエミュレートする機能を内蔵しており、プロセッサが次に実行する機械語の命令を管理するプログラムカウンタに相当する機能と、機械語の命令とソースコードとの対応を管理し、実行中のソースコードの行数を、GUI(グラフィカルユーザインタフェース)を用いて表示することできる。   During step execution, the number of lines of source code corresponding to the current program valid step can be displayed as a flag. The debugger has a built-in function to emulate the operation of the processor, and manages the function corresponding to the program counter that manages the machine language instruction to be executed next by the processor and the correspondence between the machine language instruction and the source code. The number of lines of the source code being executed can be displayed using a GUI (Graphical User Interface).

しかし、従来の統合開発環境は、逐次型のプログラムをデバッグするためのデバッガ処理を行うものである。つまり、プロセッサ内部の動作を模擬する従来のデバッガの構成では、ハイブリッドモデルプログラムの連続系モデルのように同時に複数の行数が有効になる場合には利用することができない。また、従来のパーソナルコンピュータや組込みプロセッサ上で動作可能なプログラムを開発する統合開発環境に使われるデバッガでは、シミュレーション時刻を入力する手段を備えておらず、シミュレーション時刻を設定してそのときのハイブリッドモデルの動作状態を可視化することは当然ながら行えない。   However, the conventional integrated development environment performs a debugger process for debugging a sequential program. In other words, the conventional debugger configuration that simulates the internal operation of the processor cannot be used when a plurality of lines are valid at the same time as in the continuous model of the hybrid model program. In addition, a debugger used in an integrated development environment that develops a program that can run on a conventional personal computer or embedded processor does not have a means for inputting the simulation time, and the hybrid model at that time is set by setting the simulation time. Of course, it is not possible to visualize the operating state of.

(従来の技術4)
シミュレーションをしながら逐次型でないプログラム(Verilog−HDL言語やVHDL言語)をデバッグする統合開発環境としては、ModelSim(登録商標)や、Mentor Graphics社製)などがある。
特開2004−178300号公報 インターネットURL<www.eclipse.org>
(Prior art 4)
Examples of an integrated development environment for debugging a non-sequential program (Verilog-HDL language or VHDL language) while performing simulation include ModelSim (registered trademark) and Mentor Graphics.
JP 2004-178300 A Internet URL <www.eclipse.org>

本発明は、シミュレーション実行に大きな負荷をかけることなく必要な情報を取り出し、シミュレーション実行中のハイブリッドモデルプログラムの挙動を直感的に把握できるようにすることを目的とする。   It is an object of the present invention to extract necessary information without imposing a heavy load on simulation execution and to intuitively understand the behavior of a hybrid model program during simulation execution.

本発明の一態様に係るシミュレーション装置は、連続系方程式の記述と、状態遷移に伴う前記連続系方程式の切り替えに関する記述とを有するハイブリッドモデルを用いてシミュレーションを実行するシミュレーション部と、前記ハイブリッドモデルを解析することにより、連続系方程式のIDと、連続系方程式の記述行とを対応付けるマップを生成するマップ生成手段と、前記シミュレーションの実行時において、シミュレーション時刻毎に、前記IDを有する連続系方程式が有効であるか無効であるかを示す情報を生成する情報生成手段と、を具備し、前記マップ及び前記情報を前記ハイブリッドモデルの検証に供することを特徴とする。   A simulation apparatus according to an aspect of the present invention includes a simulation unit that executes a simulation using a hybrid model having a description of a continuous system equation and a description related to switching of the continuous system equation accompanying state transition, and the hybrid model By analyzing, a map generating means for generating a map for associating the ID of the continuous system equation and the description line of the continuous system equation, and the continuous system equation having the ID at each simulation time at the time of execution of the simulation. Information generating means for generating information indicating whether the map is valid or invalid, and the map and the information are used for verification of the hybrid model.

本発明によれば、シミュレーション実行に大きな負荷をかけることなく必要な情報を取り出し、シミュレーション実行中のハイブリッドモデルプログラムの挙動を直感的に把握できる。   According to the present invention, necessary information can be extracted without imposing a heavy load on the simulation execution, and the behavior of the hybrid model program during the simulation execution can be intuitively grasped.

(第1の実施形態)
図1は、第1乃至第3の実施形態に共通するシミュレーション装置を示すブロック図である。シミュレーション装置2000はシミュレーション部2014と方程式切り替え履歴表示部5000から構成される。シミュレーション部2014は、制御情報解析部2002と、イベント処理部2006と、方程式解析部2005と、連続系方程式切り替え部2010と、連続形シミュレーション部2008から構成される。本実施形態は一般的なコンピュータを用いて構成することができ、そのハードウェア構成としてCPU、メモリ、外部記憶装置、通信インタフェース、表示装置、キーボード、マウス等を備える。またこれらのハードウェアを制御するためのオペレーティングシステムを備える。本実施形態に係るシミュレーション装置はこのようなオペレーティングシステム上で動作するアプリケーションソフトとして実装することができる。
(First embodiment)
FIG. 1 is a block diagram showing a simulation apparatus common to the first to third embodiments. The simulation apparatus 2000 includes a simulation unit 2014 and an equation switching history display unit 5000. The simulation unit 2014 includes a control information analysis unit 2002, an event processing unit 2006, an equation analysis unit 2005, a continuous system equation switching unit 2010, and a continuous simulation unit 2008. This embodiment can be configured using a general computer, and includes a CPU, a memory, an external storage device, a communication interface, a display device, a keyboard, a mouse, and the like as a hardware configuration. An operating system for controlling these hardware is provided. The simulation apparatus according to the present embodiment can be implemented as application software that operates on such an operating system.

制御情報解析部2002は、ハイブリッドモデルプログラム2001から連続系方程式の記述とイベントに伴う状態遷移の制御情報の記述とを分離する。次に、イベントに伴う状態遷移の制御情報の記述から条件式とその条件式が成り立つ場合に成立する連続系方程式のID(識別子)及びこれに応じて無効になる連続系方程式のIDと関連けるテーブルを作成する。このテーブルに基づく情報がイベント処理プログラム2003として保存される。   The control information analysis unit 2002 separates the description of the continuous system equation and the description of the control information of the state transition accompanying the event from the hybrid model program 2001. Next, from the description of the control information of the state transition accompanying the event, the conditional expression and the ID (identifier) of the continuous system equation that is established when the conditional expression is satisfied, and the ID of the continuous system equation that becomes invalid according to this are related. Create a table. Information based on this table is stored as an event processing program 2003.

また制御情報解析部2002は、連続系方程式のIDと連続系方程式が記述されているハイブリッドモデルプログラム2001のファイル名、ディレクトリ名、連続系方程式に対応するハイブリッドモデルプログラム行番号を関連付けたテーブルを作成する。このテーブルにより表現される情報をファイルとして外部記憶装置に出力したものがマップファイル2011である。また制御情報解析部2002は、連続系方程式(オブジェクト)とIDの関係を示す情報を連続系方程式有効・無効情報ファイル2012として外部記憶装置に保存する。   In addition, the control information analysis unit 2002 creates a table in which the ID of the continuous system equation and the file name and directory name of the hybrid model program 2001 in which the continuous system equation is described are associated with the hybrid model program line number corresponding to the continuous system equation. To do. A map file 2011 is obtained by outputting the information represented by this table as a file to an external storage device. Further, the control information analysis unit 2002 stores information indicating the relationship between the continuous system equation (object) and the ID as a continuous system equation valid / invalid information file 2012 in the external storage device.

次に、ハイブリッドモデルプログラムの前処理について詳細に説明する。   Next, preprocessing of the hybrid model program will be described in detail.

ハイブリッドモデルプログラム2001は、まず制御情報解析部2002において処理され、モデル方程式登録プログラム2004、イベント処理プログラム2003、及びシミュレーション実行時付加処理プログラム(不図示)が生成される。   The hybrid model program 2001 is first processed in the control information analysis unit 2002 to generate a model equation registration program 2004, an event processing program 2003, and a simulation execution additional processing program (not shown).

ハイブリッドモデルシミュレーション装置を構成するソフトウェアモジュールとして、モデル方程式の登録を行うための関数及び連続系方程式を切り替えるための関数がAPI関数として提供される。モデル方程式登録プログラム2004およびイベント処理プログラム2003は、該当する上記API関数を呼び出す記述を、入力されたハイブリッドモデルプログラム2001に沿って適切に組み合わせたプログラムである。この観点から考えると、制御情報解析部2002は、入力をハイブリッドモデルプログラム2001とし、出力を例えばC言語のAPI関数呼び出しの記述を含むCプログラム(ソース)とするような、一種のコンパイラと考えることもできる。このようなモデル方程式登録プログラム2004とイベント処理プログラム2003は、さらにC言語などのコンパイラによりコンパイルされ、例えば実行時に動的にリンク可能なライブラリが生成される。ハイブリッドモデルシミュレーション装置では、シミュレーション実行にあたって、生成された動的リンクライブラリがリンクされ、入力ハイブリッドモデルを忠実に再現するシミュレーションプログラムが完成し、実行可能になる。なお、生成されるこれらのライブラリは必ずしも動的リンクライブラリである必要はなく、静的なライブラリであってもよい。   As a software module constituting the hybrid model simulation apparatus, a function for registering model equations and a function for switching continuous system equations are provided as API functions. The model equation registration program 2004 and the event processing program 2003 are programs in which descriptions for calling the corresponding API functions are appropriately combined in accordance with the input hybrid model program 2001. From this point of view, the control information analysis unit 2002 is considered as a kind of compiler in which the input is a hybrid model program 2001 and the output is a C program (source) including, for example, a C language API function call description. You can also. The model equation registration program 2004 and the event processing program 2003 are further compiled by a compiler such as C language, and a library that can be dynamically linked at the time of execution is generated. In the hybrid model simulation apparatus, when the simulation is executed, the generated dynamic link library is linked, and a simulation program that faithfully reproduces the input hybrid model is completed and can be executed. Note that these generated libraries are not necessarily dynamic link libraries, and may be static libraries.

ハイブリッドモデルシミュレーション装置のアプリケーションインターフェースを構成する具体的なソフトウェアモジュールの仕様などは様々考えられるが、ここでは説明の都合上、以下の3つのAPI関数が最低定義されているとする。なお、プログラミング言語はC言語とする。   Various specifications of the specific software module constituting the application interface of the hybrid model simulation apparatus can be considered. Here, for convenience of explanation, it is assumed that the following three API functions are defined at the minimum. The programming language is C language.

int XXX_AddEqnData(char *eqn, int *err)
int XXX_ActivateEqn(int eqnid)
int XXX_DeActivateEqn(int eqnid)
1つ目のAPI関数XXX_AddEqnDataは、1つの連続系方程式を表す文字列のポインタを引数に指定する。XXX_AddEqnDataは、この連続系方程式を構文解析し、連続系方程式の記述をシミュレーション実行可能なデータ構造(内部データ表現)に変換し、かかる内部データ表現を方程式データ記憶部2007に登録する処理を行う。なお、ここの連続系方程式には、ユニークなID番号が割り当てられる。たとえば「ab/cos(a−(c+b))−3c」という式が与えられたと仮定すると、木構造の内部データ表現を生成する。この木構造は、例えば線形多項式の親ノード(節)、掛け算のノード、割り算のノード、外部関数(四則演算以外の意)のノード、線形多項式を構成する各項のノードから構成される。本例において、木構造の葉に相当するものはすべて変数(a,b,c)であり、これらに実数の係数が加わって線形式となる。線形式はcosなどの外部関数の引数になったり、掛け算や割り算の対象となる。変数には、別途、値が確定しているかどうかのフラグが設けられており、またこのような木構造のデータに基づいて該変数の現在の値が保持される。木構造のすべての葉の値(すなわち変数の値)が確定していれば、式の値を計算することができる。方程式データ記憶部2007では、式の値の計算などを高速に行うことができるように、予め内部のデータ構造をつなぎ合わせて木構造を構成してある。上記処理において何らかのエラーが発生した場合には、errにエラーコードがセットされる。正常に処理が終了した場合は、登録された方程式のID番号を返り値とする。
int XXX_AddEqnData (char * eqn, int * err)
int XXX_ActivateEqn (int eqnid)
int XXX_DeActivateEqn (int eqnid)
The first API function XXX_AddEqnData designates a character string pointer representing one continuous system equation as an argument. XXX_AddEqnData parses the continuous system equation, converts the description of the continuous system equation into a data structure (internal data representation) that can be simulated, and registers the internal data representation in the equation data storage unit 2007. A unique ID number is assigned to the continuous system equation. For example, assuming that an expression “ab / cos (a− (c + b)) − 3c” is given, an internal data representation of a tree structure is generated. This tree structure includes, for example, a parent node (clause) of a linear polynomial, a node of multiplication, a node of division, a node of an external function (meaning other than four arithmetic operations), and a node of each term constituting the linear polynomial. In this example, all the leaves corresponding to the leaves of the tree structure are variables (a, b, c), and a real number coefficient is added to these to form a linear form. The line format becomes an argument of an external function such as cos, and is subject to multiplication or division. The variable is separately provided with a flag indicating whether or not the value is fixed, and the current value of the variable is held based on such tree-structured data. If the values of all the leaves of the tree structure (ie, the values of the variables) are fixed, the value of the expression can be calculated. In the equation data storage unit 2007, the internal data structure is connected in advance so that the value of the equation can be calculated at high speed. If any error occurs in the above process, an error code is set in err. When the process is normally completed, the ID number of the registered equation is used as a return value.

2番目のAPI関数XXX_ActivateEqnは、引数に指定された方程式のID番号に相当する方程式を有効にする。もし、すでに有効となっている方程式が指定されている場合には何もしない。返り値はエラーコードである。   The second API function XXX_ActivateEqn validates the equation corresponding to the ID number of the equation specified as the argument. If an already valid equation is specified, nothing is done. The return value is an error code.

3番目のAPI関数XXX_DeActivateEqnは、XXX_ActivateEqnとは逆に、引数に指定された方程式のID番号に相当する方程式を無効にする。すでに無効となっている方程式が指定された場合には何もしない。   In contrast to XXX_ActivateEqn, the third API function XXX_DeActivateEqn invalidates the equation corresponding to the ID number of the equation specified as the argument. Does nothing if an invalid equation is specified.

制御情報解析部2002は、まずXXX_AddEqnDataを必要な方程式について順に呼ぶ関数(InitEqnData)を生成する。これがモデル方程式登録プログラム2004(第1のプログラム)に相当する。   The control information analysis unit 2002 first generates a function (InitEqnData) that sequentially calls XXX_AddEqnData for a necessary equation. This corresponds to the model equation registration program 2004 (first program).

また、制御情報解析部2002は、シミュレーション実行の際に、時間がΔt進むごとに条件のチェックおよび方程式の切り替えを行う関数(ChangeEqn)も生成する。これはイベント処理プログラム2003(第2のプログラム)に相当する。   In addition, the control information analysis unit 2002 also generates a function (ChangeEqn) that performs condition checking and equation switching every time the time advances by Δt during simulation execution. This corresponds to the event processing program 2003 (second program).

上記したような制御情報解析部2002における処理により、例えば、図5のようなハイブリッドモデルプログラム2001はL07-L09、L15-17の変数a,b,xの接頭語としてそれぞれL21の変数名「motor1.」、L22の変数名「motor2.」を付け、更にL21の一番目の引き数2をa0に、二番目の引数0.1を「b0」、L22の一番目の引き数2を「a0」に、二番目の引数0.1を「b0」、に置換することで、
motor1.a=2,
motor1.b=0.1,
motor1.x=0,
motor1.x’=0,
always motor1.a’=0,
always motor1.b’=0,
always motor1.x’’= motor1.b*( motor1.a- motor1.x’),
motor2.a=2,
motor2.b=0.1,
motor2.x=0,
motor2.x’=0,
always motor2.a’=0,
always motor2.b’=0,
always motor2.x’’= motor2.b*( motor2.a- motor2.x’)
のようにテキスト変換を行い、更に以下のようなC言語のソースプログラムが自動生成される。
By the processing in the control information analysis unit 2002 as described above, for example, the hybrid model program 2001 as shown in FIG. 5 uses the variable names “motor1” of L21 as prefixes of the variables a, b, and x of L07-L09 and L15-17, respectively. . ”, L22 variable name“ motor2. ”, L21's first argument 2 to a0, second argument 0.1 to“ b0 ”, L22's first argument 2 to“ a0 ” , By replacing the second argument 0.1 with “b0”,
motor1.a = 2,
motor1.b = 0.1,
motor1.x = 0,
motor1.x '= 0,
always motor1.a '= 0,
always motor1.b '= 0,
always motor1.x '' = motor1.b * (motor1.a- motor1.x '),
motor2.a = 2,
motor2.b = 0.1,
motor2.x = 0,
motor2.x '= 0,
always motor2.a '= 0,
always motor2.b '= 0,
always motor2.x '' = motor2.b * (motor2.a-motor2.x ')
Then, the text conversion is performed and the following C language source program is automatically generated.

static char eqn1[]="motor1.a=2";
static char eqn2[]="motor1.b=0.1";
static char eqn3[]="motor1.x=0";
static char eqn4[]="motor1.x’=0";
static char eqn5[]="motor1.a’=0";
static char eqn6[]="motor1.b’=0";
static char eqn7[]="motor1.x’’= motor1.b*( motor1.a- motor1.x’)";
static char eqn8[]="motor2.a=2";
static char eqn9[]="motor2.b=0.1";
static char eqn10[]="motor2.x=0";
static char eqn11[]="motor2.x’=0";
static char eqn12[]="motor2.a’=0";
static char eqn13[]="motor2.b’=0";
static char eqn14[]="motor2.x’’= motor2.b*( motor2.a- motor2.x’)";
static int eqn1id;
static int eqn2id;
static int eqn3id;
static int eqn4id;
static int eqn5id;
static int eqn6id;
static int eqn7id;
static int eqn8id;
static int eqn9id;
static int eqn10id;
static int eqn11id;
static int eqn12id;
static int eqn13id;
static int eqn14id;
int InitEqnData()
{
int err;
eqn1id = XXX_AddEqnData(eqn1, &err);
if(err!=0)return err;
eqn2id = XXX_AddEqnData(eqn2, &err);
if(err!=0)return err;
eqn3id = XXX_AddEqnData(eqn3, &err);
if(err!=0)return err;
eqn4id = XXX_AddEqnData(eqn4, &err);
if(err!=0)return err;
eqn5id = XXX_AddEqnData(eqn5, &err);
if(err!=0)return err;
eqn6id = XXX_AddEqnData(eqn6, &err);
if(err!=0)return err;
eqn7id = XXX_AddEqnData(eqn7, &err);
if(err!=0)return err;
eqn8id = XXX_AddEqnData(eqn8, &err);
if(err!=0)return err;
eqn9id = XXX_AddEqnData(eqn9, &err);
if(err!=0)return err;
eqn10id = XXX_AddEqnData(eqn10, &err);
if(err!=0)return err;
eqn11id = XXX_AddEqnData(eqn11, &err);
if(err!=0)return err;
eqn12id = XXX_AddEqnData(eqn12, &err);
if(err!=0)return err;
eqn13id = XXX_AddEqnData(eqn13, &err);
if(err!=0)return err;
eqn14id = XXX_AddEqnData(eqn14, &err);
if(err!=0)return err;
}
int ChangeEqn()
{
int err;
if(getCurrentTime()==0){
XXX_ActivateEqn(eqn1id);
XXX_ActivateEqn(eqn2id);
XXX_ActivateEqn(eqn3id);
XXX_ActivateEqn(eqn4id);
XXX_ActivateEqn(eqn8id);
XXX_ActivateEqn(eqn9id);
XXX_ActivateEqn(eqn10id);
XXX_ActivateEqn(eqn11id);
}else{
XXX_DeActivateEqn(eqn1id);
XXX_DeActivateEqn(eqn2id);
XXX_DeActivateEqn(eqn3id);
XXX_DeActivateEqn(eqn4id);
XXX_DeActivateEqn(eqn8id);
XXX_DeActivateEqn(eqn9id);
XXX_DeActivateEqn(eqn10id);
XXX_DeActivateEqn(eqn11id);
}
XXX_ActivateEqn(eqn5id);
XXX_ActivateEqn(eqn6id);
XXX_ActivateEqn(eqn7id);
XXX_ActivateEqn(eqn12id);
XXX_ActivateEqn(eqn13id);
XXX_ActivateEqn(eqn14id);
}
なおgetCurretnTime()関数は、現在のシミュレーション時刻を取得するAPIである。
static char eqn1 [] = "motor1.a = 2";
static char eqn2 [] = "motor1.b = 0.1";
static char eqn3 [] = "motor1.x = 0";
static char eqn4 [] = "motor1.x '= 0";
static char eqn5 [] = "motor1.a '= 0";
static char eqn6 [] = "motor1.b '= 0";
static char eqn7 [] = "motor1.x '' = motor1.b * (motor1.a- motor1.x ')";
static char eqn8 [] = "motor2.a = 2";
static char eqn9 [] = "motor2.b = 0.1";
static char eqn10 [] = "motor2.x = 0";
static char eqn11 [] = "motor2.x '= 0";
static char eqn12 [] = "motor2.a '= 0";
static char eqn13 [] = "motor2.b '= 0";
static char eqn14 [] = "motor2.x" = motor2.b * (motor2.a-motor2.x ') ";
static int eqn1id;
static int eqn2id;
static int eqn3id;
static int eqn4id;
static int eqn5id;
static int eqn6id;
static int eqn7id;
static int eqn8id;
static int eqn9id;
static int eqn10id;
static int eqn11id;
static int eqn12id;
static int eqn13id;
static int eqn14id;
int InitEqnData ()
{
int err;
eqn1id = XXX_AddEqnData (eqn1, &err);
if (err! = 0) return err;
eqn2id = XXX_AddEqnData (eqn2, &err);
if (err! = 0) return err;
eqn3id = XXX_AddEqnData (eqn3, &err);
if (err! = 0) return err;
eqn4id = XXX_AddEqnData (eqn4, &err);
if (err! = 0) return err;
eqn5id = XXX_AddEqnData (eqn5, &err);
if (err! = 0) return err;
eqn6id = XXX_AddEqnData (eqn6, &err);
if (err! = 0) return err;
eqn7id = XXX_AddEqnData (eqn7, &err);
if (err! = 0) return err;
eqn8id = XXX_AddEqnData (eqn8, &err);
if (err! = 0) return err;
eqn9id = XXX_AddEqnData (eqn9, &err);
if (err! = 0) return err;
eqn10id = XXX_AddEqnData (eqn10, &err);
if (err! = 0) return err;
eqn11id = XXX_AddEqnData (eqn11, &err);
if (err! = 0) return err;
eqn12id = XXX_AddEqnData (eqn12, &err);
if (err! = 0) return err;
eqn13id = XXX_AddEqnData (eqn13, &err);
if (err! = 0) return err;
eqn14id = XXX_AddEqnData (eqn14, &err);
if (err! = 0) return err;
}
int ChangeEqn ()
{
int err;
if (getCurrentTime () == 0) {
XXX_ActivateEqn (eqn1id);
XXX_ActivateEqn (eqn2id);
XXX_ActivateEqn (eqn3id);
XXX_ActivateEqn (eqn4id);
XXX_ActivateEqn (eqn8id);
XXX_ActivateEqn (eqn9id);
XXX_ActivateEqn (eqn10id);
XXX_ActivateEqn (eqn11id);
} else {
XXX_DeActivateEqn (eqn1id);
XXX_DeActivateEqn (eqn2id);
XXX_DeActivateEqn (eqn3id);
XXX_DeActivateEqn (eqn4id);
XXX_DeActivateEqn (eqn8id);
XXX_DeActivateEqn (eqn9id);
XXX_DeActivateEqn (eqn10id);
XXX_DeActivateEqn (eqn11id);
}
XXX_ActivateEqn (eqn5id);
XXX_ActivateEqn (eqn6id);
XXX_ActivateEqn (eqn7id);
XXX_ActivateEqn (eqn12id);
XXX_ActivateEqn (eqn13id);
XXX_ActivateEqn (eqn14id);
}
The getCurretnTime () function is an API that acquires the current simulation time.

以上のプログラムは、上述したようにC言語コンパイラによってコンパイルされ、さらに動的リンクライブラリの形式に整えられ、実行時にリンクされる。   The above programs are compiled by a C language compiler as described above, further arranged in the form of a dynamic link library, and linked at the time of execution.

なお、本実施形態では、プログラム言語としてC言語を用いた例について説明したが、本発明はこれに限定されるものではなく、例えばC++言語、SpecC言語等の他のプログラム言語を用いてもよい。   In this embodiment, an example in which the C language is used as the programming language has been described. However, the present invention is not limited to this, and other programming languages such as a C ++ language and a SpecC language may be used. .

シミュレーション実行時には、連続系方程式切り替え部2010は定期的にイベント処理プログラム2003中の条件式を評価し、条件式が成立した場合には該当する連続系方程式IDについて、連続系方程式を有効化または無効化するためのAPI(Application Program Interface)関数を呼び出す。また各シミュレーション時刻においては、登録されているすべての連続系方程式IDについて該当する連続系方程式が有効化されているか無効化されているかを判定するAPI関数を呼び出し、その判定情報を得て、シミュレーション時刻と組み合わせて連続系方程式有効・無効情報ファイル2012として外部記憶装置に保存する。   When executing the simulation, the continuous system equation switching unit 2010 periodically evaluates the conditional expression in the event processing program 2003, and when the conditional expression is satisfied, enables or disables the continuous system equation for the corresponding continuous system equation ID. API (Application Program Interface) function is called. At each simulation time, an API function for determining whether the corresponding continuous system equation is validated or invalidated for all the registered continuous system equations ID is called, and the determination information is obtained to perform simulation. The continuous system equation valid / invalid information file 2012 is saved in the external storage device in combination with the time.

図2は方程式切り替え履歴表示部5000を示すブロック図である。方程式切り替え履歴表示部5000は表示時刻入力装置1100と、連続系方程式有効行処理装置5001と、記述データ表示装置5002と、連続系方程式有効行表示装置から構成される。   FIG. 2 is a block diagram showing the equation switching history display unit 5000. The equation switching history display unit 5000 includes a display time input device 1100, a continuous system equation valid row processing device 5001, a description data display device 5002, and a continuous system equation valid row display device.

表示時刻入力装置1100では連続系方程式有効・無効情報ファイル2012からシミュレーション時刻の最小値と最大値とを読み取る。表示時刻入力装置1100はグラフィカルユーザインタフェース(GUI)画面を持ち、設定可能なシミュレーション時刻の最小値と最大値内で任意のシミュレーション時刻を選択できるようになっている。入力されたシミュレーション時刻情報は連続系方程式有効行処理装置5001に送られる。   The display time input device 1100 reads the minimum and maximum values of the simulation time from the continuous system equation valid / invalid information file 2012. The display time input device 1100 has a graphical user interface (GUI) screen, and can select an arbitrary simulation time within the minimum and maximum values of the simulation time that can be set. The input simulation time information is sent to the continuous system equation effective row processing device 5001.

連続系方程式有効行処理装置5001は、連続系方程式有効・無効情報ファイル2012及びマップファイル2011を外部記憶装置から読み込む。連続系方程式有効・無効情報ファイル2012から、入力されたシミュレーション時刻におけるすべて連続系方程式のIDとその有効・無効の判定情報を読み込む。有効な連続系方程式のIDはマップファイル2011を用いて、該当するファイル名、ディレクトリ名、行番号を取得することができる。   The continuous system equation valid row processing device 5001 reads the continuous system equation valid / invalid information file 2012 and the map file 2011 from the external storage device. From the continuous system equation valid / invalid information file 2012, the ID of all continuous system equations at the input simulation time and the valid / invalid determination information thereof are read. The ID of a valid continuous system equation can be obtained by using the map file 2011 to obtain the corresponding file name, directory name, and line number.

記述データ表示装置5002は、ハイブリッドモデルプログラム2001を読み込みそのデータ記述をグラフィカルユーザインタフェース(GUI)画面に表示する。記述データ表示装置5002はデータ記述の行番号と、その行が表示されている画面の位置情報とを管理している。連続系方程式有効行表示装置5004は記述データ表示装置5002で指定されたハイブリッドモデルプログラム2001のファイル名及びディレクトリ名が一致するときに、記述データ表示装置5002から有効な連続系方程式の行番号に対応する画面の位置情報を取得し、連続系方程式有効行表示装置5004が持つGUI画面内の連続系方程式の行番号に対応する画面の位置に隣接する位置にフラグを表示する。   The description data display device 5002 reads the hybrid model program 2001 and displays the data description on a graphical user interface (GUI) screen. The description data display device 5002 manages the line number of the data description and the position information of the screen on which the line is displayed. The continuous system equation valid line display device 5004 corresponds to the line number of the effective continuous system equation from the description data display device 5002 when the file name and directory name of the hybrid model program 2001 specified by the description data display device 5002 match. The position information of the screen to be acquired is acquired, and a flag is displayed at a position adjacent to the position of the screen corresponding to the line number of the continuous system equation in the GUI screen of the continuous system equation valid line display device 5004.

図3は第1乃至第3の実施形態に共通するシミュレーション部2014の動作手順を示すフローチャート、図4は第1の実施形態に係る方程式履歴表示部5000の動作手順を示すフローチャート、図5は制御情報解析部2002に呼ばれるハイブリッドモデルプログラム2001の一例を示す図である。   FIG. 3 is a flowchart showing an operation procedure of the simulation unit 2014 common to the first to third embodiments, FIG. 4 is a flowchart showing an operation procedure of the equation history display unit 5000 according to the first embodiment, and FIG. It is a figure which shows an example of the hybrid model program 2001 called by the information analysis part 2002. FIG.

図3に示すように、まず、制御情報解析部2002はハイブリッドモデルプログラム2001を入力して構文解析する(ステップ3001)。制御情報解析部2002はハイブリッドモデルプログラム2001の構文解析結果から、イベント処理プログラム2003及びモデル方程式登録プログラム2004を生成する。シミュレーション部2014を構成するソフトウェアモジュールとして、モデル方程式の登録を行うための関数及び連続系方程式を切り替えるための関数がAPI(Application Program Interface)関数として提供される。イベント処理プログラム2003及びモデル方程式登録プログラム2004は、該当する上記API関数を呼び出す記述を、入力されたハイブリッドモデルプログラム2001に沿って適切に組み合わせたプログラムである。イベント処理プログラム2003及びモデル方程式登録プログラム2004は、C言語などのコンパイラによりコンパイルされ、例えば実行時に動的にリンク可能なライブラリが生成される。   As shown in FIG. 3, first, the control information analysis unit 2002 inputs the hybrid model program 2001 and performs syntax analysis (step 3001). The control information analysis unit 2002 generates an event processing program 2003 and a model equation registration program 2004 from the syntax analysis result of the hybrid model program 2001. As software modules constituting the simulation unit 2014, a function for registering model equations and a function for switching continuous system equations are provided as API (Application Program Interface) functions. The event processing program 2003 and the model equation registration program 2004 are programs in which descriptions for calling the corresponding API functions are appropriately combined in accordance with the input hybrid model program 2001. The event processing program 2003 and the model equation registration program 2004 are compiled by a compiler such as C language, and for example, a library that can be dynamically linked at the time of execution is generated.

シミュレーション2014部は、シミュレーション実行の際に、生成された動的リンクライブラリをリンクし、これにより入力ハイブリッドモデルを忠実に再現するシミュレーションプログラムが完成して実行可能になる。その実行時には、まず方程式解析部2005を起動するAPI関数が呼ばれ、その後に連続系切り替えのAPI関数群が実行されてシミュレーションは遂行される。   When the simulation is executed, the simulation 2014 unit links the generated dynamic link library, thereby completing and executing a simulation program that faithfully reproduces the input hybrid model. At the time of execution, an API function for starting the equation analysis unit 2005 is first called, and then a continuous system switching API function group is executed to perform a simulation.

イベント処理プログラム2003は、シミュレーション実行の際に、時間がΔt進むごとに条件のチェック及び方程式の変更(入れ替え)を行う関数(ChangeEqn)を生成する。モデル方程式登録プログラム2004は、連続系方程式の記述の構文解析結果に基づいており、同記述をシミュレーション実行可能なデータ構造に変換するとともに方程式データ記憶部2007に登録する(ステップ3002)。   The event processing program 2003 generates a function (ChangeEqn) that performs a condition check and equation change (replacement) every time the time advances by Δt during simulation execution. The model equation registration program 2004 is based on the syntax analysis result of the description of the continuous system equation, converts the description into a data structure that can be simulated, and registers it in the equation data storage unit 2007 (step 3002).

次に、制御情報解析部2002は、上述したようにマップファイル2011を生成し(ステップ3003)、連続系方程式有効・無効情報ファイル2012を生成する(ステップ3004)。マップファイル2011および、連続系方程式有効・無効情報ファイル2012は外部記憶装置に保存される。   Next, the control information analysis unit 2002 generates the map file 2011 as described above (step 3003), and generates the continuous system equation valid / invalid information file 2012 (step 3004). The map file 2011 and the continuous system equation valid / invalid information file 2012 are stored in an external storage device.

シミュレーション実行の段階において、図示しない機構制御ソフトウエアシミュレータ等から与えられる制御信号の受信処理を行う(ステップ3005)。ここで、必要であれば、受信した制御信号に基づく値を適宜、変数に代入する。次に、状態変化の必要有無をステップ3006において判定する。状態変化が必要な場合、連続系方程式切り替え部2010は、該当する連続系方程式について、その有効・無効のフラグを操作することにより連続系方程式の切り替えを行なう(ステップ3007)。この場合、連続系方程式切り替え部2010は、連続系方程式有効・無効情報ファイル2012への情報追加も行う(ステップ3008)。   In the simulation execution stage, a control signal received from a mechanism control software simulator (not shown) is received (step 3005). Here, if necessary, a value based on the received control signal is appropriately substituted into a variable. Next, it is determined in step 3006 whether or not a state change is necessary. When the state change is necessary, the continuous system equation switching unit 2010 switches the continuous system equation by operating the valid / invalid flag for the corresponding continuous system equation (step 3007). In this case, the continuous system equation switching unit 2010 also adds information to the continuous system equation valid / invalid information file 2012 (step 3008).

次に、連続系シミュレーション部2008は数値積分を実行する(ステップ3009)。   Next, the continuous system simulation unit 2008 performs numerical integration (step 3009).

そして、ステップ3010にて終了判断を行ったのち、所定の終了条件が成立するまでシミュレーション時刻を1ステップ進め(ステップ3011)、ステップ3005以降の処理手順を繰り返すことによりシミュレーション実行が行われる。   Then, after the end determination is made in step 3010, the simulation time is advanced by one step until a predetermined end condition is satisfied (step 3011), and the simulation is executed by repeating the processing procedure after step 3005.

図4に示すように、第1の実施形態に係る方程式履歴表示部5000は、まずマップファイル2011及び連続系方程式有効・無効情報ファイル2012を外部記憶装置から読み込む(ステップ4001,4002)。次に、フラグ表示時刻を入力する(ステップ4003)。次に、入力されたフラグ表示時刻での有効行番号を取得し(ステップ4004)、対応する有効行番号及びそのフラグを表示する(ステップ4005)。   As shown in FIG. 4, the equation history display unit 5000 according to the first embodiment first reads the map file 2011 and the continuous system equation valid / invalid information file 2012 from the external storage device (steps 4001 and 4002). Next, the flag display time is input (step 4003). Next, the effective line number at the input flag display time is acquired (step 4004), and the corresponding effective line number and its flag are displayed (step 4005).

図5に示すように、L01からL20では連続系方程式の記述とイベントに伴う状態遷移の制御情報の記述を型(クラス)として宣言している。L21、L22ではこの型の実体を宣言している。L07-L09及びL15-17は連続系の記述に対応する型の情報である。L13はイベントに伴う状態遷移の制御情報の記述に基づく型の情報であり、すべてのシミュレーション時刻で条件が有効であることを表す。L07-L09は型が実体化されるときに一度だけ有効になる行であり、シミュレーション時刻がゼロの時に限り有効である。   As shown in FIG. 5, in L01 to L20, the description of the continuous system equation and the description of the control information of the state transition accompanying the event are declared as a type (class). L21 and L22 declare an entity of this type. L07-L09 and L15-17 are types of information corresponding to the description of the continuous system. L13 is information of a type based on the description of control information of state transition accompanying an event, and represents that the condition is valid at all simulation times. L07-L09 are valid only once when the type is instantiated, and are valid only when the simulation time is zero.

図6は図5のハイブリッドモデルプログラム2001のシミュレーションを実行して生成した連続系方程式有効・無効情報ファイル2012の一例を示す図である。L01-L14は連続系方程式のIDと連続系方程式との関係を示す情報を保存している。L16-L37ではシミュレーション時刻ごとに、各IDの連続系方程式の有効・無効を示す情報を保存している。L16の数値Nは連続系方程式のIDをスペースで区切って表示している。L17-L37の各列の3文字目から7文字目はシミュレーション時刻Tを示している。L16のID番号の文字数に一致する箇所には文字「o」もしくは「-」が記入され、文字「o」は該当する連続系方程式が有効であることを、「-」の場合は無効であることをあらわしている。   FIG. 6 is a diagram showing an example of the continuous system equation valid / invalid information file 2012 generated by executing the simulation of the hybrid model program 2001 of FIG. L01-L14 stores information indicating the relationship between the ID of the continuous system equation and the continuous system equation. In L16-L37, information indicating validity / invalidity of the continuous system equation of each ID is stored for each simulation time. The numerical value N of L16 indicates the ID of the continuous system equation separated by a space. The third to seventh characters in each column of L17-L37 indicate the simulation time T. The letter “o” or “-” is entered in the part that matches the number of characters in the ID number of L16, and the letter “o” is invalid if the corresponding continuous equation is valid, and “-” is invalid. It shows that.

図7はマップファイル2011の一例を示す図である。マップファイルはすべての連続系方程式のID番号と、該当するハイブリッドモデルプログラムのファイル名、ディレクトリ名、行番号を記録している。ここでは「id:」以降、スペースまでの数値が連続系方程式のIDである。「->」以降、括弧までがディレクトリ名及びファイル名であり、括弧内の数値が行番号である。   FIG. 7 is a diagram illustrating an example of the map file 2011. The map file records the ID numbers of all continuous system equations and the file names, directory names, and line numbers of the corresponding hybrid model programs. Here, the numerical value from “id:” to the space is the ID of the continuous system equation. After "->", the parentheses are directory names and file names, and the numbers in parentheses are line numbers.

図8は第1の実施形態に係る表示時刻入力装置1100の画面例を示す図である。表示時刻入力装置1100は、シミュレーション時刻設定部1103と、シミュレーション時刻決定ボタン1105とで構成される。シミュレーション時刻設定部1103は、最小シミュレーション時刻表示1101、最大シミュレーション時刻表示1102、シミュレーション時刻入力スライダ1104から構成される。スライダ1104はシミュレーション最小時刻またはシミュレーション最大時刻を越えて移動させることができなくなっており、シミュレーションを実行した範囲外に、誤ってシミュレーション時刻が設定されることが防止される。   FIG. 8 is a diagram illustrating a screen example of the display time input device 1100 according to the first embodiment. The display time input device 1100 includes a simulation time setting unit 1103 and a simulation time determination button 1105. The simulation time setting unit 1103 includes a minimum simulation time display 1101, a maximum simulation time display 1102, and a simulation time input slider 1104. The slider 1104 can no longer be moved beyond the simulation minimum time or the simulation maximum time, and the simulation time is prevented from being set erroneously outside the range in which the simulation is executed.

表示時刻入力装置1100は、シミュレーション時刻決定ボタン1105が押されたとき、シミュレーション時刻入力スライダ1104の位置とシミュレーション時刻最小値及び最大値からシミュレーション時刻を算出し、連続系方程式有効行表示装置5004にその時刻を渡す。またこの時算出したシミュレーション時刻がシミュレーション分解能よりも小さい場合は、連続系方程式有効・無効情報ファイル2012からシミュレーション分解能を算出し、シミュレーション分解能に近似したシミュレーション時刻を渡すことも可能である。   When the simulation time determination button 1105 is pressed, the display time input device 1100 calculates the simulation time from the position of the simulation time input slider 1104 and the simulation time minimum value and maximum value, and displays the simulation time on the continuous system equation valid line display device 5004. Pass the time. If the simulation time calculated at this time is smaller than the simulation resolution, the simulation resolution can be calculated from the continuous system equation valid / invalid information file 2012 and the simulation time approximated to the simulation resolution can be passed.

図9は第1の実施形態に係る方程式履歴表示部5000の画面構成を表す図である。ここでは表示時刻入力装置1200は図示省略してある。方程式履歴表示部5000の画面は記述データ表示装置5002のGUI画面である記述データビュー1402と、連続系方程式有効行表示装置5004のGUI画面である連続系方程式有効行ビュー1403と、連続系方程式有効行ビュー1403内部で連続系方程式の有効行を示す図である連続系方程式有効行フラグ1404から構成される。   FIG. 9 is a diagram illustrating a screen configuration of the equation history display unit 5000 according to the first embodiment. Here, the display time input device 1200 is not shown. The screen of the equation history display unit 5000 includes a description data view 1402 that is a GUI screen of the description data display device 5002, a continuous system equation valid row view 1403 that is a GUI screen of the continuous system equation valid row display device 5004, and a continuous system equation valid. The row view 1403 includes a continuous system equation valid row flag 1404 which is a diagram showing a valid row of a continuous system equation.

以上説明した第1の実施形態によれば、シミュレーション実行に大きな負荷をかけることなく必要な情報を取り出し、シミュレーション実行中のハイブリッドモデルプログラムの挙動を直感的に把握できるようになる。   According to the first embodiment described above, necessary information can be extracted without imposing a heavy load on the simulation execution, and the behavior of the hybrid model program during the simulation execution can be intuitively grasped.

(第2の実施形態)
第2の実施形態は、図4に示した表示処理手順において、フラグ表示時刻の判定処理を付加したものである。
(Second Embodiment)
In the second embodiment, a flag display time determination process is added to the display processing procedure shown in FIG.

図10は第2の実施形態に係る方程式履歴表示部5000の動作手順を示すフローチャートである。まずマップファイル2011を外部記憶装置から読み込む(ステップ4001)。次に連続系方程式有効・無効情報ファイル2012を外部記憶装置から読み込む(ステップ4002)。次に表示するシミュレーション時刻を入力する(ステップ4003)。シミュレーション時刻と連続系方程式有効・無効情報ファイル2012から取得したシミュレーション開始時刻とシミュレーション終了時刻を比較し、シミュレーション時刻が開始終了時刻内にあればステップ4005へ、そうでない場合はステップ4003に戻る。このとき図13のように不正な入力が行われたことを警告する画面を表示させることもできる。   FIG. 10 is a flowchart showing an operation procedure of the equation history display unit 5000 according to the second embodiment. First, the map file 2011 is read from the external storage device (step 4001). Next, the continuous system equation valid / invalid information file 2012 is read from the external storage device (step 4002). Next, the simulation time to be displayed is input (step 4003). The simulation start time is compared with the simulation start time acquired from the continuous system equation valid / invalid information file 2012. If the simulation time is within the start end time, the process returns to step 4005. If not, the process returns to step 4003. At this time, as shown in FIG. 13, it is possible to display a screen for warning that an illegal input has been made.

図11は、第2の実施形態に係る方程式切り替え履歴表示部5000を示すブロック図である。図2に示した構成に対し、シミュレーション時刻判定装置5003が追加されている。   FIG. 11 is a block diagram illustrating an equation switching history display unit 5000 according to the second embodiment. A simulation time determination device 5003 is added to the configuration shown in FIG.

図12は第2の実施形態に係る表示時刻入力装置1100の一例を示す図である。表示時刻入力装置1100はシミュレーション時刻入力画面1201と、シミュレーション時刻決定ボタン1105とで構成される。シミュレーション時刻入力画面1201はキーボード等の入力デバイスから直接、シミュレーション時刻をテキストで数値入力することができる。尚、図13にシミュレーション時刻設定入力におけるエラー表示の一例を示す。   FIG. 12 is a diagram illustrating an example of a display time input device 1100 according to the second embodiment. The display time input device 1100 includes a simulation time input screen 1201 and a simulation time determination button 1105. The simulation time input screen 1201 allows a simulation time to be numerically input directly from an input device such as a keyboard. FIG. 13 shows an example of error display in the simulation time setting input.

以上説明した第2の実施形態によれば、シミュレーション時刻を直接、数値で指定することができるようになることから、正確なシミュレーション時刻設定が可能になる。   According to the second embodiment described above, the simulation time can be directly designated by a numerical value, so that an accurate simulation time can be set.

(第3の実施形態)
第3の実施形態は、連続系方程式有効行表示装置によりフラグを重ねて表示するようにしたものである。
(Third embodiment)
In the third embodiment, flags are superimposed and displayed by a continuous system equation effective row display device.

図14は第3の実施形態に係る方程式履歴表示部5000の画面構成を表す図である。ここでは表示時刻入力装置1200は省略している。方程式履歴表示部5000の画面は、記述データ表示装置5002のGUI画面である記述データビュー1502と、連続系方程式有効行表示装置5004のGUI画面である連続系方程式有効行ビュー1503と、連続系方程式有効行ビュー1503内部で連続系方程式の有効行を示す図である連続系方程式有効行フラグ1504から構成される。第3の実施形態においては、同一行数で複数のフラグが有効になった場合に、フラグの表示画面位置をずらして表示させる。これにより、同一の行数で複数のフラグが有効になった場合でもわかりやすく表示することが可能になる。   FIG. 14 is a diagram illustrating a screen configuration of the equation history display unit 5000 according to the third embodiment. Here, the display time input device 1200 is omitted. The screen of the equation history display unit 5000 includes a description data view 1502 that is a GUI screen of the description data display device 5002, a continuous system equation valid row view 1503 that is a GUI screen of the continuous system equation valid row display device 5004, and a continuous system equation. The effective row view 1503 includes a continuous system equation effective row flag 1504 which is a diagram showing an effective row of a continuous system equation. In the third embodiment, when a plurality of flags are enabled with the same number of lines, the display screen positions of the flags are shifted and displayed. As a result, even when a plurality of flags are enabled with the same number of lines, it is possible to display in an easy-to-understand manner.

なお、本発明は上記実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、上記実施形態に開示されている複数の構成要素の適宜な組み合わせにより、種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除してもよい。さらに、異なる実施形態にわたる構成要素を適宜組み合わせてもよい。   Note that the present invention is not limited to the above-described embodiment as it is, and can be embodied by modifying the constituent elements without departing from the scope of the invention in the implementation stage. In addition, various inventions can be formed by appropriately combining a plurality of components disclosed in the embodiment. For example, some components may be deleted from all the components shown in the embodiment. Furthermore, constituent elements over different embodiments may be appropriately combined.

第1乃至第3の実施形態に共通するシミュレーション装置を示すブロック図The block diagram which shows the simulation apparatus common to 1st thru | or 3rd embodiment. 方程式切り替え履歴表示部を示すブロック図Block diagram showing equation switching history display 第1乃至第3の実施形態に共通するシミュレーション部の動作手順を示すフローチャートThe flowchart which shows the operation | movement procedure of the simulation part common to 1st thru | or 3rd embodiment. 第1の実施形態に係る方程式履歴表示部の動作手順を示すフローチャートThe flowchart which shows the operation | movement procedure of the equation log | history display part which concerns on 1st Embodiment. 制御情報解析部に呼ばれるハイブリッドモデルプログラム一例を示す図Diagram showing an example of a hybrid model program called by the control information analysis unit 図5のハイブリッドモデルプログラムのシミュレーションを実行して生成した連続系方程式有効・無効情報ファイルの一例を示す図The figure which shows an example of the continuous system equation valid / invalid information file produced | generated by performing the simulation of the hybrid model program of FIG. マップファイルの一例を示す図Figure showing an example of a map file 第1の実施形態に係る表示時刻入力装置の画面例を示す図The figure which shows the example of a screen of the display time input device which concerns on 1st Embodiment. 第1の実施形態に係る方程式履歴表示部の画面構成を表す図The figure showing the screen composition of the equation history display part concerning a 1st embodiment. 第2の実施形態に係る方程式履歴表示部の動作手順を示すフローチャートThe flowchart which shows the operation | movement procedure of the equation log | history display part which concerns on 2nd Embodiment. 第2の実施形態に係る方程式切り替え履歴表示部を示すブロック図The block diagram which shows the equation switching log | history display part which concerns on 2nd Embodiment. 第1の実施形態に係る表示時刻入力装置の一例を示す図The figure which shows an example of the display time input device which concerns on 1st Embodiment. 表示時刻入力装置によるエラー表示の一例を示す図The figure which shows an example of the error display by a display time input device 第3の実施形態に係る方程式履歴表示部の画面構成を表す図The figure showing the screen composition of the equation history display part concerning a 3rd embodiment.

符号の説明Explanation of symbols

2000…シミュレーション装置;
2014…シミュレーション部;
5000…方程式切り替え履歴表示部;
2001…ハイブリッドモデルプログラム;
2002…制御情報解析部;
2003…イベント処理プログラム;
2004…モデル方程式登録プログラム;
2005…方程式解析部;
2006…イベント処理部;
2007…方程式データ記憶部;
2008…連続系シミュレーション部;
2009…変数値時間履歴記憶部;
2010…連続系方程式切り替え部;
2011…マップファイル;
2012…連続系方程式有効・無効情報ファイル
2000: Simulation device;
2014 ... simulation part;
5000: Equation switching history display section;
2001 ... Hybrid model program;
2002 ... control information analysis unit;
2003 ... Event processing program;
2004 ... Model equation registration program;
2005 ... Equation analysis section;
2006 ... Event processing unit;
2007 ... equation data storage unit;
2008 ... Continuous system simulation section;
2009 ... variable value time history storage unit;
2010 ... Continuous equation switching unit;
2011 ... Map file;
2012 ... Continuous system equation valid / invalid information file

Claims (7)

連続系方程式の記述と、状態遷移に伴う前記連続系方程式の切り替えに関する記述とを有するハイブリッドモデルを用いてシミュレーションを実行するシミュレーション部と、
前記ハイブリッドモデルを解析することにより、連続系方程式のIDと、連続系方程式の記述行とを対応付けるマップを生成するマップ生成手段と、
前記シミュレーションの実行時において、シミュレーション時刻毎に、前記IDを有する連続系方程式が有効であるか無効であるかを示す情報を生成する情報生成手段と、を具備し、
前記マップ及び前記情報を前記ハイブリッドモデルの検証に供することを特徴とするシミュレーション装置。
A simulation unit that executes a simulation using a hybrid model having a description of a continuous system equation and a description related to switching of the continuous system equation accompanying state transition;
Analyzing the hybrid model to generate a map that associates the ID of the continuous system equation with the description line of the continuous system equation;
Information generation means for generating information indicating whether the continuous system equation having the ID is valid or invalid at each simulation time at the time of execution of the simulation;
A simulation apparatus characterized in that the map and the information are used for verification of the hybrid model.
前記シミュレーション部は、
前記連続系方程式の記述に基づいて、モデル方程式登録プログラムを生成する第1のプログラム生成手段と、
前記状態遷移に伴う連続系方程式の切り替えに関する記述に基づいて、イベント処理プログラムを生成する第2のプログラム生成手段と、
前記モデル方程式登録プログラムを実行することにより、前記連続系方程式をシミュレーション実行可能なデータ構造に変換する変換手段と、
前記イベント処理プログラムを実行することにより、イベントの発生に応じて前記連続系方程式の有効・無効を切り替える切り替え手段と、
前記切り替え手段において有効とされた前記連続系方程式に対応する前記データ構造を用いて、時間軸に沿った数値積分により該連続系方程式を解くことにより、前記シミュレーションを実行することを特徴とする請求項1に記載のシミュレーション装置。
The simulation unit
First program generation means for generating a model equation registration program based on the description of the continuous system equation;
Second program generation means for generating an event processing program based on a description related to switching of continuous system equations accompanying the state transition;
By executing the model equation registration program, conversion means for converting the continuous system equations into a data structure that can be simulated,
By executing the event processing program, switching means for switching the validity / invalidity of the continuous equation according to the occurrence of an event,
The simulation is executed by solving the continuous system equation by numerical integration along a time axis using the data structure corresponding to the continuous system equation validated by the switching means. Item 2. The simulation device according to Item 1.
シミュレーション時刻を入力する入力手段と、
前記入力手段により入力されたシミュレーション時刻において有効な連続系方程式のIDを前記情報から求め、該連続系方程式のIDに対応する連続系方程式の記述行を前記マップから求める手段と、
前記記述行に対応する位置に、該連続系方程式が有効であることを示すフラグを表示する表示手段と、をさらに具備することを特徴とする請求項1又は2に記載のシミュレーション装置。
An input means for inputting a simulation time;
Means for obtaining an ID of a continuous system equation effective at the simulation time inputted by the input means from the information, and obtaining a description line of the continuous system equation corresponding to the ID of the continuous system equation from the map;
The simulation apparatus according to claim 1, further comprising: a display unit that displays a flag indicating that the continuous system equation is valid at a position corresponding to the description line.
前記入力手段は、前記シミュレーションの実行におけるシミュレーション時刻の最小値と最大値との間で任意のシミュレーション時刻を指定可能なスライドバーを有することを特徴とする請求項3に記載のシミュレーション装置。   The simulation apparatus according to claim 3, wherein the input unit includes a slide bar capable of designating an arbitrary simulation time between a minimum value and a maximum value of the simulation time in the execution of the simulation. 前記入力手段は、シミュレーション時刻を数値入力する手段を有することを特徴とする請求項3に記載のシミュレーション装置。   The simulation apparatus according to claim 3, wherein the input unit includes a unit for inputting a numerical value of a simulation time. 連続系方程式の記述と、状態遷移に伴う前記連続系方程式の切り替えに関する記述とを有するハイブリッドモデルを用いたシミュレーションをシミュレーション部が実行するステップと、
前記ハイブリッドモデルを情報解析部が解析することにより、連続系方程式のIDと、連続系方程式の記述行とを対応付けるマップを生成するステップと、
前記シミュレーション部によるシミュレーションの実行時において、シミュレーション時刻毎に、前記IDを有する連続系方程式が有効であるか無効であるかを示す情報を連続系方程式の切り替え部が生成するステップと、を有することを特徴とするシミュレーション方法。
A step of executing a simulation using a hybrid model having a description of a continuous system equation and a description related to switching of the continuous system equation accompanying a state transition;
An information analysis unit analyzing the hybrid model to generate a map that associates the ID of the continuous system equation with the description line of the continuous system equation;
A step of generating a continuous system equation switching unit that indicates whether the continuous system equation having the ID is valid or invalid at the time of simulation by the simulation unit. A simulation method characterized by the above.
連続系方程式の記述と、状態遷移に伴う前記連続系方程式の切り替えに関する記述とを有するハイブリッドモデルを用いてシミュレーションを実行するシミュレーション手順と、
前記ハイブリッドモデルを解析することにより、連続系方程式のIDと、連続系方程式の記述行とを対応付けるマップを生成するマップ生成手順と、
前記シミュレーションの実行時において、シミュレーション時刻毎に、前記IDを有する連続系方程式が有効であるか無効であるかを示す情報を生成する情報生成手順と、をコンピュータに実行させるためのプログラム。
A simulation procedure for executing a simulation using a hybrid model having a description of a continuous system equation and a description of switching of the continuous system equation accompanying state transition;
A map generation procedure for generating a map that associates the ID of the continuous system equation and the description line of the continuous system equation by analyzing the hybrid model;
The program for making a computer perform the information generation procedure which produces | generates the information which shows whether the continuous system equation which has the said ID is effective or ineffective for every simulation time at the time of execution of the said simulation.
JP2007085697A 2007-03-28 2007-03-28 Simulation device, method, and program for hybrid model Pending JP2008243042A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007085697A JP2008243042A (en) 2007-03-28 2007-03-28 Simulation device, method, and program for hybrid model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007085697A JP2008243042A (en) 2007-03-28 2007-03-28 Simulation device, method, and program for hybrid model

Publications (1)

Publication Number Publication Date
JP2008243042A true JP2008243042A (en) 2008-10-09

Family

ID=39914270

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007085697A Pending JP2008243042A (en) 2007-03-28 2007-03-28 Simulation device, method, and program for hybrid model

Country Status (1)

Country Link
JP (1) JP2008243042A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010224894A (en) * 2009-03-24 2010-10-07 Internatl Business Mach Corp <Ibm> Method and program for simulation of hybrid system
WO2011036768A1 (en) * 2009-09-25 2011-03-31 株式会社 東芝 Simulation device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004178300A (en) * 2002-11-27 2004-06-24 Toshiba Corp Simulation method and program using hybrid model
JP2004220577A (en) * 2002-12-26 2004-08-05 Toshiba Corp Simulation method and simulation program
JP2004220566A (en) * 2002-12-26 2004-08-05 Toshiba Corp Mechanism simulation method and mechanism simulation program
JP2004280267A (en) * 2003-03-13 2004-10-07 Sumitomo Heavy Ind Ltd Display device for working device, display method for the working device, display program for the working device, and recording medium
JP2006323480A (en) * 2005-05-17 2006-11-30 Mitsubishi Electric Corp Analysis support device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004178300A (en) * 2002-11-27 2004-06-24 Toshiba Corp Simulation method and program using hybrid model
JP2004220577A (en) * 2002-12-26 2004-08-05 Toshiba Corp Simulation method and simulation program
JP2004220566A (en) * 2002-12-26 2004-08-05 Toshiba Corp Mechanism simulation method and mechanism simulation program
JP2004280267A (en) * 2003-03-13 2004-10-07 Sumitomo Heavy Ind Ltd Display device for working device, display method for the working device, display program for the working device, and recording medium
JP2006323480A (en) * 2005-05-17 2006-11-30 Mitsubishi Electric Corp Analysis support device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010224894A (en) * 2009-03-24 2010-10-07 Internatl Business Mach Corp <Ibm> Method and program for simulation of hybrid system
WO2011036768A1 (en) * 2009-09-25 2011-03-31 株式会社 東芝 Simulation device

Similar Documents

Publication Publication Date Title
TW571237B (en) Method of generating development environment for developing system chip and medium which stores program therefor
US8522196B1 (en) Traceability in a modeling environment
US8104017B2 (en) Traceability in a modeling environment
Tallent et al. Palm: Easing the burden of analytical performance modeling
JP5775829B2 (en) Software structure visualization program and system
EP1879106A2 (en) Source code generation method, apparatus and program
CN108920496B (en) Rendering method and device
US5949993A (en) Method for the generation of ISA simulators and assemblers from a machine description
Pereira et al. Web based IOPT Petri net Editor with an extensible plugin architecture to support generic net operations
JP2004220566A (en) Mechanism simulation method and mechanism simulation program
US11126408B2 (en) Incremental code generation method
Rybicki et al. Interactive model-based compilation continued–incremental hardware synthesis for SCCharts
JP2008243042A (en) Simulation device, method, and program for hybrid model
JP4564255B2 (en) Simulation device
Gargantini et al. Integrating formal methods with model-driven engineering
JP2009163662A (en) Information processor, control method of information processor, and control program of information processor
EP2891983A1 (en) Software verification program and software verification system
JP7260150B2 (en) WEBSITE DESIGN SUPPORT DEVICE, WEBSITE DESIGN SUPPORT METHOD, AND PROGRAM
Rentz et al. Extracting interactive actor-based dataflow models from legacy C code
JP5974444B2 (en) Information processing system, information processing method, information processing program, and recording medium
CN101916179B (en) Access method of bit zone in control register
Chaari et al. Automation of failure propagation analysis through metamodeling and code generation
JP5091520B2 (en) Hybrid model simulation device
Becker et al. FudgeFactor: Syntax-guided synthesis for accurate RTL error localization and correction
JP6249360B2 (en) Hardware design apparatus and hardware design program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100304

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20120529

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120710

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20130115