02-25-2015 09:03 AM
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
02-25-2015 07:06 PM
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.
02-26-2015 05:16 AM
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
02-26-2015 08:52 AM
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,
02-26-2015 11:34 AM
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
03-02-2015 01:26 PM
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,
03-04-2015 05:01 AM
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
03-04-2015 09:13 AM
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....