LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Need non negative solution for an overdetermined system of linear equations (positive constraint genlineqs)

Hi all,

 

I have a overdetermined system of linear equations that I solve using lsqlin in Matlab.  I've found that genlineqs in the advanced analysis library can give me similar answers when using lsqlin with no constraints.  However, I need to postively constrain the solutions which I can't seem to do in cvi at all.  Does anyone have any insights, whether with genlineqs or any other libraries out there that might allow me to do this? 

 

Many thanks in advance

0 Kudos
Message 1 of 6
(4,220 Views)

Hello there,

 

     I am unaware of any positive (or non-negative) constraint Best answer approximation for this type of problem in CVI,  I know of a document that explains an algorithm that implements one of these algorithms.

           (http://mathematicsandcomputation.freezoka.net/MC07/Math07/pdfs/mcsna01299full.pdf    This is used for Spectrometry but the algorithm should work well for any situation)

     In the mean time I will continue to see what I can find in the API.

 

Daniel

 

0 Kudos
Message 2 of 6
(4,203 Views)

Thanks Daniel.  I kind of figured I wouldn't be able to do it in cvi.  Seems like there should be some package out there though that works in c for these kinds of problems.  

0 Kudos
Message 3 of 6
(4,201 Views)

I have tested the algorithm in th paper that was previously mentioned and it gives you a LSR answer  with constraints that everything is non-negative.  I think that is going to be your best shot. Thank you for your help.

0 Kudos
Message 4 of 6
(4,193 Views)

Thanks, I started looking at the paper yesterday and it seems like just what I need.  I'm going to start working on implementing it in cvi. 

0 Kudos
Message 5 of 6
(4,187 Views)

If you are going to consider non-linear least square algorithms with constraints it might be of interest that Intels MKL library provides suitable routines, and that a free routine in C is also available here. In the first case linking may pose a difficulty, in the second that the code is quite 'universal', i.e. a little bit bloated, but it is actively maintained. 

0 Kudos
Message 6 of 6
(4,183 Views)