JP2004220577A - Simulation method and simulation program - Google Patents

Simulation method and simulation program Download PDF

Info

Publication number
JP2004220577A
JP2004220577A JP2003416847A JP2003416847A JP2004220577A JP 2004220577 A JP2004220577 A JP 2004220577A JP 2003416847 A JP2003416847 A JP 2003416847A JP 2003416847 A JP2003416847 A JP 2003416847A JP 2004220577 A JP2004220577 A JP 2004220577A
Authority
JP
Japan
Prior art keywords
program
description
simulation
continuous system
event
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.)
Granted
Application number
JP2003416847A
Other languages
Japanese (ja)
Other versions
JP4564255B2 (en
Inventor
Mitsunobu Yoshida
充伸 吉田
Koichi Kondo
浩一 近藤
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 JP2003416847A priority Critical patent/JP4564255B2/en
Publication of JP2004220577A publication Critical patent/JP2004220577A/en
Application granted granted Critical
Publication of JP4564255B2 publication Critical patent/JP4564255B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a simulation method and program suitable for a linked simulation with control software controlling a mechanism system. <P>SOLUTION: This mechanism simulator simulates behavior of a mechanism along a time axis based on a hybrid model description. This simulator analyses the hybrid model description and extracts a description of a continuity equation, a description on a state transition, and a description on an additional processing respectively. A first program based on the description on the continuity equation, a second program based on the description on the state transition and a third program based on the description on the additional processing which are called in the execution of the simulation respectively are created. The first, second and third programs are connected to the execution part of the mechanism simulator. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

本発明は、コンピュータを用いて機械等の挙動のシミュレーションを行うための方法およびプログラムに関し、特に本発明はハイブリッドモデルを用いるものである。   The present invention relates to a method and a program for simulating the behavior of a machine or the like using a computer, and in particular, the present invention uses a hybrid model.

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

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

ハイブリッドモデルを記述するための言語として、米国ゼロックス社(商標)のパロアルト研究所にて創作されたHCC(Hybrid Concurrent Constraint Programming)と呼ばれる言語がある(下記非特許文献1参照)。HCCは発展途上にあり、現在も米国NASAのエイムズ研究所において研究が進められている。HCCは制約処理プログラミング(コンストレイントプログラミング)と呼ばれる技術の一種であり、連続系モデルを表現する常微分方程式や代数方程式を制約として扱い、これら方程式をそのまま順不同で記述することができる。このような制約記述に、状態遷移を制御する記述を付加してHCC言語のハイブリッドモデルは完成される。HCCによれば、方程式をそのまま制約として羅列する(プログラミングする)ことができ、複雑なモデルを記述可能である。   As a language for describing a hybrid model, there is a language called HCC (Hybrid Concurrent Constraint Programming) created at Palo Alto Research Laboratory of Xerox Corporation (trademark) (see Non-Patent Document 1 below). HCC is in the process of being developed and is still being studied at NASA's Ames Institute. HCC is a kind of technique called constraint processing programming (constraint programming), and treats ordinary differential equations and algebraic equations expressing a continuous system model as constraints, and can describe these equations as they are in no particular order. A description for controlling the state transition is added to such a constraint description to complete a hybrid model of the HCC language. According to the HCC, equations can be listed (programmed) as constraints as they are, and a complicated model can be described.

このようにハイブリッドモデルの技術を用いれば、系の特性を常微分方程式などでモデル表現し、初期状態から時間の推移に従ってどのような挙動を示すかをシミュレーションすることができる。   By using the hybrid model technique, the characteristics of the system can be model-represented by ordinary differential equations or the like, and the behavior of the system can be simulated from the initial state according to the transition of time.

微分方程式などで表現可能な対象や現象を的確にモデル化できるハイブリッドモデルの技術の応用例として、ソフトウェアにより機構が制御されるメカトロニクス機器の機構シミュレーションがある。かかる機構シミュレーションによれば、機構の実機が存在しない状況においても、当該機構を制御する制御ソフトウェアのプロトタイピング、テスト、あるいはデバッグなどが行えるようになる。
インターネット<URL:http://www2.parc.com/spl/projects/mbc/publications.html#cclanguages>
As an application example of a hybrid model technology capable of accurately modeling an object or a phenomenon that can be expressed by a differential equation or the like, there is a mechanism simulation of a mechatronics device whose mechanism is controlled by software. According to such a mechanism simulation, prototyping, testing, debugging, or the like of control software for controlling the mechanism can be performed even in a situation where there is no actual machine of the mechanism.
Internet <URL: http://www2.parc.com/spl/projects/mbc/publications.html#cclanguages>

しかし、ハイブリッドモデルを扱うことのできる公知のプログラム言語は、必ずしもメカトロニクス機器の機構シミュレーションに応用することを目的に開発されたものではなく、このため次のような問題点がある。   However, a known programming language that can handle a hybrid model is not necessarily developed for application to the mechanism simulation of a mechatronic device, and therefore has the following problems.

例えば米国ゼロックス社(商標)のHCCは、インタプリタ型のプログラミング言語であり、たとえば制御ソフトウェアが機構に送信するアクチュエータへの動作コマンドなどを、シミュレータの外部から制御信号として受け取るような構成とする場合、外部関数などを個別に定義する必要がある上、プログラミングにおいてかなりの工夫を必要とする。   For example, HCC of Xerox Corporation (trademark) of the United States is an interpreter-type programming language. For example, when the control software receives an operation command to be transmitted to a mechanism from a mechanism to an actuator as a control signal from outside the simulator, It is necessary to define external functions and the like individually, and it requires considerable contrivance in programming.

具体的には、モデル作成者は外部関数のプログラミングについて例えば以下の作業が必要となる。   Specifically, the model creator needs, for example, the following work for programming the external function.

(1)外部関数のプログラムを、HCC言語固有の外部関数記述用APIを利用してC言語などの別の言語で記述する。 (1) A program of an external function is described in another language such as C using an external function description API specific to the HCC language.

(2)記述した外部関数のプログラムをC言語のコンパイラによってコンパイルし、例えば実行時にリンク可能なダイナミックリンクライブラリを作成する。 (2) The described external function program is compiled by a C language compiler to create, for example, a dynamic link library that can be linked at the time of execution.

(3)HCCのインタプリタが呼び出せるように、HCCのインタプリタがそのパスを特定可能なディレクトリ上に作成されたライブラリを配置する。 (3) The HCC interpreter arranges the created library in a directory whose path can be specified so that the HCC interpreter can call the library.

したがって、モデル作成者はHCC言語固有の外部関数記述用APIの習得が必要であるし、シミュレーション実行時には外部関数を別途コンパイルする手間もかかる。   Therefore, the model creator needs to learn an API for describing an external function specific to the HCC language, and it takes time to separately compile the external function when executing a simulation.

また、モデル記述中の外部関数の呼び出し方法に関しても、外部関数の実行をイベントに関連付けて管理しないHCCでは、状態遷移が発生した瞬間に呼び出す場合と、数値積分時に呼び出す場合の両方の記述が可能であることから、モデル作成者は外部関数が実行されるタイミングを把握しにくく、モデル作成に高度な熟練を要する。   Regarding the method of calling the external function in the model description, the HCC that does not manage the execution of the external function by associating it with the event can be described both when it is called at the moment when a state transition occurs and when it is called at the time of numerical integration. Therefore, it is difficult for the model creator to grasp the timing at which the external function is executed, and a high level of skill is required for model creation.

本発明はかかる事情を考慮してなされたものであり、ハイブリッドモデルを用いて複雑な機構系を簡便かつ正確にモデル化でき、該機構系を制御する制御ソフトウェアとの連携シミュレーションにも好適なシミュレーション方法およびプログラムを提供することを目的とする。   The present invention has been made in view of such circumstances, and a complex mechanism system can be easily and accurately modeled using a hybrid model, and a simulation suitable for coordination simulation with control software for controlling the mechanism system is also provided. It is intended to provide a method and a program.

また、外部との連携などに関わる処理を記述するプログラムを直接ハイブリッドモデル記述の一部に含めることを可能にし、シミュレーションの適用範囲を拡大することを目的とする。   It is another object of the present invention to allow a program describing a process related to external cooperation to be directly included in a part of a hybrid model description, and to expand a simulation application range.

本発明の一観点に係るシミュレーション方法は、ハイブリッドモデルを利用した記述データに基づいて、対象とする機構の挙動を時間軸に沿ってシミュレーションするシミュレーション方法であって、前記記述データに含まれる連続系方程式の記述、状態遷移に伴う該連続系方程式の切り替えに関する記述、及び前記連続系方程式で表現される処理以外の処理に関する記述を抽出するため、前記記述データを解析する解析ステップと、前記解析ステップにおいて抽出された前記連続系方程式の記述に基づいて、第1のプログラムを生成する第1のプログラム生成ステップと、前記解析ステップにおいて抽出された前記状態遷移に伴う連続系方程式の切り替えに関する記述に基づいて、第2のプログラムを生成する第2のプログラム生成ステップと、前記解析ステップにおいて抽出された前記連続系方程式で表現される処理以外の処理に関する記述に基づいて、第3のプログラムを生成する第3のプログラム生成ステップと、前記第1のプログラムを実行することにより、前記連続系方程式をシミュレーション実行可能なデータ構造に変換する変換ステップと、前記第2のプログラムを実行することにより、イベントの発生に応じて前記連続系方程式の有効・無効を切り替える切り替えステップと、前記切り替えステップにおいて有効とされた前記連続系方程式に対応する前記データ構造を用いて、時間軸に沿った数値積分により該連続系方程式を解いて、前記機構の挙動を表すデータを出力するシミュレーションを実行するシミュレーション実行ステップと、前記第3のプログラムを実行することにより、前記連続系方程式で表現される処理以外の処理を実行する処理実行ステップとを具備する。   A simulation method according to one aspect of the present invention is a simulation method for simulating the behavior of a target mechanism along a time axis based on description data using a hybrid model, wherein a continuous system included in the description data is included. An analysis step of analyzing the description data to extract a description of an equation, a description of switching of the continuous system equation in accordance with a state transition, and a description of a process other than the process represented by the continuous system equation; and the analysis step. A first program generation step of generating a first program based on the description of the continuous system equation extracted in step (a), and a description of switching of the continuous system equation accompanying the state transition extracted in the analysis step. A second program generation step for generating a second program. And a third program generation step of generating a third program based on a description of a process other than the process represented by the continuous system equation extracted in the analysis step, and executing the first program. A converting step of converting the continuous system equation into a data structure capable of performing a simulation, and a switching step of executing the second program to switch between valid / invalid of the continuous system equation according to occurrence of an event Using the data structure corresponding to the continuous system equation validated in the switching step, solving the continuous system equation by numerical integration along a time axis, and outputting data representing the behavior of the mechanism. A simulation execution step of executing a simulation, and the third program By executing comprises a processing execution step of executing a processing other than the processing represented by the continuous system equation.

本発明によれば、ハイブリッドモデルを用いて複雑な機構系を簡便かつ正確にモデル化でき、該機構系を制御する制御ソフトウェアとの連携シミュレーションにも好適なシミュレーション方法およびプログラムを提供できる。   ADVANTAGE OF THE INVENTION According to this invention, a complex mechanism system can be modeled easily and accurately using a hybrid model, and the simulation method and program suitable also for cooperation simulation with the control software which controls this mechanism system can be provided.

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

(第1実施形態)
図1は本発明の第1実施形態に係る機構シミュレータの概略構成を示すブロック図である。
(1st Embodiment)
FIG. 1 is a block diagram showing a schematic configuration of the mechanism simulator according to the first embodiment of the present invention.

本実施形態は、ハイブリッドモデル前処理部201と、ハイブリッドモデルシミュレーション実行部102とにより構成されている。ハイブリッドモデル記述104は、ハイブリッドモデル記述言語等で記述されたソースプログラムであって、本実施形態に係るハイブリッドモデル前処理部201への入力である。ハイブリッドモデルシミュレーション実行部102からの出力は、連続系シミュレーション部103による連続系シミュレーションの結果として得られた変数値の演算結果およびその時間履歴である。この出力は変数値時間履歴記憶部105に記憶される。   This embodiment includes a hybrid model preprocessing unit 201 and a hybrid model simulation execution unit 102. The hybrid model description 104 is a source program described in a hybrid model description language or the like, and is an input to the hybrid model preprocessing unit 201 according to the present embodiment. The output from the hybrid model simulation execution unit 102 is a calculation result of a variable value obtained as a result of the continuous system simulation by the continuous system simulation unit 103 and its time history. This output is stored in the variable value time history storage unit 105.

図1に示すように、ハイブリッドモデル前処理部201は、制御情報解析部110を備える。また、ハイブリッドモデルシミュレーション実行部102は、イベント処理部111、方程式構文解析部112、方程式データ記憶部114、連続系方程式切り替え部115、付加処理実行部205、及び連続系シミュレーション部103を備える。なお、本実施形態は一般的なコンピュータを用いて構成することができ、その基本的なハードウェア構成として、図示しないが中央演算ユニット(CPU)、メモリ、外部記録装置、通信インターフェース(I/F)、および表示装置やキーボード、マウス等の入力装置を備える。また、これらのハードウェアを制御するためのオペレーティングシステム(OS)を備える。また、本発明の実施形態に係る機構シミュレータは、このようなオペレーティングシステム上で動作するアプリケーションソフトウェアとして実装することができる。   As shown in FIG. 1, the hybrid model preprocessing unit 201 includes a control information analysis unit 110. The hybrid model simulation execution unit 102 includes an event processing unit 111, an equation syntax analysis unit 112, an equation data storage unit 114, a continuous system equation switching unit 115, an additional processing execution unit 205, and a continuous system simulation unit 103. Note that the present embodiment can be configured using a general computer, and its basic hardware configuration includes a central processing unit (CPU), a memory, an external recording device, and a communication interface (I / F, not shown). ) And input devices such as a display device, a keyboard, and a mouse. Further, an operating system (OS) for controlling these hardware is provided. The mechanism simulator according to the embodiment of the present invention can be implemented as application software that operates on such an operating system.

