JP5091520B2 - Hybrid model simulation device - Google Patents

Hybrid model simulation device Download PDF

Info

Publication number
JP5091520B2
JP5091520B2 JP2007085703A JP2007085703A JP5091520B2 JP 5091520 B2 JP5091520 B2 JP 5091520B2 JP 2007085703 A JP2007085703 A JP 2007085703A JP 2007085703 A JP2007085703 A JP 2007085703A JP 5091520 B2 JP5091520 B2 JP 5091520B2
Authority
JP
Japan
Prior art keywords
variable
state transition
simulation
continuous system
time
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.)
Active
Application number
JP2007085703A
Other languages
Japanese (ja)
Other versions
JP2008243044A (en
Inventor
充伸 吉田
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 JP2007085703A priority Critical patent/JP5091520B2/en
Publication of JP2008243044A publication Critical patent/JP2008243044A/en
Application granted granted Critical
Publication of JP5091520B2 publication Critical patent/JP5091520B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、ハイブリッドモデルシミュレーション結果を可視化するためのシミュレーション装置に関する。   The present invention relates to a simulation apparatus for visualizing a hybrid model simulation result.

機構シミュレーション等に用いられるハイブリッドモデルは、常微分方程式や代数方程式を連立させた連立方程式によって表現された連続系モデルと、システム内部の状態を表現する状態遷移モデル(離散系モデル)とが組み合わされたものである。ハイブリッドモデルのデータは、連続系モデルの記述と、状態遷移モデルの記述とが混在して記述された、少なくとも一行以上の文字列で構成されるテキストデータとして管理される(下記「特許文献1」を参照。)。   The hybrid model used for mechanism simulations is a combination of a continuous system model expressed by simultaneous equations in which ordinary differential equations and algebraic equations are combined, and a state transition model (discrete system model) expressing the internal state of the system. It is a thing. The hybrid model data is managed as text data composed of a character string of at least one line in which the description of the continuous system model and the description of the state transition model are mixed (see “Patent Document 1” below). See).

このようなハイブリッドモデルを用いるシミュレーション装置において、ハイブリッドモデル変数の時間変化を直感的に把握することができるようにするため、時間軸と値軸からなる時間変化履歴グラフによってシミュレーション結果を表示するものがある(例えば下記「特許文献2」を参照。)。
特開2003−271679号公報 特開2004−178300号公報
In such a simulation apparatus using a hybrid model, in order to be able to intuitively grasp the time change of the hybrid model variable, the simulation result is displayed by a time change history graph including a time axis and a value axis. (For example, see “Patent Document 2” below.)
JP 2003-271679 A JP 2004-178300 A

上記時間変化履歴グラフを用いたシミュレーション結果表示においては、シミュレーション実行中のハイブリッドモデルプログラムの挙動を直感的に把握しづらいという問題点がある。   In the simulation result display using the time change history graph, there is a problem that it is difficult to intuitively grasp the behavior of the hybrid model program during the simulation execution.

そこで本発明は、シミュレーション実行中のハイブリッドモデルプログラムにおける状態遷移を可視化でき、これによりハイブリッドモデルプログラムの挙動を直感的に把握できるようなシミュレーション装置を提供することを目的とする。   Accordingly, an object of the present invention is to provide a simulation apparatus that can visualize state transitions in a hybrid model program that is being simulated, and thereby intuitively understand the behavior of the hybrid model program.

本発明の一観点に係るハイブリッドモデルシミュレーション装置は、変数を有する連続系方程式の記述と、状態遷移に伴う前記連続系方程式の切り替えに関する記述と、状態遷移の記録を行う付加処理の記述とを有するハイブリッドモデルプログラムを用いてシミュレーションを実行するハイブリッドモデルシミュレーション装置であって、前記シミュレーション中に前記付加処理を実行することにより、時刻と、前記変数の変数名と、前記状態遷移の識別情報とを表す状態遷移履歴データを生成する付加処理実行部と、時間軸に沿った数値積分により前記連続系方程式を解くことにより、時刻と、前記変数の変数名と、前記変数の値とを表す変数値時間履歴データを生成する連続系シミュレーション部と、前記変数値時間履歴データから、時刻の変化に沿った前記変数の変数値の変化を示すグラフを生成して表示し、前記状態遷移履歴データから、前記変数の状態遷移を識別可能な表示画像を生成し、前記グラフに重ね合わせて表示するシミュレーション結果表示部と、を具備する。   A hybrid model simulation apparatus according to an aspect of the present invention includes a description of a continuous system equation having variables, a description related to switching of the continuous system equation associated with a state transition, and a description of an additional process for recording the state transition. A hybrid model simulation apparatus that executes a simulation using a hybrid model program, and represents the time, the variable name of the variable, and the identification information of the state transition by executing the additional processing during the simulation A variable value time representing a time, a variable name of the variable, and a value of the variable by solving the continuous system equation by numerical integration along the time axis, and an additional processing execution unit that generates state transition history data From the continuous system simulation unit that generates history data and the variable value time history data, Generate and display a graph showing the change of the variable value of the variable along with the change of time, generate a display image that can identify the state transition of the variable from the state transition history data, and overlay the graph on the graph And a simulation result display unit for displaying.

本発明によれば、シミュレーション実行中のハイブリッドモデルプログラムにおける状態遷移を可視化でき、これによりハイブリッドモデルプログラムの挙動を直感的に把握できるようなシミュレーション装置を提供できる。   According to the present invention, it is possible to provide a simulation apparatus that can visualize state transitions in a hybrid model program that is being simulated, thereby intuitively grasping the behavior of the hybrid model program.

以下、図面を参照しながら本発明の実施形態を説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

(第1の実施形態)
図1は、第1の実施形態に係るハイブリッドモデルシミュレーション装置を示すブロック図である。制御情報解析部1002はハイブリッドモデルプログラム1001を読み込み、モデル方程式登録プログラム1003、イベント処理プログラム1004、及びシミュレーション実行時付加処理プログラム1005を生成する。方程式解析部1007は主に常微分方程式などで記述されたモデル方程式登録プログラム1003を読み込み、解析結果を方程式データ記憶部1010に格納する。イベント処理部1008は、付加処理プログラムを実行するタイミングと連続系方程式を切り替えるタイミングを記述したイベント処理プログラム1004を読み込む。付加処理実行部1006はシミュレーション実行時付加処理プログラム1005を読み、イベント処理部1008は付加処理が実行可能になった場合に付加処理プログラムを実行する。付加処理プログラム中に状態遷移に関連するAPI(Application Program Interface)が呼ばれた場合には、その呼出履歴を状態遷移履歴記憶DB(データベース)1013に登録する。
(First embodiment)
FIG. 1 is a block diagram showing a hybrid model simulation apparatus according to the first embodiment. The control information analysis unit 1002 reads the hybrid model program 1001 and generates a model equation registration program 1003, an event processing program 1004, and a simulation execution additional processing program 1005. The equation analysis unit 1007 reads a model equation registration program 1003 mainly described by an ordinary differential equation or the like, and stores the analysis result in the equation data storage unit 1010. The event processing unit 1008 reads an event processing program 1004 that describes the timing for executing the additional processing program and the timing for switching the continuous system equation. The additional process execution unit 1006 reads the simulation execution additional process program 1005, and the event processing unit 1008 executes the additional process program when the additional process becomes executable. When an API (Application Program Interface) related to state transition is called in the additional processing program, the call history is registered in the state transition history storage DB (database) 1013.

