LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

genetic algorithm of matlab in mathscript

Hello,

I would like to use the genetic algorithm  optimizer tool in Matlab. So I  think that mathscript is ideal to be used in Labview.

So concretly I would like to use all the parameters of the genetic algorithm optimizer toolkit as inputs for the mathscript and receive the results of the optimisation in the outputs.

Did anyone try to do this optimization.

It will be great if I get an answer.

Cheers,

Zied

0 Kudos
Message 1 of 8
(7,878 Views)

I do not think the genetic algorithm optimizer toolkit is currently supported in MathScript. You'd better check the function list in the following page firstly.

 

http://zone.ni.com/reference/en-XX/help/373123C-01/

0 Kudos
Message 2 of 8
(7,868 Views)

Hello,

I think it is not supported as I dont see it in the list.

Has anyone an idea how to link the genetic optimizer of Matlab with Labview and is there other powerful and robust genetic algorithm optimizer toolkit that could be linked with Labview.

Thanks,

Zied

0 Kudos
Message 3 of 8
(7,862 Views)

Although this is not a pure 'genetic algorithm', the global optimization function is LabVIEW does use evolutionary algorithm for optimization, allowing you to do global optimization. This is the documentation:

 

http://zone.ni.com/reference/en-XX/help/371361H-01/gmath/global_optimization/

 

Although for the moment, this is only available as a LabVIEW function, you can easily integrate the Mathscript node in LabVIEW to develop your equations and then, by moving the data outisde the node, you can call into the Optimization Function. Here is the shipping example location:

 

C:\Program Files (x86)\National Instruments\LabVIEW 2014\examples\Mathematics\Optimization\Find Global Min on Surface.vi

 

Hope this helps,

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 4 of 8
(7,858 Views)

Thank you for the reply. Actually, the global optimization VI has lots of similarities with the genetic algorithmbut it is still a bit different.

As you think the mathscript cannot accept the GA for Matlab, is there any solution to use the GA from Matlab in Labview like a communication between them.

Thanks,

Zied

0 Kudos
Message 5 of 8
(7,852 Views)

Well, to be able to run genetic algorithm in LabVIEW you have two options: you try to move your GA code inside Mathscript. In the latest versions we have support for 'cluster' and it is possible this could work as it is (although object oriented programming is not part of it, so  if the your GA code has objects, than you probably can't use Mathscript). Or you can just use the 'Matlab(R) Script Node'. This node allows you to communicate with Matlab (R) and you can call your function in it. This second options will only work on machines that have the both software installed.

 

One last option is for your to develop your own code in LabVIEW pure. But although that would give the best performance, you would have to create your own code. I found some options for you in the community as:

 

https://decibel.ni.com/content/docs/DOC-13699

 

and then, there is a book about LabVIEW and GA:

 

http://www.springer.com/engineering/control/book/978-1-84882-683-0

 

Hope this helps,

 

 

 

Barp - Control, Simulation, RTT and HIL - National Instruments
Message 6 of 8
(7,817 Views)

Thank you for your reply. I prefer the second solution where I can use the Matlab script node. Do you have an idea how I can call the GA optimiser inside that node?

Cheers,

Zied

 

 

0 Kudos
Message 7 of 8
(7,797 Views)

For the MATLAB(R) script node, you can reference the manual:

 

http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/creating_a_matlab_script/

 

But basically, you just use the function inside the node as you'd use in the MATLAB(R) and then, you have to interface with LabVIEW using inputs/outputs. The manual above helps you in how to do that....

 

 

Barp - Control, Simulation, RTT and HIL - National Instruments
Message 8 of 8
(7,791 Views)