このような本実施形態に係る機構シミュレータの構成及びその処理手順について説明する前に、ここではまずハイブリッドモデル記述104がどのように記述されるのか、具体例を挙げて説明する。   Before describing the configuration of the mechanism simulator according to the present embodiment and its processing procedure, here, first, how the hybrid model description 104 is described will be described using a specific example.

図2および図3は、具体例に係るハイブリッドモデルの記述対象である機構を示す図である。この機構は、バルブ301、バネ303、およびピストン302を備えた簡素な構造のシリンダ装置である。   FIG. 2 and FIG. 3 are diagrams illustrating a mechanism to be described in a hybrid model according to a specific example. This mechanism is a cylinder device having a simple structure including a valve 301, a spring 303, and a piston 302.

バルブ301は外部からの指令(イベント)に応じて開閉動作する。これによりシリンダ装置内の空気の流れを図2のように右側に変更するイベントを以下、「Left」と呼び、空気の流れを図3のように左側に変更するイベントを「Right」と呼ぶ。図2は、バルブ301にLeftのイベントが与えられた状態を示しており、ピストン302には紙面右向きの力が作用している。この状態を示す運動方程式はシリンダ装置の下部に示してあるように、「-F=mx''」である。これに対し図3は、バルブ301にRightのイベントが与えられた状態を示しており、空気の流れの向きが変わり、運動方程式は同図のように「F=mx''」に変化している。   The valve 301 opens and closes in response to an external command (event). An event that changes the air flow in the cylinder device to the right as shown in FIG. 2 is hereinafter referred to as “Left”, and an event that changes the air flow to the left as shown in FIG. 3 is referred to as “Right”. FIG. 2 shows a state in which a Left event is given to the valve 301, and a rightward force on the paper surface is acting on the piston 302. The equation of motion showing this state is "-F = mx", as shown at the bottom of the cylinder device. On the other hand, FIG. 3 shows a state in which a right event is given to the valve 301, the direction of the air flow changes, and the equation of motion changes to "F = mx" as shown in FIG. I have.

図4は、このような機構の挙動を、状態の遷移とそれぞれの状態に対応する運動方程式とからなる状態遷移図として表現したものである。ハイブリッドモデルは、この図4に示されるような状態遷移と、各状態の記述が微分方程式や代数方程式あるいはそれらの連立方程式(連続系方程式)で表現されるものを指す。図4によれば、状態が2つあって、かかる2つの状態間に状態遷移が存在することがわかる。   FIG. 4 illustrates such a behavior of the mechanism as a state transition diagram including state transitions and equations of motion corresponding to each state. The hybrid model refers to a state transition as shown in FIG. 4 and a description of each state expressed by a differential equation, an algebraic equation, or a simultaneous equation (continuous system equation) thereof. FIG. 4 shows that there are two states, and that there is a state transition between the two states.

本発明では、図4の状態遷移図をもとに具体的なハイブリッドモデルの内容をHCC(Hybrid Concurrent Constraint Programming)言語で記述するとともに、連続系方程式で表現される処理以外の処理、例えば、外部との連携などに関わる処理(以下「付加処理」という)を所定のプログラム言語で記述することによりハイブリッドモデル記述104が生成される。   In the present invention, based on the state transition diagram of FIG. 4, the specific contents of the hybrid model are described in HCC (Hybrid Concurrent Constraint Programming) language, and processing other than processing expressed by continuous system equations, for example, external processing The hybrid model description 104 is generated by describing a process (hereinafter, referred to as “additional process”) related to cooperation with the program in a predetermined program language.

図5は、本発明にかかるハイブリッドモデル記述に相当するプログラムの一例を示す図である。図5において、(ソース)プログラムの論理行番号を仮にL1〜L23とする。L3、L4、およびL8は、上記した機械装置の初期状態やバルブ操作タイミング等の運転条件の記述に相当し、L5およびL6は図4に示した状態遷移の表現記述に相当する。また、L9〜L23は付加処理に係る記述であり、ここでは「現在の状態をファイルに書き込む」という内容の処理が記述されている。なお、module文には"C"と指定されており、該当するL9〜L17はC言語によるプログラム記述となっている。   FIG. 5 is a diagram showing an example of a program corresponding to the hybrid model description according to the present invention. In FIG. 5, assume that the logical line numbers of the (source) program are L1 to L23. L3, L4, and L8 correspond to the description of the operating conditions such as the initial state of the mechanical device and the valve operation timing, and L5 and L6 correspond to the description of the state transition shown in FIG. In addition, L9 to L23 are descriptions relating to the additional processing, and here, processing having a content of “writing the current state to a file” is described. Note that "C" is designated in the module statement, and the corresponding L9 to L17 are program descriptions in the C language.

HCC言語では、図5のL5およびL6から分かるように、運動方程式をプログラム内でそのまま記述することができる。L5およびL6とでは状態が異なる。また、それぞれの状態において、当該状態へ遷移する条件を前提条件といい、「always if」に続いて記述される。また、当該状態をキャンセルする条件、言い替えれば当該状態から遷移していく条件を遷移条件といい、「watching」に続けて記述される。   In the HCC language, as can be seen from L5 and L6 in FIG. 5, the equation of motion can be described directly in the program. The state differs between L5 and L6. In each state, a condition for transition to the state is referred to as a precondition, which is described after "always if". A condition for canceling the state, in other words, a condition for transitioning from the state, is referred to as a transition condition, and is described after "watching".

