11-19-2012 01:48 AM - edited 11-19-2012 01:49 AM
Hi!
I'm currently doing a project and I'm stuck and am in need for some help.
I've done a state-space model that I'm using for this project. I've used Matlab (with and without simulink) to simulate this model and to plot its behaviour. But when I want to do this in LabVIEW, i get stuck.
I dont want to use Mathscript 'cause then it would be using Matlab.
Does anybody have some ideas of how I can simulate and plot my state-space model from the matrix parameters that i have?
________________
Look at the attachment, I want to plot x.
Solved! Go to Solution.
11-19-2012 04:18 PM
You must use the "Control Design and Simulation Module" to do this. This is 'trivial' if you use the module. We have a function that would allow you enter, visualize and simulate the model.
If you just want to use LabVIEW without the module, then it would become much more difficult.
http://sine.ni.com/nips/cds/view/p/lang/en/nid/209850
Also, notice that if you are an academic user, you probably have access to this module.
In addition, if you use the Mathscript RT module in conjuction to the Control Design and Simulation Module, several functions can used as text too. And Mathscript doesn't require other software to be installed.
Hopefully this helps you...
11-20-2012 02:06 AM
Thanks for the reply, helps me a bit on the way:)
I'm trying to see if I have the "Control Design and Simulation Module", how do I find that out? We have Labview 2009 SP1 if that says anything:S
About the Mathscript module, it was my believe that it uses the Matlab to compile and run, but if that's not the case than I'll give it a go.
The problem is that I want the program to work as fast as possible and am I wrong thinking that the "Control Design and Simulation Mode" is going to perform faster than the Mathscript?
11-20-2012 01:37 PM
Well, you can verify if you have by looking at meny Help >> About LabVIEW.... You should see this icon if you have CD&SIM module (of course, the logo should be 2009 in your case):
Again, if you do not have and you are academic, try to talk to your administrator and verify its availability. If you are a student, the student version of LabVIEW also have this software.
Mathscript RT Module (not the "Matlab Script Node") does not depend on any other software other than LabVIEW and it allow to compile m-code directly in LV. In general, its speed depends on the kind of code you have.
The CD&SIM module can be considerably fast, but again, it depends of what kind of code your are trying to use. The State-Space function in the Control and Simulation Loop has good performance compared to CD Linear Simulation.vi.
11-29-2012 03:43 AM
Thanks, that helped alot!
Had to contact NI for a 2011 link so i could get the RT module and CD&S.
Instead of creating a new thread: Can i plot the state-space simulation? I've tried different ways, doesn't want to work for me.
11-29-2012 01:39 PM - edited 11-29-2012 01:40 PM
We have so many different ways to do this. Try to look at the following shipping examples:
C:\Program Files (x86)\National Instruments\LabVIEW 2011\examples\Control and Simulation\Control Design\Model Construction\CDEx Creating SS Model from String Matrix.vi
C:\Program Files (x86)\National Instruments\LabVIEW 2011\examples\Control and Simulation\Control Design\Model Construction\CDEx Rendering State-Space Equations.vi
C:\Program Files (x86)\National Instruments\LabVIEW 2011\examples\Control and Simulation\Control Design\Time Analysis\CDEx Time Domain Analysis.vi
C:\Program Files (x86)\National Instruments\LabVIEW 2011\examples\Control and Simulation\Simulation\Continuous Linear\SimEx state space.vi
They show how you can use the product to create a State-Space (SS) model, show the rendered model on the front panel, do a linear simulation of a model and implement the state-space model in the Control and Simulation Loop, respectively.
Notice also that we have an extensive amount of examples available for you. Hope this helps...