patchGNU Octave - Patches: patch #9679, [octave forge] (control)...


patch #9679: [octave forge] (control) additional frequency points to make bode and nyquist plots smoother

Submitted by:  None
Submitted on:  Sat 18 Aug 2018 10:13:59 AM UTC  
Category:  Forge : other Priority:  3 - Low
Status:  None Privacy:  Public
Assigned to:  None Originator Email:  -email is unavailable-
Open/Closed:  Open

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Tue 04 Sep 2018 03:33:08 PM UTC, comment #6: 

I have uploaded an update which is more conformant to the octave contribution guidelines. mainly the space between function name and the '(' and line length.
One more test is also added.

Mon 20 Aug 2018 09:11:12 AM UTC, comment #5: 

The code is a significantly reworked version of what I had been using for myself. I have written the code. The original version I made for myself barely had any error checking since I deal with a very specific set of LTI systems. It didn't handle cell arrays of LTI systems either.
I tried to make it adhere to for submitting the patch.
Suggestions for correction / improvement are welcome.
Where ever I have modified the original two functions in the _frequency_vector_ file, I have tried to copy the code in the same file and change the variable names (eg. calls to cellfun, arrayfun).

Sun 19 Aug 2018 11:30:07 AM UTC, comment #4: 

I like what you have done. But it does not follow octave's codding standard.
Did you write this code, or copy it from somewhere?

Doug Stewart <dastew>
Sun 19 Aug 2018 07:29:54 AM UTC, comment #3: 

>Thanks for the patch.
>Where did you get these changes from?

A note is attached.

(file #44811)

Sat 18 Aug 2018 12:19:56 PM UTC, comment #2: 

Thanks for the patch.
Where did you get these changes from?

Doug Stewart <dastew>
Sat 18 Aug 2018 10:17:41 AM UTC, comment #1: 

The patch also includes small changes to the package Makefile necessary to run Octave in gui mode for testing the modification to the plotting functions.

Sat 18 Aug 2018 10:13:59 AM UTC, original submission:  

When bode and nyquist commands are called without giving explicit frequency values, control package evaluates the frequency response at 500 frequency points which are log spaced with in the (min, max) range. The package adds the natural frequency of the poles/zeroes to the above log spaced vector to ensure the peaks and notches are not missed.
For systems with poles or zeroes with very low damping ratio (close to imaginary axis), frequency points at closer intervals are necessary near the frequency of poles/zeros for a smoother plot. Matlab puts closer points near such frequencies where sharp magnitude or phase change occur.
The submitted patch uses the relation between magnitude or phase with respect to frequency for second order systems to calculate the frequency points from 'equally' spaced magnitude and phase vectors by inverting the relation.
The improvement is visible in the nyquist plots for systems with poles and zeros very very close to imaginary axis. The improvement for bode plots are not so dramatic.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #44935:  bode_freq_pts_v2.patch added by None (11KiB - text/x-patch - more conformant with octave guidelines.)
file #44811:  frequency_points.pdf added by None (199KiB - application/pdf)
file #44805:  bode_freq_pts.patch added by None (11KiB - text/x-patch - modificationtest.m can be used demonstrate the difference in plotting)
file #44806:  modificationtest.m added by None (2KiB - text/x-objcsrc - modificationtest.m can be used demonstrate the difference in plotting)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by dastew (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-07 mtmiller Summarycontrol package : additional frequency points to make bode and nyquist plots smoother => [octave forge] (control) additional frequency points to make bode and nyquist plots smoother
    2018-09-04 None Attached File- => Added bode_freq_pts_v2.patch, #44935
    2018-08-19 None Attached File- => Added frequency_points.pdf, #44811
    2018-08-18 None Attached File- => Added bode_freq_pts.patch, #44805
        Attached File- => Added modificationtest.m, #44806

    Back to the top

    Powered by Savane 3.5