なお、HCCでは、プログラムの記述の順序(例えば図5における論理行番号L1→L8の順序)にそって実行されるわけではない。HCCでは、個別のプログラム記述のうち、シミュレーションを実行する時間軸に沿って成立するものが探索され、実行される。すなわち、論理行番号L1→L8の順序は、実行順序とは関係がない。たとえば、シミュレーションを開始した時点では、L3およびL8のみが有効である。ここで、イベントRight(ev1)がL3により発生するため、L6の前提条件であるRightが有効となり、L6に記述されている運動方程式eq2が有効になる。つまり、図4の左側の状態からシミュレーションが実行されることになる。   In the HCC, the program is not executed in the order of program description (for example, the order of logical line numbers L1 to L8 in FIG. 5). The HCC searches and executes individual program descriptions that are established along the time axis for executing the simulation. That is, the order of the logical row numbers L1 → L8 has no relation to the execution order. For example, when the simulation is started, only L3 and L8 are valid. Here, since the event Right (ev1) is generated by L3, Right, which is a precondition of L6, becomes valid, and the equation of motion eq2 described in L6 becomes valid. That is, the simulation is executed from the state on the left side of FIG.

さらに、時間が50になるとL4が有効となり、イベントLeft(ev2)が発生し、L6の遷移条件(「watching」以下、すなわちLeft)が有効となって、L6の運動方程式eq2が無効となる。これに代わって、L5の前提条件が有効となり、運動方程式eq1が有効となる。   Further, when the time reaches 50, L4 becomes valid, an event Left (ev2) occurs, the transition condition of L6 (“watching” or less, that is, Left) becomes valid, and the motion equation eq2 of L6 becomes invalid. Instead, the precondition of L5 becomes valid, and the equation of motion eq1 becomes valid.

なお、以上のようなプログラム例は外部からのイベントによって状態が遷移する場合を記述したもの(L5、L6)であったが、勿論、内部の状況によって状態を遷移させてもよい。たとえば、図2においてバルブ301が切り替えられない場合には、移動するピストン302がバネ303に接触し、該バネ303からの反力を受けるようになる。すなわちピストン302の位置に関して、外部からのイベントが無い場合でも状態遷移が起こる場合が存在する。このような場合は、例えばxが正であるかどうかといった内部変数の評価式(不等式)による評価結果に基づいて状態遷移の必要性を判断できる。   Although the above-described program example describes the case where the state is changed by an external event (L5, L6), the state may be changed according to the internal situation. For example, when the valve 301 is not switched in FIG. 2, the moving piston 302 comes into contact with the spring 303 and receives a reaction force from the spring 303. That is, regarding the position of the piston 302, there is a case where a state transition occurs even when there is no external event. In such a case, for example, the necessity of the state transition can be determined based on the evaluation result of an internal variable evaluation expression (inequality) such as whether or not x is positive.

一般的に、ハイブリッドモデルは、常微分方程式や代数方程式を連立させた連立方程式によって表現される連続系モデルと、イベント発生に伴う状態遷移を表現するための状態遷移モデルとを組み合わせたモデルである。ハイブリッドモデルによれば、連続系モデルで表現される状態が外部からのイベントなどにより瞬時に切り替わるシステムを表現することができる。   In general, a hybrid model is a combination of a continuous system model represented by a system of simultaneous ordinary differential equations and algebraic equations, and a state transition model for representing a state transition accompanying an event occurrence. . According to the hybrid model, a system in which the state represented by the continuous system model is instantaneously switched by an external event or the like can be represented.

さらに、時間が100になるとL19が有効となり、イベントE(ev5)が発生し、cPrintという関数が引数xの値とともに呼び出される(L18〜L23)。この記述は、その時点での状態をファイルに保存する付加処理が実行されることを示しており、その具体的な処理の内容は、L9〜L17において例えばC言語で記述されている。   Further, when the time reaches 100, L19 becomes valid, an event E (ev5) occurs, and a function called cPrint is called with the value of the argument x (L18 to L23). This description indicates that additional processing for saving the state at that time in a file is executed, and the specific processing contents are described in, for example, the C language in L9 to L17.

行L18〜L23は付加処理(L11〜L16)を制御するハイブリッドモデル記述104の内容である。process(E)cPrint(x)という記述は、イベントEの発生に伴い付加処理すなわちcPrint(x)を実行せよ、という命令構文である。ここで、付加処理の実行制御に関係するイベントは連続系方程式の切り替えに関係するLeftイベント、Rightイベントと同じイベントを使って記述可能である。   Lines L18 to L23 are the contents of the hybrid model description 104 that controls the additional processing (L11 to L16). The description “process (E) cPrint (x)” is a command syntax for executing additional processing, that is, cPrint (x), when the event E occurs. Here, the event related to the execution control of the additional processing can be described using the same event as the Left event and the Right event related to the switching of the continuous system equation.

このような本実施形態によれば、(1)付加処理の内容を、連続系方程式の切り替えを有するハイブリッドモデルに相当する記述と同一のプログラムソース上に記述できる。また、(2)付加処理を呼び出したりする等の制御をハイブリッド記述できる。したがって、分かりやすく簡潔なシミュレーションモデルを記述できる。   According to this embodiment, (1) the contents of the additional processing can be described on the same program source as the description corresponding to the hybrid model having the switching of the continuous system equation. In addition, (2) control such as calling additional processing can be described in a hybrid manner. Therefore, a simple and easy-to-understand simulation model can be described.

次に、ハイブリッドモデル前処理部201における処理について説明する。ハイブリッドモデル記述104は、まずハイブリッドモデル前処理部201の制御情報解析部110において処理され、モデル方程式登録プログラム202、イベント制御プログラム203、及びシミュレーション実行時付加処理プログラム204が生成される。   Next, processing in the hybrid model preprocessing unit 201 will be described. The hybrid model description 104 is first processed by the control information analysis unit 110 of the hybrid model preprocessing unit 201, and a model equation registration program 202, an event control program 203, and a simulation execution additional processing program 204 are generated.

ハイブリッドモデルシミュレーション実行部102を構成するソフトウェアモジュールとして、モデル方程式の登録を行うための関数及び連続系方程式を切り替えるための関数がAPI(Application Program Interface)関数として提供される。モデル方程式登録プログラム202およびイベント制御プログラム203は、該当する上記API関数を呼び出す記述を、入力されたハイブリッドモデル記述104に沿って適切に組み合わせたプログラムである。この観点から考えると、ハイブリッドモデル前処理部201は、入力をハイブリッドモデル記述104とし、出力を例えばC言語のAPI関数呼び出しの記述を含むCプログラム(ソース)とするような、一種のコンパイラと考えることもできる。このようなモデル方程式登録プログラム202とイベント制御プログラム203は、さらにC言語などのコンパイラによりコンパイルされ、例えば実行時に動的にリンク可能なライブラリが生成される。ハイブリッドモデルシミュレーション実行部102では、シミュレーション実行にあたって、生成された動的リンクライブラリがリンクされ、入力ハイブリッドモデルを忠実に再現するシミュレーションプログラムが完成し、実行可能になる。なお、生成されるこれらのライブラリは必ずしも動的リンクライブラリである必要はなく、静的なライブラリであってもよい。   As software modules constituting the hybrid model simulation execution unit 102, a function for registering a model equation and a function for switching a continuous system equation are provided as API (Application Program Interface) functions. The model equation registration program 202 and the event control program 203 are programs that appropriately combine descriptions for calling the corresponding API functions according to the input hybrid model description 104. From this viewpoint, the hybrid model preprocessing unit 201 is considered as a kind of compiler in which the input is a hybrid model description 104 and the output is a C program (source) including a description of an API function call in C language, for example. You can also. The model equation registration program 202 and the event control program 203 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. The hybrid model simulation execution unit 102 links the generated dynamic link library when executing the simulation, and completes and executes a simulation program that faithfully reproduces the input hybrid model. Note that these generated libraries need not necessarily be dynamic link libraries, and may be static libraries.

ハイブリッドモデルシミュレーション実行部102のアプリケーションインターフェースを構成する具体的なソフトウェアモジュールの仕様などは様々考えられるが、ここでは説明の都合上、以下の3つのAPI関数が最低定義されているとする。なお、プログラミング言語はC言語とする。

Figure 2004220577
Various specifications and the like of specific software modules constituting the application interface of the hybrid model simulation execution unit 102 can be considered, but here, for convenience of explanation, it is assumed that the following three API functions are defined at a minimum. The programming language is C language.
Figure 2004220577

1つ目のAPI関数XXX_AddEqnDataは、1つの連続系方程式を表す文字列のポインタを引数に指定する。XXX_AddEqnDataは、この連続系方程式を構文解析し、連続系方程式の記述をシミュレーション実行可能なデータ構造(内部データ表現)に変換し、かかる内部データ表現を方程式データ記憶部114に登録する処理を行う。なお、ここの連続系方程式には、ユニークなID番号が割り当てられる。   The first API function XXX_AddEqnData specifies a pointer of a character string representing one continuous system equation as an argument. XXX_AddEqnData performs a process of parsing the continuous system equation, converting the description of the continuous system equation into a data structure (internal data expression) capable of executing a simulation, and registering the internal data expression in the equation data storage unit 114. Here, a unique ID number is assigned to the continuous system equation.

