Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Defining Inputs/Outputs for an exported FMU

Defining Inputs/Outputs for an exported FMU

Hi,

I'm new to OpenModelica and am currently trying to Co-Sim two models between OpenModelica and MSC ADAMS, with Adams as Master.

First of all, is that possible?

In OpenModelica I modelled a basic DC-Motor and in Adams a piston type air compressor.

I now want my DC-Motor model to have the torque as output and the current angular velocity (of the motor-shaft, which gets calculated in Adams) as input.

My question is now: where and how can I define my inputs and outputs in OpenModelica?

Thanks in advance!

Re: Defining Inputs/Outputs for an exported FMU

Hi,

notarobot wrote:



My question is now: where and how can I define my inputs and outputs in OpenModelica?

You coulde declare two additional variable in your OpenModelica model as

Code:


input Real u
output Real y

and assign them in algorithm to torque and angular velocity respectively

Code:


algorithm
torque := u;
angular_velocity := y;

its not an elegant solution but i think its work.

As if OMEdit and ADAMS co-sim compatible, i dont have any experience in that

cheers

Re: Defining Inputs/Outputs for an exported FMU

The solution above is fine but you can also drag and drop in your top model Modelica.Blocks.Interfaces.RealInput for input and Modelica.Blocks.Interfaces.RealOutput for output, then connect them to what you want in your model.

Re: Defining Inputs/Outputs for an exported FMU

I want to do a similar thing like notarobot. I want to do a co-simulation between OpenModelica and Adams.

I found the Realinput and Realoutput in OMEdit, Bibliothek Navigator ->Blocks->Interfaces

how can I connect them with results from the models?
e.g. the Realoutput shall show the position of a part

Is there an example or can somebody share an example of  a model with Realinput and Realoutput  which are connected to the position of a part?
Or is there a turorial how to prepare a model for a FMU?

I'm new to OpenModelica. I come from Adams side so every help would be great to get a quick start with this great OpenModelica
Thanks a lot

There are 0 guests and 0 other users also viewing this topic
You are here: