icyphy / ptII

Ptolemy II is an open-source software framework supporting experimentation with actor-oriented design.
https://ptolemy.eecs.berkeley.edu/ptolemyII
Other
98 stars 43 forks source link

Support Derivatives or linearizing models #13

Open cxbrooks opened 18 years ago

cxbrooks commented 18 years ago

Note: the issue was created automatically with bugzilla2github tool

Original bug ID: BZ#14 From: @cxbrooks Reported version: 6.0.1

cxbrooks commented 18 years ago

The email thread below has some suggestions. Edward writes:

Interesting...

Indeed, linearizing models would be a useful capability to develop... Thomas Feng (cc'd here) has developed a generic backtracking capability that could be applied to this. I hadn't thought of this as an application...

Thanks for the suggestions...

Edward

At 10:41 PM 5/9/2006, Horst Salzwedel wrote:

Ed,

FYI: CT domain software systems like Model-C (precurser of Simulink), Simulink and SystemBuild include differentiation capabilities. This is done by setting markers in the block diagram and determine derivatives by perturbing the system (symmetric or unsymetric). The main application is to determine linear models from non-linear ones for stability analysis --- IMPORTANT. This might also be a desirable feature for Ptolemy.

We also had a derivative block in ModelC. I have not checked, however I assume that Simulink and SystemBuild also include a derivative block. As you said, derivatives of noisy signals result in even noisier signals.

Around 1985 some collegues at Systems Control (Ron de Hoff ???) had developed a method of determining derivatives by integration (to determine linear models of jet engines), AFWAL or NASA report. This filtered out the noise. However, I do not remember how they did it and what the trade offs were.

I normally changed my model structures to eliminate derivatives, i.e., choosing appropriate states. An example of this approach is the Luenberger/Bryson Observer, that achieves this whithout changing the order of the differential equation.

Horst

Edward A. Lee wrote:

At 10:19 AM 5/9/2006, Elizabeth Latronico (RTC) wrote:

Hello Ptolemy experts,

How do I calculate a derivative in Ptolemy? I can't seem to find an actor for it (just the Integrator actor). I checked the archives but didn't see an answer for this - I apologize if I missed it.

Thanks, Beth

Typically, software that implements that ODEs does not directly provide a differentiator. Instead, you use an integrator in a feedback loop. e.g., if you have some formula: dx/dt = f(x) then you can implement this as follows: ----> Integrator ----> f --- | |

The input to the Integrator will be dx/dt. Its output will be x. The reason it is done this way is for numerical stability. Calculating derivatives on discretized approximations of continuous signals is an extremely tricky proposition... The downside, of course, is that you have to have a formula for the derivative. If you just have some waveform, then things are very iffy, because what you really have is samples of a waveform. If these are uniformly spaced samples, and you know that the Nyquist criterion is satisfied, then you can approximate the derivative with a finite difference, but this would be better done using a discrete modeling environment like SDF or DE. Edward