たとえば「ab/cos(a-(c+b))-3c」という式が与えられたと仮定すると、上記内部データ表現として図6のような木構造を生成する。この木構造において、例えば参照数字61は線形多項式の親ノード(節)、62は掛け算のノード、63は割り算のノード、64は外部関数(四則演算以外の意)のノード、65は線形多項式を構成する各項のノードを表している。本例において、木構造の葉に相当するものはすべて変数(a,b,c)であり、これらに実数の係数が加わって線形式となる。線形式はcos などの外部関数の引数になったり、掛け算や割り算の対象となる。変数には、別途、値が確定しているかどうかのフラグが設けられており、またこのような木構造のデータに基づいて該変数の現在の値が保持される。木構造のすべての葉の値(すなわち変数の値)が確定していれば、式の値を計算することができる。方程式データ記憶部114では、式の値の計算などを高速に行うことができるように、予め内部のデータ構造をつなぎ合わせて木構造を構成してある。上記処理において何らかのエラーが発生した場合には、err にエラーコードがセットされる。正常に処理が終了した場合は、登録された方程式のID番号を返り値とする。   For example, assuming that the expression "ab / cos (a- (c + b))-3c" is given, a tree structure as shown in FIG. 6 is generated as the internal data expression. In this tree structure, for example, reference numeral 61 denotes a parent node (section) of a linear polynomial, 62 denotes a multiplication node, 63 denotes a division node, 64 denotes a node of an external function (meaning other than the four arithmetic operations), and 65 denotes a linear polynomial. It represents the nodes of each of the constituent terms. In this example, all of the leaves corresponding to the tree structure are variables (a, b, c), which are added to real coefficients to form a linear form. The linear form is used as an argument of an external function such as cos, and is subject to multiplication and division. The variable is separately provided with a flag indicating whether or not the value is determined, 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 (that is, the values of the variables) are determined, the value of the expression can be calculated. In the equation data storage unit 114, a tree structure is formed in advance by connecting the internal data structures so that the calculation of the value of the equation can be performed at a high speed. If any error occurs in the above processing, an error code is set in err. If the processing is completed normally, the ID number of the registered equation is used as the return value.

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

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

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

また、制御情報解析部110は、シミュレーション実行の際に、時間がΔt進むごとに条件のチェックおよび方程式の変更(入れ替え)を行う関数(ChangeEqn)も生成する。これはイベント制御プログラム203(第2のプログラム)に相当する。   Further, the control information analysis unit 110 also generates a function (ChangeEqn) for checking conditions and changing (exchanging) equations every time the time advances by Δt during the simulation. This corresponds to the event control program 203 (second program).

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

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

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

また、ハイブリッドモデル前処理部201は、ハイブリッドシミュレーションモデルをいったん付加処理と同一の言語として出力するため、容易にハイブリッドシミュレーション実行プログラムを生成可能である。   Also, the hybrid model preprocessing unit 201 can easily generate a hybrid simulation execution program because the hybrid simulation model is output once in the same language as the additional processing.

以上からハイブリッドシミュレーションと外部機器との連携が容易になる。   As described above, the cooperation between the hybrid simulation and the external device becomes easy.

さらに、制御情報解析部110は、付加処理の内容記述をハイブリッドモデル記述104から抽出する。かかる記述が、シミュレーション実行部付加処理プログラム204(第3のプログラム)に相当する。シミュレーション実行部付加処理プログラム204はハイブリッドモデル記述104中でもともとC言語などにより記述されたプログラムのソースに相当する。例えば図5に示したハイブリッドモデル記述104中では、module文が参照され、C言語で記述された部分が抽出される。抽出されたシミュレーション実行部付加処理プログラム204は、C言語コンパイラによりコンパイルされ、動的にリンク可能なライブラリが生成される。付加処理実行部205は、この動的にリンク可能なライブラリを呼び出すインターフェースの役割を担う。なお、生成されるライブラリは必ずしも動的リンクライブラリである必要はなく、静的なライブラリであってもよい。また、付加処理の内容を記述する言語はC言語に限定されない。   Further, the control information analysis unit 110 extracts the content description of the additional processing from the hybrid model description 104. Such a description corresponds to the simulation execution unit addition processing program 204 (third program). The simulation execution unit addition processing program 204 corresponds to a source of a program originally described in the C language or the like in the hybrid model description 104. For example, in the hybrid model description 104 shown in FIG. 5, a module statement is referred to and a portion described in C language is extracted. The extracted simulation execution unit additional processing program 204 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 the dynamically linkable library. Note that the generated library does not necessarily need to be a dynamic link library, but may be a static library. The language for describing the contents of the additional processing is not limited to the C language.

上記したようなハイブリッドモデル前処理部201における処理により、例えば、図5に示したハイブリッドモデル記述について、以下のようなC言語のソースプログラムが自動生成される。

Figure 2004220577
By the processing in the hybrid model preprocessing unit 201 as described above, for example, the following C language source program is automatically generated for the hybrid model description shown in FIG.
Figure 2004220577

なお、GetEventは、引数に指定された名前(eventname)のイベントが生起しているかどうかをチェックする関数である。   Note that GetEvent is a function for checking whether an event having the name (eventname) specified in the argument has occurred.

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

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

次に、シミュレーションの実行について説明する。シミュレーション実行時においては、ハイブリッドモデルシミュレーション実行部102が起動され、連続系方程式の値を計算することでシミュレーション実行が行われる。このとき、連続系方程式切り替え部115は、イベント処理部111の内部で呼び出され、連続系方程式の切り替えを有効・無効のフラグを用いて実行する。イベント処理部111は前処理において生成されたイベント制御プログラム203(第2のプログラム;ChangeEqn)に対応する。図2の状態では、図5の運動方程式eq1は無効であり、運動方程式eq2が有効になっている。ここで、Leftのイベントが発生した図3の状況においては、図5の運動方程式eq1を有効にし、運動方程式eq2を無効にするようフラグを操作する。これら有効・無効のフラグは方程式データ記憶部114に記憶される方程式それぞれの属性データとして管理される。   Next, execution of a simulation will be described. At the time of executing the simulation, the hybrid model simulation execution unit 102 is started, and the simulation is executed by calculating the value of the continuous system equation. At this time, the continuous system equation switching unit 115 is called inside the event processing unit 111, and executes switching of the continuous system equation using a valid / invalid flag. The event processing unit 111 corresponds to the event control program 203 (second program; ChangeEqn) generated in the pre-processing. In the state of FIG. 2, the motion equation eq1 of FIG. 5 is invalid, and the motion equation eq2 is valid. Here, in the situation of FIG. 3 in which the event of Left occurs, the flag is operated so that the motion equation eq1 of FIG. 5 is made valid and the motion equation eq2 is made invalid. These valid / invalid flags are managed as attribute data of each equation stored in the equation data storage unit 114.

連続系シミュレーション部103は、方程式データ記憶部114を参照し、同記憶部114に木構造の形式で格納されている連続系方程式の内部データ表現を演算対象として、時間ステップづつ数値積分を実行する。シミュレーションは、常微分方程式及び代数多項式の連立からなる非線形連立方程式についての初期値問題である。このため、例えば図2に示される初期状態が与えられている。具体的には、例えば一般によく使われているルンゲクッタアルゴリズムを用いて解の値を計算する。   The continuous system simulation unit 103 refers to the equation data storage unit 114, and performs a numerical integration step by step on the internal data representation of the continuous system equation stored in the storage unit 114 in the form of a tree structure. . The simulation is an initial value problem for a nonlinear system of equations consisting of a system of ordinary differential equations and algebraic polynomials. For this reason, for example, the initial state shown in FIG. 2 is given. Specifically, the value of the solution is calculated using, for example, a generally used Runge-Kutta algorithm.

必要なデータは機構シミュレータから出力を行い、さらに連続系方程式切り替え部115の処理に戻り、上記の処理を繰り返すことにより必要な時間のシミュレーションを実行する。シミュレーション結果は、変数値時間履歴記憶部105に保存され、シミュレーション終了後の分析などに利用される。   Necessary data is output from the mechanism simulator, and the process returns to the process of the continuous system equation switching unit 115, and a simulation of a necessary time is executed by repeating the above process. The simulation result is stored in the variable value time history storage unit 105 and is used for analysis after the end of the simulation.

図7は、以上説明した本発明の第1実施形態に係る機構シミュレーションにおける一連の処理手順を示すフローチャートである。この処理手順はハイブリッドモデル前処理の段階とシミュレーション実行の段階とに大別できる。   FIG. 7 is a flowchart illustrating a series of processing procedures in the mechanism simulation according to the first embodiment of the present invention described above. This processing procedure can be broadly divided into a hybrid model preprocessing stage and a simulation execution stage.

まず、ハイブリッドモデル記述104が制御情報解析部110に入力され、ハイブリッドモデルの構文解析が行われる(ステップS1)。制御情報解析部110は図1に示すようにモデル方程式登録プログラム202、イベント制御プログラム203、及びシミュレーション実行時付加処理プログラム204をそれぞれ生成する。シミュレーション実行のための前処理を終えると、ここからシミュレーション実行の段階に移る。   First, the hybrid model description 104 is input to the control information analysis unit 110, and syntax analysis of the hybrid model is performed (step S1). The control information analysis unit 110 generates a model equation registration program 202, an event control program 203, and a simulation execution additional processing program 204 as shown in FIG. After completing the pre-processing for executing the simulation, the process proceeds to the stage of executing the simulation.

先ず、ハイブリッドモデルシミュレーション実行部102から方程式構文解析部112が呼び出される。方程式構文解析部112はモデル方程式登録プログラム202(第1のプログラム;InitEqnData)に対応し、その内部でAPI関数XXX_AddEqnDataを呼び出す。これにより連続系方程式の記述データがシミュレーション実行可能なデータ構造に変換される。変換されたデータは方程式データ記憶部114に登録される(ステップS2)。   First, the equation syntax analysis unit 112 is called from the hybrid model simulation execution unit 102. The equation syntax analysis unit 112 corresponds to the model equation registration program 202 (first program; InitEqnData), and calls the API function XXX_AddEqnData therein. Thereby, the description data of the continuous system equation is converted into a data structure that can execute the simulation. The converted data is registered in the equation data storage unit 114 (Step S2).