連続系方程式切り替え部1009は、イベント処理部1008からの設定に従って登録された方程式のうちどの方程式をシミュレーション中に有効にして数値計算を行うかを決定し、方程式の有効・無効を決定する。連続系シミュレーション部1011は、有効な方程式の数値積分を時間軸に沿って実行し、方程式の変数の値を決定する。変数の時間履歴は変数値時間履歴記憶DB1012に保存される。シミュレーション結果表示部1014は状態遷移履歴記憶DB1013及び変数値時間履歴DB1012から、状態遷移の時間的変化及び変数値の時間的変化を表示する。   The continuous system equation switching unit 1009 determines which equation among the registered equations that is registered in accordance with the setting from the event processing unit 1008 is to be validated during the simulation and performs the numerical calculation, and determines the validity / invalidity of the equation. The continuous system simulation unit 1011 executes numerical integration of effective equations along the time axis, and determines values of the variables of the equations. The variable time history is stored in the variable value time history storage DB 1012. The simulation result display unit 1014 displays the time change of the state transition and the time change of the variable value from the state transition history storage DB 1013 and the variable value time history DB 1012.

本実施形態は一般的なコンピュータを用いて構成することができ、そのハードウェア構成としてCPU、メモリ、外部記憶装置、通信インターフェース、表示装置、キーボード、マウス等を備える。またこれらのハードウェアを制御するためのオペレーティングシステムを備える。本実施形態に係るシミュレーション装置はこのようなオペレーティングシステム上で動作するアプリケーションソフトとして実装することができる。   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.

以上において、シミュレーション実行時付加処理プログラム1005の内容、状態遷移履歴記憶DB1013、及びシミュレーション結果表示部1014を除く構成要素については、特開2004−178300号公報及び特開2004−220577号公報の記載を参考にすることができる。   In the above description, the constituent elements other than the contents of the simulation execution additional processing program 1005, the state transition history storage DB 1013, and the simulation result display unit 1014 are described in Japanese Patent Application Laid-Open No. 2004-178300 and Japanese Patent Application Laid-Open No. 2004-220577. Can be helpful.

ここで図2を参照し、ハイブリッドモデルプログラム1001の一例を挙げながら、状態遷移とモデル方程式の関係について説明する。ハイブリッドモデルプログラム1001はテキストで記述され、テキストエディタなどのテキスト編集ツールを用いて作成することができる。ハイブリッドモデルプログラム1001は、主に、モデル方程式と、状態記述と、状態遷移条件の記述とから構成される。   Here, referring to FIG. 2, the relationship between the state transition and the model equation will be described with an example of the hybrid model program 1001. The hybrid model program 1001 is described in text and can be created using a text editing tool such as a text editor. The hybrid model program 1001 mainly includes model equations, state descriptions, and state transition condition descriptions.

図2に示されるハイブリッドモデルプログラム1001のリスト行において、モデル方程式の記述はL8,L11,L14,L17であり、状態記述はL7−L8のdo−watching構文、L10−L11のdo−watching構文、L13−L14のdo−watching構文、L16−L17のdo−watching構文などであり、状態遷移条件の記述は「up(L6)」のイベント発行及び「const(L9)」「down(L12)」「idle(L15)」のwhen構文などである。   In the list line of the hybrid model program 1001 shown in FIG. 2, the description of the model equation is L8, L11, L14, and L17, and the state description is L7-L8 do-watching syntax, L10-L11 do-watching syntax, L13-L14 do-watching syntax, L16-L17 do-watching syntax, etc. The description of the state transition condition is “up (L6)” event issuance and “const (L9)” “down (L12)” “ idle (L15) "when syntax.

図2の左側に示されるのはハイブリッドモデルプログラム1001の状態遷移図である。それぞれの状態記述は状態名を持ち、L7−L8は「立ち上げ」、L10−L11は「等速」、L13−L14は「減速」、L16−L17は「アイドル」である。   A state transition diagram of the hybrid model program 1001 is shown on the left side of FIG. Each state description has a state name, L7-L8 is “rise”, L10-L11 is “constant speed”, L13-L14 is “deceleration”, and L16-L17 are “idle”.

次に、状態遷移の記録指令がコード中に記述されたハイブリッドモデルプログラム1001を用い、シミュレーション過程において状態遷移の記録情報がどのように生成され、状態遷移履歴記憶DB1013に登録されるかについて説明する。状態遷移の記録情報は、ある変数について、状態遷移を識別可能な情報である。   Next, how the state transition recording information is generated and registered in the state transition history storage DB 1013 in the simulation process using the hybrid model program 1001 in which the state transition recording command is described in the code will be described. . The record information of the state transition is information that can identify the state transition for a certain variable.

