LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

solver / optimization

I need to "adjust" data that I am already processing with labview. The format of my data is a matrix 450 columns and 1001 rows. I would like to adjust the data one column at a time using this equation Z1 (r, c) = Z(r,c) + E + tan(pi/180*A)*r where E and A are the unknowns. I would like to solve for A first (and this is where my problem lies) and then the solution to E is straightforward. I wish to constrain the solution by extracting two segments of the data, for example L = mean (Z1(20:30,1)) R= mean(Z1(450:460,1)) Then vary the value of Atest until L-R = 0. I have been able to solve the problem easily in excel, but would like to keep everything within labview if I can. thanks
0 Kudos
Message 1 of 4
(2,565 Views)

Here is an earlier version of the code with a simple correction, that I have since discovered did not work as planned.

Download All
0 Kudos
Message 2 of 4
(2,552 Views)

Virtually all you say makes absolutely no sense. Can you point me to a website that describes the math?

 


@Jammin wrote:
The format of my data is a matrix 450 columns and 1001 rows. I would like to adjust the data one column at a time using this equation Z1 (r, c) = Z(r,c) + E + tan(pi/180*A)*r where E and A are the unknowns. I would like to solve for A first (and this is where my problem lies) and then the solution to E is straightforward. I wish to constrain the solution by extracting two segments of the data, for example L = mean (Z1(20:30,1)) R= mean(Z1(450:460,1)) Then vary the value of Atest until L-R = 0. I have been able to solve the problem easily in excel, but would like to keep everything within labview if I can. thanks

 

What is r and c, row and column perhaps?

How can you solve for A if you don't know E?

Are all columns supposed to have the same A and E?

 

You say it works in Excel. What formula did you use? Can you attach your excel worksheet with some data and the formulas?

 

I quickly glanced at your VI and it uses some very weird constructs:

 

  • Why the stacked sequence?
  • Why the array-cluster-unbundle dance? Index array can do it in one step.
  • Built array(concatenate mode) is more natural than insert into array to append two 2D arrays.
  • Why two transpose in a row? They cancel each other out!
  • The NaN remover is very inefficient, because of the constant resizing of the array as it grows. It is better to do things "in place". It will be orders of magnitude faster for large datasets.
(The attached quick modifications show some better alternatives, just to get you some ideas.).

 

0 Kudos
Message 3 of 4
(2,537 Views)

If I knew of the website, my question would likely be more clear.

 

r= row and c = column

 

Solve for A first with E = 0, then solve for E

 

Each column will have a unique A and E.

 

I have attached an annotated excel spreadsheet, that should address you questions.

 

Again, I wish to apologize for my jibberish.

 

Thank you for the code modifications

0 Kudos
Message 4 of 4
(2,528 Views)