ステップS3においてハイブリッドモデル記述104に基づく初期状態が決定されたのち、ステップS4において、イベントが発生したかどうかを検知する。このため、ハイブリッドモデルシミュレーション実行部102はイベント処理部111を呼び出す。イベント処理部111はイベント制御プログラム203(第2のプログラム;ChangeEqn)に対応し、その内部でGetEventを呼び出す。イベントが発生したならば、制御はステップS5に進む。イベントが発生していない場合は、ステップS6に進み、連続系シミュレーション部103が数値積分を実行する。   After the initial state based on the hybrid model description 104 is determined in step S3, it is detected in step S4 whether an event has occurred. Therefore, the hybrid model simulation execution unit 102 calls the event processing unit 111. The event processing unit 111 corresponds to the event control program 203 (second program; ChangeEqn), and calls GetEvent internally. If an event has occurred, control proceeds to step S5. If no event has occurred, the process proceeds to step S6, where the continuous-system simulation unit 103 performs numerical integration.

ステップS5において、発生したイベントが付加処理に関連しているか否かを判定する。該イベントが付加処理に関連するものではない場合は、ステップS9において、状態遷移に伴う連続系方程式の切り替えが必要であるか否かを判定する。方程式の切り替えが必要であるならば、ステップS10において、有効無効フラグを操作することにより、アクティブな連続方程式の切り替えを行う。このため、API関数XXX_ActivateEqnまたはXXX_DeActivateEqnが呼び出される。ステップS9又はステップS10の実行の後に、ステップS6において連続系シミュレーション部103が数値積分を実行する。   In step S5, it is determined whether or not the generated event is related to the additional processing. If the event is not related to the additional processing, it is determined in step S9 whether or not it is necessary to switch the continuous system equation accompanying the state transition. If it is necessary to switch the equation, in step S10, the active continuous equation is switched by operating the valid / invalid flag. Therefore, the API function XXX_ActivateEqn or XXX_DeActivateEqn is called. After the execution of step S9 or step S10, in step S6, the continuous system simulation unit 103 performs numerical integration.

発生したイベントが付加処理に関連するものである場合は、ステップS11において該当する付加処理を実行する。具体的な付加処理の例としては、画面上に処理の進捗状況を表示したり、シミュレーションに関わるデータをファイルに出力するなどの処理が考えられる。ステップS11にて付加処理が実行された後、ステップS6に進み、連続系シミュレーション部103は数値積分を実行する。   If the event that has occurred is related to the additional processing, the corresponding additional processing is executed in step S11. As a specific example of the additional processing, processing such as displaying the progress of the processing on a screen or outputting data related to the simulation to a file can be considered. After the additional processing is performed in step S11, the process proceeds to step S6, where the continuous system simulation unit 103 performs numerical integration.

次に、ステップS7において終了条件の判定をする。ここでは、時間が所定のシミュレーション終了時間に到達したかどうかを判定する。シミュレーション終了時間に到達したらシミュレーション実行を終了する。それまではステップS8にて時間を1ステップ進めてステップS4に戻り、同様の処理手順を繰り返す。   Next, an end condition is determined in step S7. Here, it is determined whether or not the time has reached a predetermined simulation end time. When the simulation end time is reached, the simulation execution ends. Until then, the time is advanced by one step in step S8, the process returns to step S4, and the same processing procedure is repeated.

以上の処理を図5に示したハイブリッドモデル記述について実行した場合の時系列的な流れを図8に示す。t=0は初期状態を示し、t=0でイベントLeftが発生し連続系方程式が切り替えられ、t=100でイベントEが発生し付加処理が実行される。かかるイベント間は連続系のシミュレーションが実行されている。   FIG. 8 shows a time-series flow when the above processing is executed for the hybrid model description shown in FIG. At t = 0, the initial state is established. At t = 0, an event Left occurs, the continuous system equation is switched, and at t = 100, an event E occurs, and additional processing is executed. Between these events, a continuous simulation is executed.

ハイブリッドモデルシミュレーション実行部102が機構制御ソフトウェアシミュレータと連携し、全体として効率的にシミュレーションが実行されるためには、該シミュレーションを構成する各ステップの実行順序が適切かつ効率的に制御されなければならない。   In order for the hybrid model simulation execution unit 102 to cooperate with the mechanism control software simulator to execute the simulation efficiently as a whole, the execution order of each step constituting the simulation must be appropriately and efficiently controlled. .

既に述べたように従来では、ハイブリッドモデル記述言語(例えばHCC言語)の特性(どの行が最初に実行されるか分からない)に起因し、上記実行順序を適切かつ効率的に制御するようプログラミングするには、極めて高度なテクニックを要し、難易度の高い作業である。また、単なる変数の値を扱うのではなく、外部から得られた情報を変数に代入してからハイブリッドモデルの処理を行う場合もある。この場合、外部とのインターフェースに関わる特別な外部関数などを用意し、これらをモデルの作成者が記述しなければならなかった。   As described above, conventionally, due to the characteristics of the hybrid model description language (for example, the HCC language) (it is not known which line is executed first), programming is performed so as to appropriately and efficiently control the execution order. Is an extremely difficult task that requires extremely advanced techniques. In some cases, instead of merely treating the value of a variable, processing of a hybrid model is performed after substituting information obtained from the outside into a variable. In this case, special external functions related to the interface with the outside must be prepared, and these must be described by the model creator.

これに対し、本発明の実施形態は、図7に示した一連の処理に従いハイブリッドモデルシミュレーション実行部102を構築し、シミュレーション実行するよう構成されていることから、上記のような問題を回避できる。すなわち、機構制御ソフトウェアシミュレータ等の外部(プロセス)との間の通信に相当するソフトウェア部分をハイブリッドモデルの中にC言語などのプログラム言語で付加処理として記述でき、その機能が自動的にシミュレーションの実行に組み込まれる。   On the other hand, in the embodiment of the present invention, the hybrid model simulation executing unit 102 is constructed according to the series of processes illustrated in FIG. 7 and configured to execute the simulation, so that the above problem can be avoided. That is, a software part corresponding to communication with the outside (process) such as a mechanism control software simulator can be described as additional processing in a hybrid model in a programming language such as C language, and its function is automatically executed by the simulation. Incorporated in

本発明の実施形態によれば、複雑なシミュレーションの手順を柔軟にモデル化およびプログラミングすることが可能になる。具体的には、本実施形態は外部との連携などに関わる付加処理の記述をハイブリッドモデル記述の一部に含めることを可能にする。したがって、高度で多様なシミュレーションモデルを簡単に構築可能になることから、シミュレーションの適用範囲を拡大することができる。   According to the embodiments of the present invention, it is possible to flexibly model and program a complicated simulation procedure. More specifically, the present embodiment makes it possible to include a description of an additional process related to cooperation with the outside in a part of the hybrid model description. Therefore, since it is possible to easily construct a variety of sophisticated simulation models, the applicable range of the simulation can be expanded.

(第2実施形態)
本発明の第2実施形態は機構制御ソフトウェアもしくは機構制御ソフトウェアのシミュレータとの連携に係わる。図9は本発明の第2実施形態に係る機構シミュレータの概略構成を示すブロック図である。本実施形態の機構シミュレータは、第1実施形態と同様に、ハイブリッドモデル前処理部201と、ハイブリッドモデルシミュレーション実行部102とにより構成されている。同図に示す制御信号106は機構制御ソフトウェアもしくは機構制御ソフトウェアのシミュレータとハイブリッドモデルシミュレーション実行部102の付加処理実行部205との間でポートを介して入出力される。
(2nd Embodiment)
The second embodiment of the present invention relates to cooperation between mechanism control software and a simulator of mechanism control software. FIG. 9 is a block diagram showing a schematic configuration of a mechanism simulator according to the second embodiment of the present invention. The mechanism simulator of the present embodiment includes a hybrid model preprocessing unit 201 and a hybrid model simulation execution unit 102, as in the first embodiment. The control signal 106 shown in the figure is input / output via a port between the mechanism control software or a simulator of the mechanism control software and the additional processing execution unit 205 of the hybrid model simulation execution unit 102.

本実施形態においては、制御信号106の入出力を付加処理とし、その記述をハイブリッドモデル記述2104に含めることが可能である。   In the present embodiment, the input / output of the control signal 106 can be an additional process, and the description can be included in the hybrid model description 2104.

図10は、第2実施形態におけるハイブリッドモデル記述2104の内容の一例を示す図である。outport関数は外部の制御系に対し、そのいずれかのポートIDにデータを書き込むためのAPI関数である。inport関数はポートIDからデータを読み込むAPI関数である。ここでは、外部の制御系は機構制御ソフトウェアもしくは機構制御ソフトウェアのシミュレータに相当する。   FIG. 10 is a diagram illustrating an example of the content of the hybrid model description 2104 according to the second embodiment. The outport function is an API function for writing data to any of the port IDs for an external control system. The inport function is an API function for reading data from a port ID. Here, the external control system corresponds to mechanism control software or a simulator of mechanism control software.

11行目から18行目はC言語で記述されている。setDataToCtrlは引数num,dataをoutport関数にセットする関数である。GetDataFromCtrl関数は引数num番目のIDをinport関数にセットし、取得したデータを戻り値として返す関数である。   Lines 11 to 18 are described in C language. setDataToCtrl is a function that sets the arguments num and data to the outport function. The GetDataFromCtrl function sets the ID of the argument num-th in the import function and returns the acquired data as a return value.

