Mathematica 8 – Control Theory Sneak Peek

October 9th, 2010 | Categories: mathematica | Tags:

Lots of people are hitting Walking Randomly looking for info about Mathematica 8 and have had to walk away disappointed….until now!

I’ve been part of the Mathematica 8 beta program for a while now and in order to access the goodies I had to sign an NDA which can be roughly summed up as ‘The first rule of Mathematica 8 beta is that you don’t talk about Mathematica 8 beta.’

As of today, however, I am allowed to show you a tiny little bit of it in advance of it being released. Mathematica 8 will include a massive amount of support for control theory. Here’s a brief preview

Let’s start by building a transfer function model

myTF = TransferFunctionModel[1/(1 + 2 s + 2 s^2 + s^3), s]

Transfer Function

I can find its poles exactly

TransferFunctionPoles[myTF]

{{{-1, -(-1)^(1/3), (-1)^(2/3)}}}

and, of course, numerically

TransferFunctionPoles[myTF] //N

{{{-1., -0.5 - 0.866025 I, -0.5 + 0.866025 I}}}

Here’s its bode plot

BodePlot[myTF]

Bode Plot
Here’s its response to a unit step function

stepresponse = OutputResponse[myTF, UnitStep[t], t]

Step Response of 3rd order Butterworth Filter
Let’s plot that response

Plot[stepresponse, {t, 0, 10}]

Step Response of 3rd order Butterworth Filter
Finally, I convert it to a state space model.

StateSpaceModel[myTF]

State Space Representation
That’s the tip of a very big iceberg ;)

Update: Mathematica 8 has now been released.  See http://www.walkingrandomly.com/?p=3018 for more details.

Other Mathematica 8 previews

  1. MySchizoBuddy
    October 9th, 2010 at 18:55
    Reply | Quote | #1

    how did you get the plots online. You did a screen capture of the plots or mathematica can export graphs to images?

  2. MySchizoBuddy
    October 9th, 2010 at 18:56
    Reply | Quote | #2

    it surprises me how we still don’t have mathcad style unit conversions.

  3. October 9th, 2010 at 19:07
    Reply | Quote | #3

    @MySchizoBuddy Unit conversions don’t concern me so I’ve never looked at how Mathematica supports them or otherwise. As for the graphs, Mathematica has been able to directly export them to lots of formats for ages now.

  4. October 10th, 2010 at 01:19
    Reply | Quote | #4

    I guess that we (finally) will be able to apply butterworth, chebyshev or other types of filters to data! I’ve been waiting for this ;-)

    Also I hope they upgraded the speed of algorithms of VoronoiDiagram (QHull is a like a million times faster :-P)

  5. Nasser M. Abbasi
    October 11th, 2010 at 03:35
    Reply | Quote | #5

    @Sander Huisman

    Many of these filters existed in a Mathematica application called “signals and systems” which I have, but does not run any more on version 7. Here is a old link about it:

    http://users.ece.utexas.edu/~bevans/projects/symbolic/pack.html

    But this application is no longer being sold by WRI. It looks to me like this app have now been ported to Mathematica kernel, which is a very good thing (TM)

    If you like to use Butterworth filter in Mathematica, look at my demo at WRI demo web site, I have a filter design demo there for this filter.

    http://demonstrations.wolfram.com/InfiniteImpulseResponseIIRDigitalLowPassFilterDesignByButter/

  6. October 11th, 2010 at 09:19
    Reply | Quote | #6

    @Nasser

    I downloaded your demonstration a little while ago to help me learn more about filters. Very nice work :)

  7. Joplin
    October 11th, 2010 at 14:00
    Reply | Quote | #7

    “a massive amount of support of control theory”
    will it be included in Mathematica 8 or it will be sold seperately?

    any clue what control theory functions are implemented? :)

    release date? :))

  8. Nasser M. Abbasi
    October 11th, 2010 at 14:51
    Reply | Quote | #8

    @Joplin

    All will be in Mathematica 8, in the kernel. No toolboxes. This is not Matlab :)

    As far as what functions, only someone in WRI would know. But if you look at the control system application

    http://www.wolfram.com/products/applications/control/

    May be one can get an idea, as I am assuming many of these functions is being moved to the kernel. (see below)

    Look at this talk by Dr Wolfram, he said:

    “Control theory. There are a lot of interesting methods that have been developed in control theory over the last few decades that actually deserve to be better integrated into general analysis, and model-building, and so on.

    Well, partly building on the add-on Control System Professional package, we’ve figured out how to real integrate control theory methods into core Mathematica.

    It’s very strongly based on nice, clean, symbolic representations of control systems.

    But what’s important is that we’re bringing all this stuff right into Mathematica.”

    Here is the link

    http://blog.wolfram.com/2009/11/12/the-rd-pipeline-for-mathematica/

    –Nasser

  9. Joplin
    October 11th, 2010 at 23:14
    Reply | Quote | #9

    @Nasser

    This “unity principle” in Mathematica that Wolfram talks about in the 2009 International Mathematica User Conference will be truly great when it is fully implemented and will be even greater if it will be possible to be done with the Mathematica price kept at the current level.

    Not to mention that if implemented right it will be a Matlab killer…

  10. Nasser M. Abbasi
    October 21st, 2010 at 10:13

    fyi,

    WRI has just made a web site about version 8, getting ready to release it:

    http://www.wolfram.com/mathematica-8-coming-soon.html?src=google&400+mathematica+8&gclid=CPzP353O46QCFQICbAodVhV4Iw

    It looks like version 8 will be released soon.

    –Nasser

  11. October 21st, 2010 at 10:56

    Thanks for that Nasser,
    Mike

  12. WildOne
    November 12th, 2010 at 23:45

    All these control plots were available in previous releases of Maple (as well as the ability to transform from one specification of a dynamic sytem (e.g. state space) to another)

  13. December 4th, 2010 at 21:15

    @MySchizoBuddy
    DesignerUnits.com gives MathCAD-style units in Mathematica.

    @Mike Croucher
    CAS units need more than conversions. Good code largely hides conversions from the user, who needs other things. Here’s a backgrounder. I’m exploring the v8 Alpha integration.

    @Nasser M. Abbasi
    @WildOne
    Brian Evans’s old signals package enabled heavy DSP work complete with plots. He showed how to proceed when native plots are missing: roll your own. As usual, Mathematica gives a way. Today the DSP plots are native, but they were always available. P.S. I like Maple too.

Comments are closed.