Google Search
Login & Blog Feeds
Blogroll
Recent Comments
- Engineering, Control Systems and Statistics | Blog at ControlTheoryPro.com on Observations on Control System Modeling
- spradlig on MATLAB Pricing (Final Part in the Mathworks is behaving like Microsoft series)
- spradlig on MATLAB Pricing (Final Part in the Mathworks is behaving like Microsoft series)
- PointOnePA on MATLAB Pricing (Final Part in the Mathworks is behaving like Microsoft series)
- spradlig on Observations on Control System Modeling
Archives
- October 2009
- April 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
Categories
16th April 2009
When modeling real-world systems for control it is often necessary to deal with a realistic approximation of the noise and disturbances the system is likely to experience. For satellites with pointing systems this often means that a disturbance PSD is created or measured. This disturbance is modeled as a random process whose energy is described by the PSD. The PSD is applied to a State-Space model which represents the structural characteristics of the system – specifcally the characteristics of the transmission this disturbance energy to various portions of your system.
All of this starts with a PSD so we define a PSD class
classdef psdData
....
end
From here we define our properties, methods and events. Since this will be a stand-alone class for holding and manipulating data, there are no events. So what properties do we need?
- Bare Essentials
- Name: Name the PSD data
- Freq: Vector of Frequencies at which Magnitude data is captured
- Mag: Vector of Magnitudes measured
- RootPSD: Is this a a root PSD – in other words the units are something like rad/rt(Hz) instead of rad^2/Hz?
- Plotting Essentials
- UnitBaseMag: Base unit for magnitude measurements
- UnitBaseFreq: Base unit for frequencies at which magnitude measurements are captured
- PlotFreqUnit: Frequency Units desired on PSD Plot
- TimeUnit: The UnitBaseMag just holds a value like radians or degrees or m or ft. If the measured magnitude is a rate – rad/sec or m/sec then this holds that the TimeUnit is 1/sec
The reason the units are broken up into base and time portion is because we will be including methods to integrate and differentiate the PSD. In my industry rate PSDs are often the easiest to measure. As a result we often get rate PSDs (in rad/sec) but need an angular (position) disturbance PSD so we end up integrating the measured rate PSD. So it only makes sense to incorporate integration and differentiation into our class. I’ll deal with the methods in a later posting
Now that we have a list of properties we need to decide access priviledges. See a full list of Class Property Attributes here.
10th April 2009
I hardly used MATLAB 2008a and never installed 2008b because of the shear amount of time it required to solve all of the stupid little issues with Mathworks new installation procedure. I hate it and they should get rid of it. However, in MATLAB 2008a Mathworks introduced a huge change to their classes.
In some of my work creating classes makes a lot of sense. However, in previous versions building a class was an excrutiatingly slow and painful process requiring the developer to create a multitude of m-files for setting and getting properties, for displaying the data, and other basic infrastructure. In 2008a MATLAB came out with a new way of programming classes which – at least for small, simple classes – greatly reduces development time.
In MATLAB 2008a, many of the infrastructure m-files you used to have to build for classes disappeared. The entire class can be held in a single file if desired. This one file can contain properties, events and methods. For my purposes I usually end up with a few m-files containing helper functions for certain pieces of codes that are required in several places.
Over the course of the next several blog posts I’ll be going through an example of a class I built in about a day. I’ve also found that making tweaks is very easy since there are far fewer files to deal with and many changes made to methods take effect immediate without the need to destroy and recreate the instance of class you are testing.
The example class will be a class for holding and plotting PSD Data. Something very useful for Stochastic controls.