23,26行目ではsetDataToCtrl関数とgetDataFromCtrl関数がそれぞれイベントE1,E2に関連付けられている。イベントE1が発生したときにsetDataToCtrl関数が実行され、イベントE2が発生したとき、getDataFromCtrl関数が実行される。   In lines 23 and 26, the setDataToCtrl function and the getDataFromCtrl function are associated with the events E1 and E2, respectively. When the event E1 occurs, the setDataToCtrl function is executed, and when the event E2 occurs, the getDataFromCtrl function is executed.

24行目では、制御ID番号1に対してデータxが整数型に型変換され、セットされる。27行目では、データxに、制御信号106から取得されたデータを強制的に設定している。   In the 24th line, data x is converted to an integer type for control ID number 1 and set. On the 27th line, data obtained from the control signal 106 is forcibly set as the data x.

以上のようにこのハイブリッドシミュレーションでは、シミュレーション中に外部の制御対象と連携をとるための記述を同一のソース上に簡便に記述することができる。当然ながら、制御対象の状態に応じてシミュレーション結果は異なるものとなる。   As described above, in this hybrid simulation, a description for cooperating with an external control target during the simulation can be easily described on the same source. Naturally, the simulation result differs depending on the state of the control target.

図11は本発明の第2実施形態に係わる機構シミュレータの動作を示すフローチャートである。イベントが発生したら、その種類を特定し、イベントの種類に応じて処理を振り分ける点では第1実施形態と同様である。本実施形態はハイブリッドモデルにおける状態遷移のみならず、外部制御対象とのインターフェースに係わる処理についてもイベントを通じて統一的に制御する点で第1実施形態と異なっており、これにより外部制御系(例えば機構制御ソフトウェア等)との連携シミュレーションに係わる構成が簡潔になるという利点がある。   FIG. 11 is a flowchart showing the operation of the mechanism simulator according to the second embodiment of the present invention. When an event occurs, it is the same as the first embodiment in that the type is specified and the processing is distributed according to the type of the event. This embodiment is different from the first embodiment in that not only the state transition in the hybrid model but also the processing related to the interface with the external control object is controlled in a unified manner through the event. There is an advantage that the configuration relating to the cooperative simulation with control software or the like is simplified.

まず、図11に示すように、ハイブリッドモデル記述2104が制御情報解析部110に入力され、ハイブリッドモデルの構文解析が行われる(ステップS1)。制御情報解析部110はモデル方程式登録プログラム202、イベント制御プログラム203、及びシミュレーション実行時付加処理プログラム204をそれぞれ生成する。モデル方程式登録プログラム202に基づく方程式構文解析部112により、連続系方程式の記述データはシミュレーション実行可能なデータ構造に変換されると共に、方程式データ記憶部114に登録される(ステップS2)。   First, as shown in FIG. 11, the hybrid model description 2104 is input to the control information analysis unit 110, and syntax analysis of the hybrid model is performed (step S1). The control information analysis unit 110 generates a model equation registration program 202, an event control program 203, and a simulation execution additional processing program 204. The equation syntax analyzer 112 based on the model equation registration program 202 converts the continuous system equation description data into a data structure that can execute a simulation, and registers the data in the equation data storage 114 (step S2).

以上でシミュレーション実行のための前処理を終え、ここからシミュレーション実行の段階に移る。   Thus, the pre-processing for executing the simulation is completed, and the process proceeds to the stage of executing the simulation.

ステップS4において、イベントが発生したかどうかを検知する。イベントが発生したならば、制御はステップS5に進む。イベントが発生していない場合はステップS6に進む。   In step S4, it is detected whether an event has occurred. If an event has occurred, control proceeds to step S5. If no event has occurred, the process proceeds to step S6.

ステップS5において、発生したイベントの種類を判定する。イベントの種類が連続系方程式に関係するイベントであるならば、ステップS9において、状態遷移に伴う連続系方程式の切り替えが必要であるか否かを判定する。方程式の切り替えが必要であるならば、ステップS10において、有効無効フラグを操作することにより、アクティブな連続方程式の切り替えを行う。方程式の切り替えは不要である場合、制御はステップS6に進む。   In step S5, the type of the event that has occurred is determined. If the event type is an event related to a continuous system equation, in step S9, it is determined whether or not it is necessary to switch the continuous system equation in accordance with the state transition. If it is necessary to switch the equation, in step S10, the active continuous equation is switched by operating the valid / invalid flag. If it is not necessary to switch the equation, control proceeds to step S6.

発生したイベントの種類がデータ送信に関係するイベントであるならば、ステップS11において外部制御対象にデータを送信する。この送信データは、対象とする機構に装着されたセンサーのステータス情報等が想定される。また、発生したイベントの種類がデータ受信に関係するイベントであるならば、ステップS12において外部制御対象からデータを受信する。   If the type of event that has occurred is an event related to data transmission, data is transmitted to the external control target in step S11. This transmission data is assumed to be status information of a sensor attached to the target mechanism. If the type of event that has occurred is an event related to data reception, data is received from the external control target in step S12.

ステップS6において、連続系シミュレーション部103は数値積分を実行する。   In step S6, the continuous system simulation unit 103 performs numerical integration.

次に、ステップS7において終了条件の判定をする。ここでは、時間が所定のシミュレーション終了時間に到達したかどうかを判定する。シミュレーション終了時間に到達したらシミュレーション実行を終了する。それまではステップS8にて時間を1ステップ進めてステップS4に戻り、同様の処理手順を繰り返す。   Next, an end condition is determined in step S7. Here, it is determined whether or not the time has reached a predetermined simulation end time. When the simulation end time is reached, the simulation execution ends. Until then, the time is advanced by one step in step S8, the process returns to step S4, and the same processing procedure is repeated.

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

本発明の第1実施形態に係る機構シミュレータの概略構成を示すブロック図。FIG. 1 is a block diagram showing a schematic configuration of a mechanism simulator according to a first embodiment of the present invention. ハイブリッドモデル記述を説明するための具体例に係るシリンダ装置のある状態を示す図。The figure which shows a certain state of the cylinder apparatus which concerns on the specific example for demonstrating a hybrid model description. ハイブリッドモデル記述を説明するための具体例に係るシリンダ装置の別の状態を示す図。The figure which shows another state of the cylinder device which concerns on the specific example for demonstrating a hybrid model description. ハイブリッドモデル記述を説明するための具体例に係るシリンダ装置の状態遷移を示す図。The figure which shows the state transition of the cylinder apparatus which concerns on the specific example for demonstrating a hybrid model description. ハイブリッドモデル記述の内容を示す図。The figure which shows the content of the hybrid model description. 1つの連続系方程式を構文解析した結果得られる内部データ表現の説明図。FIG. 4 is an explanatory diagram of an internal data expression obtained as a result of parsing one continuous system equation. 本発明の第1実施形態に係る機構シミュレーションの処理手順を示すフローチャート。4 is a flowchart showing a processing procedure of a mechanism simulation according to the first embodiment of the present invention. 機構シミュレーションの時系列的な流れの説明図。Explanatory drawing of the time-series flow of mechanism simulation. 本発明の第2実施形態に係る機構シミュレータの概略構成を示すブロック図。FIG. 7 is a block diagram showing a schematic configuration of a mechanism simulator according to a second embodiment of the present invention. 本発明の第2実施形態に係るハイブリッドモデル記述の内容を示す図。FIG. 9 is a view showing contents of a hybrid model description according to the second embodiment of the present invention. 機構シミュレーションの処理手順を示すフローチャート。9 is a flowchart illustrating a processing procedure of a mechanism simulation.

符号の説明Explanation of reference numerals

104…ハイブリッドモデル記述、201…ハイブリッドモデル前処理部、110…制御情報解析部、102…ハイブリッドモデルシミュレーション実行部、103…連続系シミュレーション部、111…イベント処理部、112…方程式構文解析部、115…連続系方程式切り替え部、205…付加処理実行部、105…変数値時間履歴記憶部 104: hybrid model description, 201: hybrid model preprocessing unit, 110: control information analysis unit, 102: hybrid model simulation execution unit, 103: continuous system simulation unit, 111: event processing unit, 112: equation syntax analysis unit, 115 ... Continuous system equation switching unit, 205 ... Additional processing execution unit, 105 ... Variable value time history storage unit

Claims (20)

