LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

GUI

Hi,

    

    I am working on linearization in nonlinear control system.In which i developed code in MATLAB 2006.

Currently i'm work labview 2012.I want to call code and developed fully GUI.

 

 

          I'm attach my vi.In which GUI in form of

INPUT NODE--  f1,f2-f3,f4 input-output equation.x1,x2,u operating point.

OUTPUT NODE -- A,B,C,D matrix.

Is there any compatibility issue?

Please help me to this vi fully GUI.

0 Kudos
Message 1 of 8
(3,442 Views)

Dear hiralap17,

if you have to parse strings into formula and then evaluate the formulas using some values, you should use the already available functions: "Eval Parsed Formula String VI" and "Parse Formula String VI". See attachment, run continuously and try yourself, please.

 

Cheers,

0 Kudos
Message 2 of 8
(3,329 Views)

Hello sir,

 

  Thank u for your suggetion.I'm used Labview-2012.

  As per ur suggetion, used EVAL parsed vi.

My problem was at ouput side i want A,B,C,D matrix.where EVAL vi show whole equation value.

like

matrix A=a11,a12,a21,a22

matrix B=b11,b22

matrix C=c11,c12,c21,c22

matrix D=d11,d22

 

0 Kudos
Message 3 of 8
(3,249 Views)

Dear hiralap17,

 

I am confused of your MATLAB code. Correct me, if any of the following is incorrect:

 

1) variables x1, x2 and u (later named x_i) are scalars (no vectors or higher dimensional arrays)

2) results f1..f4 (later named f_i) are scalars, too

3) fction diff() is not redefined and it does, what it states on the help page for diff(). And here is a stumbling block: what is a diff() of a scalar? If diff() should work correctly, then f_i should be 1D array and x_i a scalar, but that contradicts to the definition of f_i.

4) On the other hand, you expect A..D to be matrices., so eval(a_i) shall be scalar.

5) fction eval() is not redefined and it does what is states on the help page for eval(). Another unclear issue: a1..a4 were evaluated already, so eval() to scalar isn't going to do anything extraordinary, is it?

 

It would be clearly helpful, if you could attach a correct M-file with specified example inputs and expected outputs.

 

Cheers,

0 Kudos
Message 4 of 8
(3,205 Views)

Respected sir,

 

 Thanks for reply.

 I have attach correct .m file.In which Input equation,output equation,operating point value all are INPUTS.

A,B,C,D matrix are OUTPUT.

 

   POINTS:

  (1) Input part is done.

  (2) I am phase the problem in middle pare of .m file.

       Function diff() works in MATLAB like differentiation.In this .m file function diff() works differentiation with respect to x1,x2,u.(which is ultimately operating point -INPUT)

 

        How to do (diffrentiation) in Labview that was Question?

        Accordingly Differntiation we get output A,B,C,D matrix.

 

  If it is possible for u next VI communication made in LabVIEW 2012,because in college LabVIEW 2013 licence is not avilable.

 

 

 

 

0 Kudos
Message 5 of 8
(2,922 Views)

Dear hiralap17,

 

OK, so you were using the symbolic toolbox in MATLAB. I do not posses such a toolbox; but I do not see a point, why not to calculate the diff() results by hand. Also I do not know how to represent symbolics in LabVIEW. But doing the elementary differentiation, I came to these results:

 

INPUT

x1= 1;
x2= 1;
u= 1;

 

OUTPUT

A =
     4     5
     2     1

B =
     2
     1

C = 7     9
D = 3

 

You did not express the awaited output, so please, check on it yourself.

 

To my knowledge, there is no symbolic algebra toolbox in LabVIEW. I can't avoid having a feeling that we are solving a homework here so, my opinion is the following: You do your part of the homework by differentiating the elementary equations, which you have in your M-file, e.g.

 

%eq1 = x1+3*x1*x2+x2^2+2*u;

%g11=diff(eq1,x1); this becomes
g11 = 1+3*x2; % this is a valid scalar equation, no need for symbolics

etc. for all your e_ii, f_ii, g_ii and l_ii

 

Then you have your 9+ simple equations without any loss of information. I believe that this step should not change the solution. Then you start to build your LabVIEW script by building/evaluating the equations and building up the matrices. As scketched below:

g11.png

 

In case you should have troubles there, you come back here and we continue to help you, building the script. I hope this is a fair agreement. Let me know, if you feel different.

 

Cheers,

0 Kudos
Message 6 of 8
(2,905 Views)

Respected sir,

    

       I let u know exactly what i want.I'm thinking that message not reach exactly.

I,m working on Project in which necessory to made stand alone application converting into executable.

My goal is, i want to made Fully GUI (sending .m file)VI ,after this VI converting it into .executable.

In which user change full equation.e.g.%eq1 = x1+3*x1*x2+x2^2+2*u,

                                                       %eq2 = x1+x1*x2+u.

User change equation whatevwe he/she want,with number 1 to 9,sign plus-minus.Operating points change with number 1 to 9.

According to that get value of  Output A,B,C,D.

 

...............................................................................................................................................................................................................

 

I already developed VI.In which i'm use MATLAB script file.For this i use LabVIEW 2011,MATLAB 6.5 licence version.

I'm calling .m file.It will run fine. But .exe not support function diff(),so,executable not possible by itself.

 

 

so,i choose another way and want to made fully in labview so,.exe problem not occur.

According to that only function diff() problem.

 

LabVIEW has facility or any block like differentiation.

 

 

VI-Block diagram- right click-Function - right click -

Mathematics-Differential Equation -(1) Ordinary differential equation

                                                   (2) Partial differential equation

If you have any example related to this than it is really helpful me.

 

..............................................................................................

I have also another way Control design and simulation box have already Linearization.vi

But it will take input as make a subsystem for specific model.so,fully GUI not possible.

................................................................................

 

If u have any related information for this topic it will great helpful me.

 

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

Dear hiralap17,

 

you are right, MATLAB symbolic differentiation fails to compile http://www.mathworks.com/matlabcentral/answers/5220-standalone-application-works-in-matlab-but-not-o...

 

the mentioned LabVIEW routines are differential equation solvers. They are not symbolic differentiation routines.

 

Here is a link to an old topic, where it is somehow discussed, what one can do in a similar case:

http://forums.ni.com/t5/LabVIEW/Symbolic-differentiation/td-p/23055

 

Here is a routine, which is able to evaluate an equation and its differential numerically. You won't see the intermediate results such as the symbolic differential, but you can interpolate the results

http://zone.ni.com/reference/en-XX/help/371361J-01/gmath/differentiation/

But you have to reduce your equation to a single variable, of which I have no clue.

 

If you really need the symbolic differentiation, then I do not think LabVIEW is your friend here. Are you at a beginning of your project, then you are better off with another software, such as Python.

 

Cheers,

0 Kudos
Message 8 of 8
(2,774 Views)