(L1)cont y;event up;event const;event
(L2)down;event idle;
(L3)y=1;up;
(L4)when(up){
(L5) do {always y'=y+1;}watching (const);}
(L6)process(up){SetStatus("y","立ち上げ");}
(L7)when (y=10) const;
(L8)when(const){
(L9) do {always y'=0;}watching (down);}
(L10)process(const){SetStatus("y","等速");}
(L11)when (t=100) down;
(L12)when(down){
(L13) do {always y'=-1;}watching (idle);}
(L14)process(down){SetStatus("y","減速");}
(L15)when (y=1) idle;
(L16)when(idle){
(L17) do {always y'=0;}watching (up);}
(L18)process(idle){SetStatus("y","アイドル");}
このハイブリッドモデルプログラムではprocess文を用いて付加処理を実行している(L6、L10、L14、L18)。process文はイベント「up」「const」「down」「idle」によって付加処理プログラム(ここではSetStatus関数)を実行する。つまり、状態遷移条件が成立するとprocess文によってSetStatus関数が呼び出される。SetStatus関数は引数として変数名と状態遷移名を持つ。モデル方程式登録プログラム1003、イベント処理プログラム1004はC言語のプログラム(例えば、特開2004−178300号公報の段落[0063]を参照。)として出力され、シミュレーション実行時付加処理プログラム1005(SetStatus関数など)についてもC言語のプログラム(例えば、特開2004−220577号公報の段落[0052][数2]を参照。)として出力される。SetStatus関数は例えば以下のようなプログラムとして記述する。
(L1) cont y; event up; event const; event
(L2) down; event idle;
(L3) y = 1; up;
(L4) when (up) {
(L5) do {always y '= y + 1;} watching (const);}
(L6) process (up) {SetStatus ("y", "Startup");}
(L7) when (y = 10) const;
(L8) when (const) {
(L9) do {always y '= 0;} watching (down);}
(L10) process (const) {SetStatus ("y", "constant speed");}
(L11) when (t = 100) down;
(L12) when (down) {
(L13) do {always y '=-1;} watching (idle);}
(L14) process (down) {SetStatus ("y", "deceleration");}
(L15) when (y = 1) idle;
(L16) when (idle) {
(L17) do {always y '= 0;} watching (up);}
(L18) process (idle) {SetStatus ("y", "idle");}
In this hybrid model program, additional processing is executed using a process statement (L6, L10, L14, L18). The process statement executes an additional processing program (in this case, a SetStatus function) according to the events “up”, “const”, “down”, and “idle”. That is, when the state transition condition is satisfied, the SetStatus function is called by the process statement. The SetStatus function has a variable name and a state transition name as arguments. The model equation registration program 1003 and the event processing program 1004 are output as a C language program (see, for example, paragraph [0063] of Japanese Patent Application Laid-Open No. 2004-178300), and a simulation execution additional processing program 1005 (such as a SetStatus function). Is also output as a C language program (see, for example, paragraphs [0052] and [Equation 2] of Japanese Patent Laid-Open No. 2004-220577). For example, the SetStatus function is described as the following program.

void SetStatus(const char* name, cont char* status_name ) {
FILE* fp = fopen("status_change_log.txt","a");
double time = getCurrentTime();
fprintf(fp,"%f, %s, %s\n",time,name,status_name);
fclose(fp);
}
ここでgetCurretnTime()関数は、現在のシミュレーション時刻を取得するAPIである。以下のような関数によって「status_change_log.txt」には以下のような出力になる。

Figure 0005091520
void SetStatus (const char * name, cont char * status_name) {
FILE * fp = fopen ("status_change_log.txt", "a");
double time = getCurrentTime ();
fprintf (fp, "% f,% s,% s \ n", time, name, status_name);
fclose (fp);
}
Here, the getCurretnTime () function is an API for acquiring the current simulation time. The following output is output to “status_change_log.txt” by the following function.
Figure 0005091520

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

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

ハイブリッドモデルシミュレーション装置を構成するソフトウェアモジュールとして、モデル方程式の登録を行うための関数及び連続系方程式を切り替えるための関数がAPI関数として提供される。モデル方程式登録プログラム1003およびイベント処理プログラム1004は、該当する上記API関数を呼び出す記述を、入力されたハイブリッドモデルプログラム1001に沿って適切に組み合わせたプログラムである。この観点から考えると、制御情報解析部1002は、入力をハイブリッドモデルプログラム1001とし、出力を例えばC言語のAPI関数呼び出しの記述を含むCプログラム(ソース)とするような、一種のコンパイラと考えることもできる。このようなモデル方程式登録プログラム1003とイベント処理プログラム1004は、さらに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 1003 and the event processing program 1004 are programs that appropriately combine descriptions for calling the corresponding API functions along the input hybrid model program 1001. From this point of view, the control information analysis unit 1002 is considered as a kind of compiler in which the input is a hybrid model program 1001 and the output is a C program (source) including, for example, a C language API function call description. You can also. Such a model equation registration program 1003 and an event processing program 1004 are further 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. 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言語とする。   There are various specifications of specific software modules that constitute the application interface of the hybrid model simulation apparatus. 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は、この連続系方程式を構文解析し、連続系方程式の記述をシミュレーション実行可能なデータ構造(内部データ表現)に変換し、かかる内部データ表現を方程式データ記憶部1010に登録する処理を行う。なお、ここの連続系方程式には、ユニークなID番号が割り当てられる。たとえば「ab/cos(a−(c+b))−3c」という式が与えられたと仮定すると、木構造の内部データ表現を生成する。この木構造は、例えば線形多項式の親ノード(節)、掛け算のノード、割り算のノード、外部関数(四則演算以外の意)のノード、線形多項式を構成する各項のノードから構成される。本例において、木構造の葉に相当するものはすべて変数(a,b,c)であり、これらに実数の係数が加わって線形式となる。線形式はcosなどの外部関数の引数になったり、掛け算や割り算の対象となる。変数には、別途、値が確定しているかどうかのフラグが設けられており、またこのような木構造のデータに基づいて該変数の現在の値が保持される。木構造のすべての葉の値(すなわち変数の値)が確定していれば、式の値を計算することができる。方程式データ記憶部1010では、式の値の計算などを高速に行うことができるように、予め内部のデータ構造をつなぎ合わせて木構造を構成してある。上記処理において何らかのエラーが発生した場合には、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 1010. 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 1010, a tree structure is formed in advance by connecting internal data structures so that the value of an expression can be calculated at high speed. If any error occurs in the above processing, 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.

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

また、制御情報解析部1002は、シミュレーション実行の際に、時間がΔt進むごとに条件のチェックおよび方程式の切り替えを行う関数(ChangeEqn)も生成する。これはイベント処理プログラム1004(第2のプログラム)に相当する。   In addition, the control information analysis unit 1002 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 1004 (second program).

ここで、ChangeEqn関数は「up」イベント、「const」イベント、「down」イベント、「idle」イベントの発生をGetEvent関数により検知する。ChangeEqn関数はシミュレーション実行時における時間ステップ毎にイベント処理部1008から呼び出される。   Here, the ChangeEqn function detects the occurrence of the “up” event, the “const” event, the “down” event, and the “idle” event by the GetEvent function. The ChangeEqn function is called from the event processing unit 1008 at each time step during simulation execution.

ハイブリッドモデルシミュレーション装置では、図1から分かるようにイベント処理部1008と連続系シミュレーション部1011とが分離されている。したがって、イベント処理プログラム1004には時間積分などの時間に依存するモジュールは含まれず、これに対応するイベント処理部1008は連続系方程式の有効・無効のフラグの切り替えのみを行う。   In the hybrid model simulation apparatus, as can be seen from FIG. 1, the event processing unit 1008 and the continuous system simulation unit 1011 are separated. Accordingly, the event processing program 1004 does not include a time-dependent module such as time integration, and the event processing unit 1008 corresponding thereto only switches the valid / invalid flag of the continuous system equation.

このようなシミュレータ構成を採ることにより、外部機器とのインターフェースに係るイベントとハイブリッド記述に係るイベントとを同一の処理(if(GetEvent(イベント)処理)で管理することができる。   By adopting such a simulator configuration, the event related to the interface with the external device and the event related to the hybrid description can be managed by the same process (if (GetEvent (event) process)).

また、制御情報解析部1002は、ハイブリッドシミュレーションモデルをいったん付加処理と同一の言語として出力するため、容易にハイブリッドシミュレーション実行プログラムを生成可能である。したがって、ハイブリッドシミュレーションと外部機器との連携が容易になる。   Further, since the control information analysis unit 1002 once outputs the hybrid simulation model as the same language as the additional processing, it is possible to easily generate the hybrid simulation execution program. Therefore, the cooperation between the hybrid simulation and the external device is facilitated.

また、制御情報解析部1002は、図2のL6,L9,L12,L15のように内部でイベントを発生させる場合は、SetEvent関数を生成する。SetEvent関数はシミュレーション実行時に置ける時間ステップ毎にイベント処理部1008から呼び出される。制御情報解析部1002では、図2のL6の「up」イベントは、
if(getCurrentTime()==0)SetEvent(“up”);
というC言語のソースプログラムに変換される。また図2のL9の「const」イベントはシミュレーション中に各変数の値を取得するGetValue関数を用いて
if(GetValue(“y”)==10)SetEvent(“const”);
というC言語のソースプログラムに変換される。
Further, the control information analysis unit 1002 generates a SetEvent function when an event is generated internally as in L6, L9, L12, and L15 in FIG. The SetEvent function is called from the event processing unit 1008 for each time step that can be set during simulation execution. In the control information analysis unit 1002, the “up” event of L6 in FIG.
if (getCurrentTime () == 0) SetEvent (“up”);
Into a C language source program. In addition, the “const” event of L9 in FIG. 2 uses a GetValue function that acquires the value of each variable during the simulation.
if (GetValue (“y”) == 10) SetEvent (“const”);
Into a C language source program.

さらに、制御情報解析部1002は、付加処理の内容記述をハイブリッドモデルプログラム1001から抽出する。この抽出された記述はシミュレーション実行部付加処理プログラム1005(第3のプログラム)に相当する。シミュレーション実行部付加処理プログラム1005はハイブリッドモデルプログラム1001中でもともとC言語などにより記述されたプログラムのソースに相当する(例:上述のSetStatus関数)。抽出されたシミュレーション実行部付加処理プログラム1005は、C言語コンパイラによりコンパイルされ、動的にリンク可能なライブラリが生成される。付加処理実行部205は、この動的にリンク可能なライブラリを呼び出すインターフェースの役割を担う。なお、生成されるライブラリは必ずしも動的リンクライブラリである必要はなく、静的なライブラリであってもよい。また、付加処理の内容を記述する言語はC言語に限定されない。   Further, the control information analysis unit 1002 extracts the content description of the additional process from the hybrid model program 1001. This extracted description corresponds to the simulation execution unit additional processing program 1005 (third program). The simulation execution unit additional processing program 1005 corresponds to the source of a program originally written in C language or the like in the hybrid model program 1001 (for example, the above-described SetStatus function). The extracted simulation execution unit additional processing program 1005 is compiled by a C language compiler to generate a dynamically linkable library. The additional processing execution unit 205 plays a role of an interface for calling this dynamically linkable library. The generated library is not necessarily a dynamic link library, and may be a static library. Further, the language for describing the contents of the additional processing is not limited to the C language.

上記したような制御情報解析部1002における処理により、例えば、上述したハイブリッドモデルプログラム1001について、以下のようなC言語のソースプログラムが自動生成される。   By the processing in the control information analysis unit 1002 as described above, for example, the following C language source program is automatically generated for the hybrid model program 1001 described above.

static char eqn1[]="y'=1*y+1";
static char eqn2[]="y'=0";
static char eqn3[]="y'=-1";
static char eqn4[]="y'=0";
static int eqn1id;
static int eqn2id;
static int eqn3id;
static int eqn4id;
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;
}
int ChangeEqn()
{
int err;
BOOL GetEvent(char *eventname);
if(GetEvent("up")){
Err=XXX_ActivateEqn(eqn1id);
if(err!=0)return err;
XXX_DeActiveteEqn(eqn4id);
if(err!=0)return err;
}
if(GetEvent("const")){
Err=XXX_ActivateEqn(eqn2id);
if(err!=0)return err;
XXX_DeActiveteEqn(eqn1id);
if(err!=0)return err;
}
if(GetEvent("down")){
Err=XXX_ActivateEqn(eqn3id);
if(err!=0)return err;
XXX_DeActiveteEqn(eqn2id);
if(err!=0)return err;
}
if(GetEvent("idle")){
Err=XXX_ActivateEqn(eqn4id);
if(err!=0)return err;
XXX_DeActiveteEqn(eqn2id);
if(err!=0)return err;
}
if(getCurrentTime()==0)SetEvent(“up");
if(GetValue(“y")==10)SetEvent(“const");
if(getCurrentTime()==100)SetEvent(“down");
if(GetValue(“y")==1)SetEvent(“idle");
}
なお、GetEventは、引数に指定された名前(eventname)のイベントが生起しているかどうかをチェックする関数である。
static char eqn1 [] = "y '= 1 * y + 1";
static char eqn2 [] = "y '= 0";
static char eqn3 [] = "y '=-1";
static char eqn4 [] = "y '= 0";
static int eqn1id;
static int eqn2id;
static int eqn3id;
static int eqn4id;
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;
}
int ChangeEqn ()
{
int err;
BOOL GetEvent (char * eventname);
if (GetEvent ("up")) {
Err = XXX_ActivateEqn (eqn1id);
if (err! = 0) return err;
XXX_DeActiveteEqn (eqn4id);
if (err! = 0) return err;
}
if (GetEvent ("const")) {
Err = XXX_ActivateEqn (eqn2id);
if (err! = 0) return err;
XXX_DeActiveteEqn (eqn1id);
if (err! = 0) return err;
}
if (GetEvent ("down")) {
Err = XXX_ActivateEqn (eqn3id);
if (err! = 0) return err;
XXX_DeActiveteEqn (eqn2id);
if (err! = 0) return err;
}
if (GetEvent ("idle")) {
Err = XXX_ActivateEqn (eqn4id);
if (err! = 0) return err;
XXX_DeActiveteEqn (eqn2id);
if (err! = 0) return err;
}
if (getCurrentTime () == 0) SetEvent ("up");
if (GetValue (“y”) == 10) SetEvent (“const”);
if (getCurrentTime () == 100) SetEvent ("down");
if (GetValue (“y”) == 1) SetEvent (“idle”);
}
Note that GetEvent is a function that checks whether an event with the name (eventname) specified in the argument has occurred.

以上のプログラムは、上述したように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. .

次に、シミュレーションの実行について説明する。   Next, simulation execution will be described.

シミュレーションが開始されると、連続系方程式の値を計算することでシミュレーション実行が行われる。このとき、連続系方程式切り替え部1009は、イベント処理部1008の内部で呼び出され、連続系方程式の切り替えを有効・無効のフラグを用いて実行する。イベント処理部1008は前処理において生成されたイベント処理プログラム1004(第2のプログラム;ChangeEqn)に対応する。   When the simulation is started, the simulation is executed by calculating the value of the continuous system equation. At this time, the continuous system equation switching unit 1009 is called inside the event processing unit 1008 and executes switching of the continuous system equation using the valid / invalid flag. The event processing unit 1008 corresponds to the event processing program 1004 (second program; ChangeEqn) generated in the preprocessing.

連続系シミュレーション部1011は、方程式データ記憶部1010を参照し、同記憶部1010に木構造の形式で格納されている連続系方程式の内部データ表現を演算対象として、時間ステップづつ数値積分を実行する。シミュレーションは、常微分方程式及び代数多項式の連立からなる非線形連立方程式についての初期値問題である。このため、例えば図2に示される初期状態が与えられている。具体的には、例えば一般によく使われているルンゲクッタアルゴリズムを用いて解の値を計算する。必要なデータは機構シミュレータから出力を行い、さらに連続系方程式切り替え部1009の処理に戻り、上記の処理を繰り返すことにより必要な時間のシミュレーションを実行する。シミュレーション結果は、変数値時間履歴記憶DB1012に保存される。   The continuous system simulation unit 1011 refers to the equation data storage unit 1010, and executes numerical integration for each time step using the internal data representation of the continuous system equation stored in the storage unit 1010 in the form of a tree structure as an operation target. . The simulation is an initial value problem for a non-linear simultaneous equation consisting of a set of ordinary differential equations and algebraic polynomials. For this reason, for example, the initial state shown in FIG. 2 is given. Specifically, for example, a solution value is calculated using a commonly used Runge-Kutta algorithm. Necessary data is output from the mechanism simulator, and the process returns to the process of the continuous system equation switching unit 1009, and the above process is repeated to execute the simulation for the necessary time. The simulation result is stored in the variable value time history storage DB 1012.

以上説明したように、シミュレーションの開始から終了までのあいだに、付加処理実行部1006の動作に伴い状態遷移履歴記憶DB1013に状態遷移の時間的変化を示す履歴データが記録される一方、連続系シミュレーション部1011の動作に伴い変数値時間履歴記憶DB1012には変数値の時間的変化を示す履歴データが記録されることになる。   As described above, during the period from the start to the end of the simulation, the history data indicating the temporal change of the state transition is recorded in the state transition history storage DB 1013 along with the operation of the additional processing execution unit 1006, while the continuous system simulation With the operation of the unit 1011, history data indicating temporal changes in variable values is recorded in the variable value time history storage DB 1012.

図3はシミュレーション結果表示部1014による表示例を示している。シミュレーション結果表示部1014は、シミュレーション結果として例えば時間軸2002と値軸2003の2軸により変数値の時間変化履歴を示す時間変化履歴グラフ2001を表示することに加え、特に本実施形態ではこの時間変化履歴グラフ2001に重畳して状態遷移情報3004及び状態遷移名3005とを表示する。   FIG. 3 shows a display example by the simulation result display unit 1014. The simulation result display unit 1014 displays the time change history graph 2001 indicating the time change history of the variable value by two axes, for example, the time axis 2002 and the value axis 2003 as a simulation result. The state transition information 3004 and the state transition name 3005 are displayed superimposed on the history graph 2001.

状態遷移情報3004は、時間変化履歴グラフ2001に重ね合わせて表示され、状態遷移を視覚的に識別可能な表示画像であって、本実施形態では時間変化履歴グラフ2001において、各状態の開始時刻(最小値)に相当する直線と終了時刻(最大値)に相当する直線とによって挟まれる矩形領域の画像とする。この矩形領域画像は、隣接する状態との区別のために、異なる色で塗りつぶすか、隣接する領域とは異なるハッチングを行う。
状態遷移名3005は状態遷移情報3004内か、状態遷移情報3004に対して一部重なる位置に配置される。また、状態遷移名3005は時間変化履歴グラフ2001とは重ならない領域に配置される。
The state transition information 3004 is a display image that is displayed superimposed on the time change history graph 2001 and can visually identify the state transition. In the present embodiment, in the time change history graph 2001, the start time ( An image of a rectangular area sandwiched between a straight line corresponding to the minimum value) and a straight line corresponding to the end time (maximum value). This rectangular area image is painted with a different color or hatched differently from the adjacent area in order to distinguish it from the adjacent state.
The state transition name 3005 is arranged in the state transition information 3004 or at a position partially overlapping with the state transition information 3004. The state transition name 3005 is arranged in an area that does not overlap with the time change history graph 2001.

図4はシミュレーション結果表示部1014の内部構成を示すブロック図である。シミュレーション結果表示部1014は、変数値時間履歴記憶DB1013を解析し、グラフ表示用データを作成する変数履歴解析部4001と、状態遷移履歴記憶DB1012を解析し、状態遷移名3005及び状態遷移情報3004を作成する状態遷移履歴解析部4002とにより構成される。変数値時間履歴記憶DB1013は例えば以下のようなテキストファイルで実現される。以下は変数xと変数yが時刻1.0から6.0まで変化したときの時刻履歴を保存したファイルである。

Figure 0005091520
FIG. 4 is a block diagram showing an internal configuration of the simulation result display unit 1014. The simulation result display unit 1014 analyzes the variable value time history storage DB 1013, analyzes the variable history analysis unit 4001 that creates graph display data, and the state transition history storage DB 1012, and displays the state transition name 3005 and the state transition information 3004. And a state transition history analysis unit 4002 to be created. The variable value time history storage DB 1013 is realized by, for example, the following text file. The following is a file storing a time history when variable x and variable y change from time 1.0 to 6.0.
Figure 0005091520

行の先頭がアルファベット文字列変数で開始し、タブ文字やスペース文字などの空白文字を含まずに改行がある箇所を変数の区切りとする。一行が3列で構成されている場合は一列目が時刻、2列目が下限値、3列目が上限値である。上限値と下限値が一致している場合は数値計算によって値が決定されている、異なる数値の場合は値が決定されていないことを示す。変数履歴解析部4001では各変数に対してグラフをプロットするx座標、y座標を決定する。ここではx軸は時刻を表しており、一列目のデータを利用する。またY軸は値を表し、2列目と3列目の数値が一致する場合は2列目の値を利用する。2列目と3列目の値が異なる場合(不定の場合)はグラフに表示しないなどの処理を行う。   The beginning of the line starts with an alphabetic string variable, and a variable break is defined as a line break that does not include a space character such as a tab character or space character. When one row is composed of three columns, the first column is the time, the second column is the lower limit value, and the third column is the upper limit value. When the upper limit value and the lower limit value match, the value is determined by numerical calculation, and when the value is different, the value is not determined. The variable history analysis unit 4001 determines the x coordinate and y coordinate for plotting the graph for each variable. Here, the x-axis represents time, and data in the first column is used. The Y axis represents a value. When the values in the second and third columns match, the value in the second column is used. If the values in the second and third columns are different (indefinite), processing such as not displaying on the graph is performed.

状態遷移履歴解析部4002は例えば状態遷移履歴記憶DB1012として以下のようなデータを解析する。

Figure 0005091520
For example, the state transition history analysis unit 4002 analyzes the following data as the state transition history storage DB 1012.
Figure 0005091520

一列目は時刻、二列目は変数、三列目は状態遷移名である。状態遷移履歴解析部4002は、上記データのファイルを読み込み、各変数に対して状態遷移情報3004を決定する。各変数は、全ての時刻においていずれかの状態にあるものとする。この場合、上記データを解析すると、「立ち上げ」状態は時刻0.0〜10.0、「等速」状態は時刻10〜100、「減速」状態は100〜150、「アイドル」状態は150〜シミュレーション終了時刻となる。各時刻とグラフ上の表示位置との関係は変数履歴解析部4001の処理により決定されているため、グラフ表示部4003から取得することができる。状態遷移情報3004の下限及び上限値はグラフ表示部の最小値及び最大値となる。状態遷移名3005は三列目の文字列が表示可能な程度の大きさを持ち、状態遷移情報3004の開示時刻と終了時刻の中間におけるx座標値、状態遷移情報3004から一定座標下げたy座標値に配置する。以上の処理の処理フローを図5に示す。   The first column is the time, the second column is the variable, and the third column is the state transition name. The state transition history analysis unit 4002 reads the data file and determines state transition information 3004 for each variable. Each variable is in any state at all times. In this case, when the above data is analyzed, the “start-up” state is time 0.0 to 10.0, the “constant speed” state is time 10 to 100, the “deceleration” state is 100 to 150, and the “idle” state is 150. ~ Simulation end time. Since the relationship between each time and the display position on the graph is determined by the processing of the variable history analysis unit 4001, it can be acquired from the graph display unit 4003. The lower limit and the upper limit value of the state transition information 3004 are the minimum value and the maximum value of the graph display unit. The state transition name 3005 is large enough to display the third character string. The x-coordinate value between the disclosure time and end time of the state transition information 3004, and the y coordinate obtained by lowering the coordinate by a certain amount from the state transition information 3004 Place on value. The processing flow of the above processing is shown in FIG.

以上説明した第1の実施形態によれば、図3の表示例から理解されるように、シミュレーション実行中のハイブリッドモデルプログラムにおける状態遷移を可視化できる。つまり、変数値の時間変化履歴を示す時間変化履歴グラフ2001を単に表示するのみならず、状態遷移情報3004及び状態遷移名3005を表示することができる。したがって、シミュレーション実行中のハイブリッドモデルプログラムの挙動を直感的に把握しやすくなる。   According to the first embodiment described above, as can be understood from the display example of FIG. 3, it is possible to visualize the state transition in the hybrid model program during the execution of the simulation. That is, not only the time change history graph 2001 indicating the time change history of the variable value but also the state transition information 3004 and the state transition name 3005 can be displayed. Therefore, it becomes easy to intuitively grasp the behavior of the hybrid model program during simulation execution.

(第2の実施形態)
図6は第2の実施形態に係るシミュレーション結果表示部を示すブロック図である。この図6に示すシミュレーション結果表示部1014は、変数値時間履歴記憶DB1013を解析してグラフ表示部4003に表示するための時間変化履歴グラフ2001を作成する変数履歴解析部4001と、状態遷移履歴記憶DB1012を解析してグラフ表示部4003に表示するための状態遷移情報3004及び状態遷移名3005を作成する状態遷移履歴解析部4002と、状態遷移を表示する変数名を選択するための状態表示切り替え部5001とから構成される。
(Second Embodiment)
FIG. 6 is a block diagram showing a simulation result display unit according to the second embodiment. The simulation result display unit 1014 shown in FIG. 6 analyzes the variable value time history storage DB 1013 and creates a time change history graph 2001 for displaying on the graph display unit 4003, and a state transition history storage. A state transition history analysis unit 4002 that creates state transition information 3004 and a state transition name 3005 for analyzing and displaying the DB 1012 on the graph display unit 4003, and a state display switching unit for selecting a variable name for displaying the state transition 5001.

図7は第2の実施形態に係るシミュレーション結果表示部の処理手順を示すフローチャートである。まず変数値時間履歴記憶DB1013のファイルを開く(13001)。次に状態遷移履歴記憶DB1012のファイルを開く(13002)。   FIG. 7 is a flowchart showing a processing procedure of the simulation result display unit according to the second embodiment. First, the file of the variable value time history storage DB 1013 is opened (13001). Next, the file of the state transition history storage DB 1012 is opened (13002).

これらファイルに記録された情報に基づいて、グラフ表示領域内の各変数データの表示位置を計算する(13003)。次に、状態表示対象の変数名を取得し、各状態の開始時刻及び終了時刻を算出し(13004)、各状態のグラフ表示域内の状態遷移情報3004を計算する(13005)。さらに、各状態のグラフ表示域内のラベル位置を計算する(13006)。   Based on the information recorded in these files, the display position of each variable data in the graph display area is calculated (13003). Next, the state display target variable name is acquired, the start time and end time of each state are calculated (13004), and the state transition information 3004 in the graph display area of each state is calculated (13005). Further, the label position in the graph display area of each state is calculated (13006).

そして、以上において算出された位置情報に従い、時間変化履歴グラフ2001(グラフ)、状態遷移情報3004(リージョン)、状態遷移名3005(ラベル)を表示する。ここで、グラフ表示終了処理が行われた場合は終了処理を実行し、グラフ表示領域、例えば表示する時刻の範囲や表示する値の範囲に変更があった場合は13003の状態に戻る。   Then, according to the position information calculated above, a time change history graph 2001 (graph), state transition information 3004 (region), and state transition name 3005 (label) are displayed. Here, when the graph display end process is performed, the end process is executed, and when the graph display area, for example, the time range to be displayed or the value range to be displayed is changed, the state returns to the state of 13003.

図8は、状態表示切替部5001により状態遷移表示の対象となる変数名を指定可能に構成された画面の表示例を示す図である。グラフ表示部4003はマウスポインタ8002を持つ。このマウスポインタ8002はPCに接続されたマウスの移動操作に応じて画面内を移動させることができる。時間変化履歴グラフ2001上でマウスをクリックすると(例えば図8の例では実線で示されたライン上)、クリックされたグラフに関連付けられた変数名が取得される。   FIG. 8 is a diagram illustrating a display example of a screen configured to be able to specify a variable name that is a target of state transition display by the state display switching unit 5001. The graph display unit 4003 has a mouse pointer 8002. The mouse pointer 8002 can be moved in the screen in accordance with a moving operation of a mouse connected to the PC. When the mouse is clicked on the time change history graph 2001 (for example, on the line indicated by the solid line in the example of FIG. 8), the variable name associated with the clicked graph is acquired.

このクリック指定操作により、状態遷移履歴解析部4002によって状態遷移履歴記憶DB1012から該変数名に関連する状態遷移履歴情報が読み取られ、状態遷移履歴表示が行われる。マウスでクリックする領域はグラフのライン上でも良いし、グラフの近傍(例えばフラグから数ピクセル離れた)位置をクリックしても良い。グラフの近傍のクリックを許可する場合は、グラフのライン上のクリックに比べて比較的容易にマウス操作を行うことができ、より簡単な状態遷移の切り替えを行うことができる。   By this click designation operation, the state transition history analysis unit 4002 reads the state transition history information related to the variable name from the state transition history storage DB 1012 and displays the state transition history. The area to be clicked with the mouse may be on the line of the graph, or may be clicked in the vicinity of the graph (for example, several pixels away from the flag). When a click in the vicinity of the graph is permitted, a mouse operation can be performed relatively easily compared to a click on a line of the graph, and the state transition can be switched more easily.

図9は状態表示切替部5001により状態遷移表示の対象となる変数名を指定可能に構成された別の画面の表示例を示す図である。シミュレーション結果表示部1014は、グラフ表示部4003、メニューバー9001を持ち、メニューバー9001は変数表示メニュー9002及び表示変数指示ボタン9003を持つ。変数表示メニュー9002は変数値時間履歴記憶DB1013から履歴が記憶されている変数名の一覧を作成し、メニューに表示する。例えば変数値時間履歴記憶DB1013が上記[数4]に示したものであるとする。各行の最初の文字列がアルファベットで記述されている場合は変数名として一覧に登録する。この場合、登録される変数は、「x」及び「y」である。メニューには、「xを表示する」「yを表示する」と表示を行う。ユーザがマウスポインタ8002(図示せず)を用いて表示変数指示ボタン9003をクリックすると、クリックされたボタンの隣に配置された変数表示メニュー9002に関連付けられた変数名を取得し、状態遷移履歴解析部4002によって状態遷移履歴記憶DB1012から変数名に関連する状態遷移履歴情報を読み取り、状態遷移履歴表示を行う。   FIG. 9 is a diagram illustrating a display example of another screen configured to be able to specify a variable name that is a target of state transition display by the state display switching unit 5001. The simulation result display unit 1014 has a graph display unit 4003 and a menu bar 9001, and the menu bar 9001 has a variable display menu 9002 and a display variable instruction button 9003. The variable display menu 9002 creates a list of variable names in which history is stored from the variable value time history storage DB 1013 and displays it on the menu. For example, it is assumed that the variable value time history storage DB 1013 is as shown in the above [Equation 4]. If the first character string on each line is written in alphabet, register it as a variable name in the list. In this case, the registered variables are “x” and “y”. The menu displays “display x” and “display y”. When the user clicks a display variable instruction button 9003 using a mouse pointer 8002 (not shown), a variable name associated with the variable display menu 9002 arranged next to the clicked button is acquired, and state transition history analysis is performed. The unit 4002 reads the state transition history information related to the variable name from the state transition history storage DB 1012 and displays the state transition history.

図10は状態表示切替部5001により状態遷移表示の対象となる変数名を指定可能に構成された別の画面の表示例を示す図である。グラフ表示部4003は変数名表示領域10003及び、第一の変数の有効ボタン10001及び第2の変数の有効ボタン10002を持つ。ユーザがマウスポインタ8002(図示せず)を用いてボタンを押下すると、押下したボタンに関連付けられている変数名を読み込み、状態遷移履歴解析部4002によって状態遷移履歴記憶DB1012から変数名に関連する状態遷移履歴情報を読み取り、状態遷移履歴表示を行う。   FIG. 10 is a diagram illustrating a display example of another screen configured to be able to specify a variable name that is a target of state transition display by the state display switching unit 5001. The graph display unit 4003 has a variable name display area 10003, a first variable valid button 10001, and a second variable valid button 10002. When the user presses a button using a mouse pointer 8002 (not shown), a variable name associated with the pressed button is read, and the state related to the variable name is read from the state transition history storage DB 1012 by the state transition history analysis unit 4002. Read transition history information and display state transition history.

(第3の実施形態)
図11は第3の実施形態に係り、シミュレーション結果表示部1014が2つの変数を同時に1つのグラフ領域に表示するよう構成した場合のグラフ表示部4003の表示例を示している。第3の実施形態においてシミュレーション結果表示部1014は、第一の変数に関する時間変化履歴グラフ6001と、第2の変数に関する時間変化履歴グラフ6002とを同時に表示可能となっている。
(Third embodiment)
FIG. 11 relates to the third embodiment and shows a display example of the graph display unit 4003 when the simulation result display unit 1014 is configured to display two variables simultaneously in one graph region. In the third embodiment, the simulation result display unit 1014 can simultaneously display a time change history graph 6001 related to the first variable and a time change history graph 6002 related to the second variable.

以下は複数の変数に関して状態遷移の履歴を持つ状態遷移履歴記憶DB1012の例である。ここで第一の変数に関する時間変化履歴グラフ6001は変数xに関して、第2の変数に関する時間変化履歴グラフ6002は変数yに関して表示を行うものとする。

Figure 0005091520
The following is an example of the state transition history storage DB 1012 having state transition history for a plurality of variables. Here, it is assumed that the time change history graph 6001 related to the first variable is displayed regarding the variable x, and the time change history graph 6002 related to the second variable is displayed regarding the variable y.
Figure 0005091520

予め変数xに関して状態遷移の表示を行うと設定されている場合は、状態遷移履歴解析部4002では変数xに関するデータのみの読み込みを行い、状態遷移情報3004、状態遷移名3005の表示を行う。   If it is set in advance to display the state transition regarding the variable x, the state transition history analysis unit 4002 reads only the data regarding the variable x and displays the state transition information 3004 and the state transition name 3005.

これに対し図12は、予め変数yに関しての状態遷移の表示を行うと設定されている場合の表示例である。   On the other hand, FIG. 12 is a display example in the case where it is set in advance to display the state transition regarding the variable y.

(第4の実施形態)
図13は2つの変数を同時に2つのグラフ領域に表示した場合の、グラフ表示部4003の表示例である。グラフ表示部4003は状態遷移補助線11001を持ち、上下のグラフで同一の状態遷移がある場合は、対応する線を描画している。この表示方法を用いることでグラフデータが重なって表示されることが避けられるため、グラフデータの視認性が向上する。また同一の状態遷移名を持つ状態遷移情報3004は同一の色で塗り潰すか、同一のハッチングパターンを用いることで、上下のグラフの状態遷移の比較が容易になる。また同一の色やハッチングパターンを用いている場合は、状態遷移名3005のどちらか一方を消去することもできる。
(Fourth embodiment)
FIG. 13 is a display example of the graph display unit 4003 when two variables are simultaneously displayed in two graph areas. The graph display unit 4003 has a state transition auxiliary line 11001. When there is the same state transition in the upper and lower graphs, a corresponding line is drawn. By using this display method, it is possible to avoid the graph data from being displayed in an overlapping manner, so that the visibility of the graph data is improved. In addition, the state transition information 3004 having the same state transition name is filled with the same color or the same hatching pattern, so that the state transitions of the upper and lower graphs can be easily compared. When the same color or hatching pattern is used, either one of the state transition names 3005 can be deleted.

なお、本発明は上記実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、上記実施形態に開示されている複数の構成要素の適宜な組み合わせにより、種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除してもよい。さらに、異なる実施形態にわたる構成要素を適宜組み合わせてもよい。   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の実施形態に係るハイブリッドモデルシミュレーション装置を示すブロック図The block diagram which shows the hybrid model simulation apparatus which concerns on 1st Embodiment ハイブリッドモデルプログラムにおける状態遷移とモデル方程式の関係について説明するための図Diagram for explaining the relationship between state transition and model equation in hybrid model program シミュレーション結果表示部による表示例を示す図The figure which shows the example of a display by a simulation result display part シミュレーション結果表示部の内部構成を示すブロック図Block diagram showing the internal configuration of the simulation result display section 第1の実施形態に係るシミュレーション結果表示部の処理手順を示すフローチャートThe flowchart which shows the process sequence of the simulation result display part which concerns on 1st Embodiment. 第2の実施形態に係るシミュレーション結果表示部を示すブロック図The block diagram which shows the simulation result display part which concerns on 2nd Embodiment 第2の実施形態に係るシミュレーション結果表示部の処理手順を示すフローチャートThe flowchart which shows the process sequence of the simulation result display part which concerns on 2nd Embodiment. 状態表示切替部により状態遷移表示の対象となる変数名を指定可能に構成された画面の表示例を示す図The figure which shows the example of a display of the screen comprised so that the variable name used as the object of state transition display can be specified by the state display switching part 変数名を指定可能に構成された別の画面の表示例を示す図The figure which shows the example of a display of another screen comprised so that a variable name can be specified. 変数名を指定可能に構成された別の画面の表示例を示す図The figure which shows the example of a display of another screen comprised so that a variable name can be specified. 第3の実施形態に係り、シミュレーション結果表示部が2つの変数を同時に1つのグラフ領域に表示するよう構成した場合のグラフ表示部の表示例を示す図The figure which shows the example of a display of a graph display part when it concerns on 3rd Embodiment and the simulation result display part is comprised so that two variables may be simultaneously displayed on one graph area | region. 予め変数yに関しての状態遷移の表示を行うと設定されている場合の表示例を示す図The figure which shows the example of a display in the case of setting to display the state transition regarding the variable y beforehand 2つの変数を同時に2つのグラフ領域に表示した場合のグラフ表示部の表示例を示す図The figure which shows the example of a display of a graph display part at the time of displaying two variables on two graph areas simultaneously.

符号の説明Explanation of symbols

1001…ハイブリッドモデルプログラム;
1002…制御情報解析部;
1003…モデル方程式登録プログラム;
1004…イベント処理プログラム;
1005…シミュレーション実行時付加処理プログラム;
1006…付加処理実行部;
1007…方程式解析部;
1008…イベント処理部;
1009…連続系方程式切り替え部;
1010…方程式データ記憶部;
1011…連続系シミュレーション部;
1012…変数値時間履歴記憶DB;
1013…状態遷移履歴記憶DB;
1014…シミュレーション結果表示部
1001 ... Hybrid model program;
1002 ... Control information analysis unit;
1003 ... Model equation registration program;
1004 ... Event processing program;
1005 ... Simulation processing additional processing program;
1006 ... Additional processing execution unit;
1007 ... Equation analysis unit;
1008 ... Event processing unit;
1009 ... Continuous equation switching unit;
1010 ... equation data storage unit;
1011 ... Continuous system simulation section;
1012 ... Variable value time history storage DB;
1013 ... State transition history storage DB;
1014 ... Simulation result display section

Claims (6)

変数を有する連続系方程式の記述と、状態遷移に伴う前記連続系方程式の切り替えに関する記述と、状態遷移の記録を行う付加処理の記述とを有するハイブリッドモデルプログラムを用いてシミュレーションを実行するハイブリッドモデルシミュレーション装置であって、
前記シミュレーション中に前記付加処理を実行することにより、時刻と、前記変数の変数名と、前記状態遷移の識別情報とを表す状態遷移履歴データを生成する付加処理実行部と、
時間軸に沿った数値積分により前記連続系方程式を解くことにより、時刻と、前記変数の変数名と、前記変数の値とを表す変数値時間履歴データを生成する連続系シミュレーション部と、
前記変数値時間履歴データから、時刻の変化に沿った前記変数の変数値の変化を示すグラフを生成して表示し、前記状態遷移履歴データから、前記変数の状態遷移を識別可能な表示画像を生成し、前記グラフに重ね合わせて表示するシミュレーション結果表示部と、を具備するハイブリッドモデルシミュレーション装置。
Hybrid model simulation that executes a simulation using a hybrid model program having a description of a continuous system equation having variables, a description about switching of the continuous system equation accompanying a state transition, and a description of an additional process for recording the state transition A device,
An additional processing execution unit that generates state transition history data representing the time, the variable name of the variable, and the identification information of the state transition by executing the additional processing during the simulation;
By solving the continuous system equation by numerical integration along the time axis, a continuous system simulation unit for generating variable value time history data representing the time, the variable name of the variable, and the value of the variable;
From the variable value time history data, a graph showing a change in the variable value of the variable along with a change in time is generated and displayed, and a display image that can identify the state transition of the variable from the state transition history data A hybrid model simulation apparatus comprising: a simulation result display unit that generates and displays the result superimposed on the graph.
前記連続系方程式の記述に基づいて、モデル方程式登録プログラムを生成する第1のプログラム生成手段と、
前記状態遷移に伴う連続系方程式の切り替えに関する記述に基づいて、イベント処理プログラムを生成する第2のプログラム生成手段と、
前記モデル方程式登録プログラムを実行することにより、前記連続系方程式をシミュレーション実行可能なデータ構造に変換する変換手段と、
シミュレーションの開始によって前記イベント処理プログラムを実行し、イベントの発生に応じて前記連続系方程式の有効・無効を切り替える切り替え手段と、をさらに具備し、
前記連続系シミュレーション部は、前記切り替え手段において有効とされた連続系方程式に対応する前記データ構造を用いて、前記連続系方程式を解くことを特徴とする請求項1に記載のハイブリッドモデルシミュレーション装置。
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,
A switching means for executing the event processing program at the start of simulation, and switching between valid / invalid of the continuous system equation according to the occurrence of the event, and
The hybrid model simulation apparatus according to claim 1, wherein the continuous system simulation unit solves the continuous system equation using the data structure corresponding to the continuous system equation validated by the switching unit.
前記シミュレーション結果表示部は、前記変数の状態遷移を識別可能な表示画像とともに、前記変数の状態遷移名を表示する請求項1又は2に記載のハイブリッドモデルシミュレーション装置。   The hybrid model simulation apparatus according to claim 1, wherein the simulation result display unit displays a state transition name of the variable together with a display image that can identify the state transition of the variable. 前記シミュレーション結果表示部は、複数の変数についての変数値の変化を示す複数のグラフを生成して表示し、指定手段により指定されたグラフについて、前記変数の状態遷移を識別可能な表示画像を表示する請求項1乃至3のいずれかに記載のハイブリッドモデルシミュレーション装置。   The simulation result display unit generates and displays a plurality of graphs indicating changes in variable values for a plurality of variables, and displays a display image that can identify state transitions of the variables for the graph specified by the specifying unit. The hybrid model simulation apparatus according to any one of claims 1 to 3. 変数を有する連続系方程式の記述と、状態遷移に伴う前記連続系方程式の切り替えに関する記述と、状態遷移の記録を行う付加処理の記述とを有するハイブリッドモデルプログラムを用いてシミュレーションを実行するハイブリッドモデルシミュレーション方法であって、
付加処理実行部が、前記シミュレーション中に前記付加処理を実行することにより、時刻と、前記変数の変数名と、前記状態遷移の識別情報とを表す状態遷移履歴データを生成するステップと、
連続系シミュレーション部が、時間軸に沿った数値積分により前記連続系方程式を解くことにより、時刻と、前記変数の変数名と、前記変数の値とを表す変数値時間履歴データを生成するステップと、
シミュレーション結果表示部が、前記変数値時間履歴データから、時刻の変化に沿った前記変数の変数値の変化を示すグラフを生成して表示し、前記状態遷移履歴データから、前記変数の状態遷移を識別可能な表示画像を生成し、前記グラフに重ね合わせて表示するステップと、を具備するハイブリッドモデルシミュレーション方法。
Hybrid model simulation that executes a simulation using a hybrid model program having a description of a continuous system equation having variables, a description about switching of the continuous system equation accompanying a state transition, and a description of an additional process for recording the state transition A method,
An additional process executing unit generating the state transition history data representing the time, the variable name of the variable, and the identification information of the state transition by executing the additional process during the simulation;
A continuous system simulation unit generates variable value time history data representing a time, a variable name of the variable, and a value of the variable by solving the continuous system equation by numerical integration along a time axis; ,
A simulation result display unit generates and displays a graph indicating a change in the variable value of the variable along with a change in time from the variable value time history data, and displays the state transition of the variable from the state transition history data. Generating a identifiable display image and displaying it on the graph in a superimposed manner.
変数を有する連続系方程式の記述と、状態遷移に伴う前記連続系方程式の切り替えに関する記述と、状態遷移の記録を行う付加処理の記述とを有するハイブリッドモデルプログラムを用いてシミュレーションを実行するハイブリッドモデルシミュレーションプログラムであって、
コンピュータに、
前記シミュレーション中に前記付加処理を実行することにより、時刻と、前記変数の変数名と、前記状態遷移の識別情報とを表す状態遷移履歴データを生成する手順と、
時間軸に沿った数値積分により前記連続系方程式を解くことにより、時刻と、前記変数の変数名と、前記変数の値とを表す変数値時間履歴データを生成する手順と、
前記変数値時間履歴データから、時刻の変化に沿った前記変数の変数値の変化を示すグラフを生成して表示し、前記状態遷移履歴データから、前記変数の状態遷移を識別可能な表示画像を生成し、前記グラフに重ね合わせて表示する手順と、を実行させるためのハイブリッドモデルシミュレーションプログラム。
Hybrid model simulation that executes a simulation using a hybrid model program having a description of a continuous system equation having variables, a description about switching of the continuous system equation accompanying a state transition, and a description of an additional process for recording the state transition A program,
On the computer,
A procedure for generating state transition history data representing time, a variable name of the variable, and identification information of the state transition by executing the additional processing during the simulation;
A procedure for generating variable value time history data representing a time, a variable name of the variable, and a value of the variable by solving the continuous system equation by numerical integration along a time axis;
From the variable value time history data, a graph showing a change in the variable value of the variable along with a change in time is generated and displayed, and a display image that can identify the state transition of the variable from the state transition history data A hybrid model simulation program for executing and generating and displaying the superimposed image on the graph.
JP2007085703A 2007-03-28 2007-03-28 Hybrid model simulation device Active JP5091520B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007085703A JP5091520B2 (en) 2007-03-28 2007-03-28 Hybrid model simulation device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007085703A JP5091520B2 (en) 2007-03-28 2007-03-28 Hybrid model simulation device

Publications (2)

Publication Number Publication Date
JP2008243044A JP2008243044A (en) 2008-10-09
JP5091520B2 true JP5091520B2 (en) 2012-12-05

Family

ID=39914271

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007085703A Active JP5091520B2 (en) 2007-03-28 2007-03-28 Hybrid model simulation device

Country Status (1)

Country Link
JP (1) JP5091520B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5208891B2 (en) * 2009-09-07 2013-06-12 株式会社東芝 Hybrid model simulation apparatus and method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3866595B2 (en) * 2002-03-15 2007-01-10 株式会社東芝 Hybrid model creation device and program
JP3940665B2 (en) * 2002-11-27 2007-07-04 株式会社東芝 Hybrid simulation apparatus and program
JP4481783B2 (en) * 2004-09-30 2010-06-16 ルネサスエレクトロニクス株式会社 Simulation model creation device, simulation device and system, method and program

Also Published As

Publication number Publication date
JP2008243044A (en) 2008-10-09

Similar Documents

Publication Publication Date Title
US8656352B2 (en) System and method for synchronized workflow management
US7849394B2 (en) Linked code generation report
Pereira et al. Web based IOPT Petri net Editor with an extensible plugin architecture to support generic net operations
WO2018047620A1 (en) Executable program creation device, executable program creation method, and executable program creation program
US10379821B1 (en) Optimization tracing
Masci et al. Using PVSio-web to demonstrate software issues in medical user interfaces
US20070208995A1 (en) Document Processing Device and Document Processing Method
US20070198915A1 (en) Document Processing Device And Document Processing Method
US11726781B2 (en) Code reading supporting device, code reading supporting method, and storage medium
JP5091520B2 (en) Hybrid model simulation device
US8397154B2 (en) Remotely controlling a browser program
Jiang et al. Log-it: Supporting Programming with Interactive, Contextual, Structured, and Visual Logs
CN101303663A (en) Simulation test method for digital set-top box software development
JP2007041846A (en) Program display method and device
JP7260150B2 (en) WEBSITE DESIGN SUPPORT DEVICE, WEBSITE DESIGN SUPPORT METHOD, AND PROGRAM
Bahlke et al. Context-sensitive editing with PSG environments
JP2008243042A (en) Simulation device, method, and program for hybrid model
JP3971915B2 (en) Measuring instrument control program, measuring instrument, and computer-readable storage medium storing measuring instrument control program
CN112199097B (en) Installation package generation method, installation package generation device, computer equipment and storage medium
JPS6383861A (en) Automatic processing system for numerical formula
CN113094044B (en) Method and terminal for writing PPT UI plug-in code
JP3731628B2 (en) CGI program creation method
JP5254149B2 (en) Plant model creation system and plant model creation method
JP4201206B2 (en) CGI program creation method, recording medium recording program according to the method, and CGI program creation device
Wiriyakul et al. A visual editor for language-independent scripting for BPMN modeling

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

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120821

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120914

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150921

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 5091520

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150921

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250