ハイブリッドモデルを利用した記述データに基づいて、対象とする機構の挙動を時間軸に沿ってシミュレーションするシミュレーション方法であって、
前記記述データに含まれる連続系方程式の記述、状態遷移に伴う該連続系方程式の切り替えに関する記述、及び前記連続系方程式で表現される処理以外の処理に関する記述を抽出するため、前記記述データを解析する解析ステップと、
前記解析ステップにおいて抽出された前記連続系方程式の記述に基づいて、第1のプログラムを生成する第1のプログラム生成ステップと、
前記解析ステップにおいて抽出された前記状態遷移に伴う連続系方程式の切り替えに関する記述に基づいて、第2のプログラムを生成する第2のプログラム生成ステップと、
前記解析ステップにおいて抽出された前記連続系方程式で表現される処理以外の処理に関する記述に基づいて、第3のプログラムを生成する第3のプログラム生成ステップと、
前記第1のプログラムを実行することにより、前記連続系方程式をシミュレーション実行可能なデータ構造に変換する変換ステップと、
前記第2のプログラムを実行することにより、イベントの発生に応じて前記連続系方程式の有効・無効を切り替える切り替えステップと、
前記切り替えステップにおいて有効とされた前記連続系方程式に対応する前記データ構造を用いて、時間軸に沿った数値積分により該連続系方程式を解いて、前記機構の挙動を表すデータを出力するシミュレーションを実行するシミュレーション実行ステップと、
前記第3のプログラムを実行することにより、前記連続系方程式で表現される処理以外の処理を実行する処理実行ステップと
を具備することを特徴とするシミュレーション方法。
A simulation method for simulating the behavior of a target mechanism along a time axis based on description data using a hybrid model,
The description data is analyzed to extract a description of a continuous system equation included in the description data, a description of switching of the continuous system equation according to a state transition, and a description of a process other than the process represented by the continuous system equation. Analysis steps to perform,
A first program generation step of generating a first program based on the description of the continuous system equation extracted in the analysis step;
A second program generation step of generating a second program based on a description regarding switching of continuous system equations accompanying the state transition extracted in the analysis step;
A third program generation step of generating a third program based on a description related to processing other than the processing represented by the continuous system equation extracted in the analysis step;
A conversion step of converting the continuous system equation into a simulation-executable data structure by executing the first program;
By executing the second program, a switching step of switching between valid and invalid of the continuous system equation according to occurrence of an event;
A simulation that solves the continuous system equation by numerical integration along a time axis using the data structure corresponding to the continuous system equation validated in the switching step, and outputs data representing behavior of the mechanism. A simulation execution step to be executed;
Performing a process other than the process represented by the continuous system equation by executing the third program.
イベントの発生を検知するステップと、
前記イベントの発生を検知したならば、該イベントは前記第3のプログラムに関連するイベントであるか否かを判定するステップと、
前記イベントは前記第3のプログラムに関連するイベントであると判定されたならば、実行のために該第3のプログラムを呼び出すステップと、
を具備する請求項1に記載のシミュレーション方法。
Detecting the occurrence of an event;
If the occurrence of the event is detected, determining whether the event is an event related to the third program;
Calling the third program for execution if the event is determined to be an event associated with the third program;
The simulation method according to claim 1, comprising:
前記第3のプログラムは、前記機構を制御する機構制御ソフトウェアを含む外部との間で入出力ポートを介して制御信号を入出力するための処理を含むことを特徴とする請求項2に記載のシミュレーション方法。 3. The method according to claim 2, wherein the third program includes a process for inputting and outputting a control signal to and from an external device including mechanism control software for controlling the mechanism via an input / output port. Simulation method. 前記イベントは、前記機構の内部変数の評価結果を含むことを特徴とする請求項1に記載のシミュレーション方法。 The simulation method according to claim 1, wherein the event includes an evaluation result of an internal variable of the mechanism. ハイブリッドモデルを利用した記述データに基づいて、対象とする機構の挙動を時間軸に沿ってシミュレーションする手順をコンピュータに実行させるシミュレーションプログラムであって、
前記記述データに含まれる連続系方程式の記述、状態遷移に伴う該連続系方程式の切り替えに関する記述、及び前記連続系方程式で表現される処理以外の処理に関する記述を抽出するため、前記記述データを解析する解析手順と、
前記解析ステップにおいて抽出された前記連続系方程式の記述に基づいて、第1のプログラムを生成する第1のプログラム生成手順と、
前記解析ステップにおいて抽出された前記状態遷移に伴う連続系方程式の切り替えに関する記述に基づいて、第2のプログラムを生成する第2のプログラム生成手順と、
前記解析ステップにおいて抽出された前記連続系方程式で表現される処理以外の処理に関する記述に基づいて、第3のプログラムを生成する第3のプログラム生成手順と、
前記第1のプログラムを実行することにより、前記連続系方程式をシミュレーション実行可能なデータ構造に変換する変換手順と、
前記第2のプログラムを実行することにより、イベントの発生に応じて前記連続系方程式の有効・無効を切り替える切り替え手順と、
前記切り替えステップにおいて有効とされた前記連続系方程式に対応する前記データ構造を用いて、時間軸に沿った数値積分により該連続系方程式を解いて、前記機構の挙動を表すデータを出力するシミュレーションを実行するシミュレーション実行手順と、
前記第3のプログラムを実行することにより、前記連続系方程式で表現される処理以外の処理を実行する処理実行手順と
をコンピュータに実行させることを特徴とするシミュレーションプログラム。
A simulation program that causes a computer to execute a procedure for simulating the behavior of a target mechanism along a time axis based on description data using a hybrid model,
The description data is analyzed to extract a description of a continuous system equation included in the description data, a description of switching of the continuous system equation according to a state transition, and a description of a process other than the process represented by the continuous system equation. Analysis procedure
A first program generation procedure for generating a first program based on the description of the continuous system equation extracted in the analysis step;
A second program generation procedure for generating a second program based on a description about switching of a continuous system equation accompanying the state transition extracted in the analysis step;
A third program generation procedure for generating a third program based on a description of a process other than the process represented by the continuous system equation extracted in the analysis step;
A conversion procedure for converting the continuous system equation into a simulation-executable data structure by executing the first program;
By executing the second program, a switching procedure for switching between enabling and disabling the continuous system equation according to the occurrence of an event;
A simulation that solves the continuous system equation by numerical integration along a time axis using the data structure corresponding to the continuous system equation validated in the switching step, and outputs data representing behavior of the mechanism. A simulation execution procedure to be executed;
A simulation program for causing a computer to execute a process execution procedure for executing a process other than the process represented by the continuous system equation by executing the third program.
イベントの発生を検知するステップと、
前記イベントの発生を検知したならば、該イベントは前記第3のプログラムに関連するイベントであるか否かを判定するステップと、
前記イベントは前記第3のプログラムに関連するイベントであると判定されたならば、実行のために該第3のプログラムを呼び出すステップと、
を具備することを特徴とする請求項5に記載のシミュレーションプログラム。
Detecting the occurrence of an event;
If the occurrence of the event is detected, determining whether the event is an event related to the third program;
Calling the third program for execution if the event is determined to be an event associated with the third program;
The simulation program according to claim 5, further comprising:
前記第3のプログラムは、前記機構を制御する機構制御ソフトウェアを含む外部との間で入出力ポートを介して制御信号を入出力するための手順を含むことを特徴とする請求項6に記載のシミュレーションプログラム。 7. The method according to claim 6, wherein the third program includes a procedure for inputting / outputting a control signal to / from an external device including mechanism control software for controlling the mechanism via an input / output port. Simulation program. 前記イベントは、前記機構の内部変数の評価結果を含むことを特徴とする請求項5に記載のシミュレーションプログラム。 The simulation program according to claim 5, wherein the event includes an evaluation result of an internal variable of the mechanism. 時間軸に沿った機構の挙動のシミュレーションに用いられるハイブリッドモデルを解析するハイブリッドモデル解析方法において、
前記ハイブリッドモデルの記述から連続系方程式に関する記述、状態遷移に関する記述、および付加処理に関する記述をそれぞれ抽出する解析ステップと、
前記シミュレーションの実行においてそれぞれ呼び出され、前記連続系方程式に関する記述に基づく第1のプログラム、前記状態遷移に関する記述に基づく第2のプログラム、および前記付加処理に関する記述に基づく第3のプログラムを生成するプログラム生成ステップと、
を具備することを特徴とするハイブリッドモデル解析方法。
In a hybrid model analysis method for analyzing a hybrid model used for simulating the behavior of a mechanism along a time axis,
An analysis step of extracting a description of a continuous system equation, a description of a state transition, and a description of an additional process from the description of the hybrid model,
A program that is called in the execution of the simulation and generates a first program based on the description regarding the continuous system equation, a second program based on the description regarding the state transition, and a third program based on the description regarding the additional processing. Generating step;
A hybrid model analysis method comprising:
前記付加処理に関する記述は付加処理の内容を表す第1の記述と、イベントの発生に伴って該付加処理の実行を制御する第2の記述とから構成されることを特徴とする請求項9に記載のハイブリッドモデル解析方法。 10. The method according to claim 9, wherein the description relating to the additional processing includes a first description representing the content of the additional processing and a second description controlling execution of the additional processing in response to occurrence of an event. The described hybrid model analysis method. 前記プログラム生成ステップは、前記第1の記述から前記第3のプログラムを生成するステップと、前記第2の記述に基づくプログラムを前記第2のプログラムに追加するステップとを具備することを特徴とする請求項10に記載のハイブリッドモデル解析方法。 The program generating step includes a step of generating the third program from the first description, and a step of adding a program based on the second description to the second program. The hybrid model analysis method according to claim 10. 時間軸に沿った機構の挙動のシミュレーションに用いられるハイブリッドモデルを解析するプログラムにおいて、
前記ハイブリッドモデルの記述から連続系方程式に関する記述、状態遷移に関する記述、および付加処理に関する記述をそれぞれ抽出する解析手順と、
前記シミュレーションの実行においてそれぞれ呼び出され、前記連続系方程式に関する記述に基づく第1のプログラム、前記状態遷移に関する記述に基づく第2のプログラム、および前記付加処理に関する記述に基づく第3のプログラムを生成するプログラム生成手順と、
をコンピュータに実行させるためのハイブリッドモデル解析プログラム。
In a program that analyzes a hybrid model used to simulate the behavior of a mechanism along the time axis,
An analysis procedure for extracting a description about a continuous system equation, a description about a state transition, and a description about an additional process from the description of the hybrid model,
A program that is called in the execution of the simulation and generates a first program based on the description regarding the continuous system equation, a second program based on the description regarding the state transition, and a third program based on the description regarding the additional processing. Generation procedure,
A hybrid model analysis program for causing a computer to execute.
前記付加処理に関する記述は付加処理の内容を表す第1の記述と、イベントの発生に伴って該付加処理の実行を制御する第2の記述とから構成されることを特徴とする請求項12に記載のハイブリッドモデル解析プログラム。 13. The method according to claim 12, wherein the description relating to the additional processing includes a first description representing the content of the additional processing, and a second description controlling execution of the additional processing in response to occurrence of an event. The described hybrid model analysis program. 前記プログラム生成手順は、前記第1の記述から前記第3のプログラムを生成する手順と、前記第2の記述に基づくプログラムを前記第2のプログラムに追加する手順とを具備することを特徴とする請求項13に記載のハイブリッドモデル解析プログラム。 The program generation procedure includes a procedure of generating the third program from the first description, and a procedure of adding a program based on the second description to the second program. A hybrid model analysis program according to claim 13. 連続系方程式により表された連続系モデルと、イベントの発生に伴う状態遷移を表す状態遷移モデルと、付加処理とからなるハイブリッドモデルを用い、時間軸に沿った機構の挙動のシミュレーションを行うシミュレーション方法において、
前記連続系モデルを記憶手段に記憶するステップと、
前記状態遷移モデルに記述されたいずれかのイベントが発生したか否かを判定するイベント処理ステップと、
前記イベントが前記付加処理に関連するか否かを判定する判定ステップと、
前記イベントが前記付加処理に関連するならば、該イベントに関連付けられた付加処理を実行する実行ステップと、
前記記憶手段に記憶された連続系モデルにおいて有効な連続系方程式に基づき連続系シミュレーションを実行するシミュレーションステップと、
を具備することを特徴とするシミュレーション方法。
A simulation method that simulates the behavior of a mechanism along a time axis using a hybrid model consisting of a continuous system model represented by a continuous system equation, a state transition model representing a state transition accompanying an event occurrence, and an additional process. At
Storing the continuous system model in storage means;
An event processing step of determining whether any of the events described in the state transition model has occurred;
A determining step of determining whether the event is related to the additional processing;
Performing an additional process associated with the event if the event is associated with the additional process;
A simulation step of performing a continuous system simulation based on a continuous system equation effective in the continuous system model stored in the storage means;
A simulation method comprising:
前記付加処理は、前記機構を制御する機構制御ソフトウェアを含む外部との間で入出力ポートを介して制御信号を入出力するための処理を含むことを特徴とする請求項15に記載のシミュレーション方法。 16. The simulation method according to claim 15, wherein the additional processing includes processing for inputting / outputting a control signal to / from an external device including mechanism control software for controlling the mechanism via an input / output port. . 前記状態遷移モデルに基づく状態遷移に伴って、前記有効な連続系方程式を切り替えるステップをさらに具備する請求項15に記載のシミュレーション方法。 The simulation method according to claim 15, further comprising a step of switching the effective continuous system equation according to a state transition based on the state transition model. 連続系方程式により表された連続系モデルと、イベントの発生に伴う状態遷移を表す状態遷移モデルと、付加処理とからなるハイブリッドモデルを有し、時間軸に沿った機構の挙動のシミュレーションを該ハイブリッドモデルに基づいて行うシミュレーションプログラムであって、
前記連続系モデルを記憶する記憶手順と、
前記状態遷移モデルに記述されたいずれかのイベントが発生したか否かを判定するイベント処理手順と、
前記イベントが前記付加処理に関連するか否かを判定する判定手順と、
前記イベントが前記付加処理に関連するならば、該イベントに関連付けられた付加処理を実行する実行手順と、
前記記憶手順により記憶された連続系方程モデルにおいて有効な連続系方程式に基づき連続系シミュレーションを実行するシミュレーション手順と、
をコンピュータに実行させるためのシミュレーションプログラム。
It has a hybrid model consisting of a continuous system model represented by a continuous system equation, a state transition model representing a state transition associated with the occurrence of an event, and additional processing. A simulation program based on the model,
A storage procedure for storing the continuous system model;
An event processing procedure for determining whether any of the events described in the state transition model has occurred;
A determination procedure for determining whether the event is related to the additional processing,
If the event is related to the additional processing, an execution procedure for performing the additional processing associated with the event;
A simulation procedure for executing a continuous system simulation based on a continuous system equation effective in the continuous system model stored by the storage procedure;
Simulation program for causing a computer to execute.
前記付加処理は、前記機構を制御する機構制御ソフトウェアを含む外部との間で入出力ポートを介して制御信号を入出力するための処理を含むことを特徴とする請求項18に記載のシミュレーションプログラム。 19. The simulation program according to claim 18, wherein the additional processing includes processing for inputting / outputting a control signal to / from an external device including mechanism control software for controlling the mechanism via an input / output port. . 前記状態遷移モデルに基づく状態遷移に伴って、前記有効な連続系方程式を切り替える切り替え手順をさらに具備することを特徴とする請求項18に記載のシミュレーションプログラム。 19. The simulation program according to claim 18, further comprising a switching procedure for switching the effective continuous system equation in accordance with a state transition based on the state transition model.
JP2003416847A 2002-12-26 2003-12-15 Simulation device Expired - Lifetime JP4564255B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003416847A JP4564255B2 (en) 2002-12-26 2003-12-15 Simulation device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2002376210 2002-12-26
JP2003416847A JP4564255B2 (en) 2002-12-26 2003-12-15 Simulation device

