turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Navigation
- Simcenter
- Forums
- Blogs
- Knowledge Bases

- Siemens PLM Community
- Simcenter
- 1D Simulation Forum
- AMESet : Obtain time derivative

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-08-2017 02:00 PM

Hi all,

I am developing a new library of components using AMESet. In one of the components, I read from a 2D table U=f(x,y). In the code, I need time derivative of the quantity U. Is there a nice way to obtain this?

5 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-09-2017 03:08 AM

Hi @Rituraj346

If this derivative is computed from the tables data, you might want to use the C function **getmspdx** which gives you the derivative of the tables data against x.

There is also **getmspdy**.

Look in the help for the names of these functions for full descriptions.

Kind regards

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-09-2017 10:02 AM

Hi Domi,

I am aware of these functions, but they give you the partial derivative with respect to x (and y). What I need is time derivative (dU/dt).

One of the ways could be to use chain rule dU/dt= dU/dx.dx/dt + dU/dy.dy/dt. Here dU/dx and dU/dy can be obtained using the functions you mentioned, but I still need to get dx/dt and dy/dt. So, the question still stands : How to obtain the time derivative.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-09-2017 01:31 PM - edited 03-09-2017 01:32 PM

Hi,

Maybe you could can do this on a supercomponent sketch: your 2D table output plugged to a derivative block DIF1 and this way you make the derivative an input to your special submodel too...

Or you reproduce what is done by DIF1 in your submodel, you define a dummy state variable in your component and its derivative is computed with a first order lag (tau is the time constant in seconds.

*ddummy = (*table_output - *dummy)/tau;

*ddummy is then your derivative.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-09-2017 02:48 PM - edited 03-09-2017 02:54 PM

Hi @Rituraj346,

In this case it would be useful to exactly know what you would like to do.

Computing a derivative comes always with some imprecision.

For example when using a dummy state variable as in the DIF1 submodel you will introduce a time constant.

The smaller this time constant is, the more precise you are, but then you introduce a high dynamics which may harm your computation time.

Therefore this is better to think about which variables are involved (or may be involved) in your problem.

As an example it might happen that you have a variable which is a displacement and in your computation you need the velocity. A simple solution is then indeed to try to compute a derivative, but very often in LMS Amesim you have access to the velocity (or can compute it rather directly) which you could re-use directly.

Generally speaking this is better to think in term of velocity (or flow rate, current, or other flux variables in Bond-Graph sense) than in term of displacement . Then you can directly use these variables instead of having to make differentiations.

It is even better to compute an integral than to compute a derivative.

Kind regards

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-21-2017 10:31 AM

Hi Rituraj346,

If x and y are inputs to the submodel, then you are trying to differentiate an input. As other users indicated,

differentiating these quantities with a first order lag will introduce an undesired dynamics in the model.

Can you indicate what physical quantities x and y represent ? May be a submodel connected to your submodel

can already provide their time derivatives (e.g. provide some velocities if x and y are positions).

Follow Siemens PLM Software

© 2017 Siemens Product Lifecycle Management Software Inc