Publications (2)

Publication Number Publication Date
JP2004220577A true JP2004220577A (en) 2004-08-05
JP4564255B2 JP4564255B2 (en) 2010-10-20

Family

ID=32911114

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003416847A Expired - Lifetime JP4564255B2 (en) 2002-12-26 2003-12-15 Simulation device

Country Status (1)

Country Link
JP (1) JP4564255B2 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008243042A (en) * 2007-03-28 2008-10-09 Toshiba Corp Simulation device, method, and program for hybrid model
JP2011059789A (en) * 2009-09-07 2011-03-24 Toshiba Corp Hybrid model simulation device and method
WO2011036768A1 (en) * 2009-09-25 2011-03-31 株式会社 東芝 Simulation device
CN102004632A (en) * 2009-09-01 2011-04-06 阿里巴巴集团控股有限公司 Method and device for setting time information
CN102667780A (en) * 2010-10-06 2012-09-12 艺术系统软件有限责任公司 Method for calculating the state variables of a hybrid differential-algebraic process model in real time
JP2013503408A (en) * 2010-10-06 2013-01-31 アート システムズ ソフトウェア ゲゼルシャフト ミット ベシュレンクテル ハフツング Method and process computer for calculating state quantities of hybrid differential algebra process model
JP2021043976A (en) * 2019-09-12 2021-03-18 バーチャル ヴィークル リサーチ ゲーエムベーハー Method of generating operation procedure for simulation of mechatronic system

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008243042A (en) * 2007-03-28 2008-10-09 Toshiba Corp Simulation device, method, and program for hybrid model
CN102004632A (en) * 2009-09-01 2011-04-06 阿里巴巴集团控股有限公司 Method and device for setting time information
JP2011059789A (en) * 2009-09-07 2011-03-24 Toshiba Corp Hybrid model simulation device and method
WO2011036768A1 (en) * 2009-09-25 2011-03-31 株式会社 東芝 Simulation device
CN102667780A (en) * 2010-10-06 2012-09-12 艺术系统软件有限责任公司 Method for calculating the state variables of a hybrid differential-algebraic process model in real time
JP2013503408A (en) * 2010-10-06 2013-01-31 アート システムズ ソフトウェア ゲゼルシャフト ミット ベシュレンクテル ハフツング Method and process computer for calculating state quantities of hybrid differential algebra process model
JP2013509661A (en) * 2010-10-06 2013-03-14 アート システムズ ソフトウェア ゲゼルシャフト ミット ベシュレンクテル ハフツング A method for computing the state variables of a mixed differential algebraic process model in real time
JP2021043976A (en) * 2019-09-12 2021-03-18 バーチャル ヴィークル リサーチ ゲーエムベーハー Method of generating operation procedure for simulation of mechatronic system
JP7111425B2 (en) 2019-09-12 2022-08-02 バーチャル ヴィークル リサーチ ゲーエムベーハー How to generate operating instructions for simulation of mechatronic systems
US11630931B2 (en) 2019-09-12 2023-04-18 Virtual Vehicle Research Gmbh Method of generating an operation procedure for a simulation of a mechatronic system

Also Published As

Publication number Publication date
JP4564255B2 (en) 2010-10-20

Similar Documents

Publication Publication Date Title
JP3940665B2 (en) Hybrid simulation apparatus and program
Ambert et al. BZ-TT: A tool-set for test generation from Z and B using constraint logic programming
US7523023B1 (en) Automatic generation of component interfaces for computational hardware implementations generated from a block diagram model
EP1855194B1 (en) Synchronization of a graphical program and a robot program
US10719645B1 (en) Model structure analysis with integration of transformed slice
US8046202B1 (en) Generation of intermediate representations based on user specified elements in a graphical model that enable simulation, propagation and code generation
Schumacher et al. Formal representation of GRAFCET to automatically generate control code
EP3667582A1 (en) Systems and methods for evaluating assessments
Feldman et al. Simulating rhapsody SysML blocks in hybrid models with FMI
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
CN100498817C (en) Simulation method
Anureev et al. Two-step deductive verification of control software using Reflex
US10884714B2 (en) Method for modifying models for generating source code
US11593076B2 (en) Method for merging architecture data
JP4564255B2 (en) Simulation device
US11126408B2 (en) Incremental code generation method
US9841954B1 (en) Method and system for automatic code generation
Engblom Worst-case execution time analysis for optimized code
Hansen et al. Co-simulation at different levels of expertise with Maestro2
Lin Synthesis of control software in a layered architecture from hybrid automata
Lu et al. Simulation and visualization tool design for robot software
Le Parc et al. Grafcet revisited with a synchronous data-flow language
Anureev et al. Dedicative verification of Reflex programs
Ressouche et al. Modular compilation of a synchronous language

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050209

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070821

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071022

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20071113

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080115

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20080226

A912 Re-examination (zenchi) completed and case transferred to appeal board

Free format text: JAPANESE INTERMEDIATE CODE: A912

Effective date: 20080328

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: 20100730

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

Free format text: PAYMENT UNTIL: 20130806

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 4564255

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: 20130806

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

EXPY Cancellation because of completion of term