LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fitting a solar cell model curve

Hello All,

 

I'm using LabVIEW 8.5. I managed to represent the curve of Solar Cel standard equivalent circuit which has an equation that needed to be solved using Newton-Raphson method.

 

Iph - (I0 * (( exp((V + (I*Rs))/(Ut*m)))-1)) - ((V + (I*Rs))/Rp) -  I = 0

 

then I represent a curve of a measured values of I (Y-Axis) and V(X-axis)

 

 

but now with trying to make fitting of a measured curve with to best parameters, I'm facing many problems.

 

 

I started to make the fitting using Nonlinear Curve Fitting VI , first I tried to make the model description using a formula String , but the VI can't understand a formula with both X, Y in it.

 

1,Then F(x,a) as a VI.

1.JPG

 

2, where the VI solves the Formula using Newton-Raphson zero finder.

2.JPG 

 

3, but then the fitting VI shows an error of input and returns the intial parameters as Best Fit ..

3.JPG

 

however it used to work well when F(x,a) was given as an ideal model equation  " Iph - ((I0/1000000) *( exp( V / (Ut*m) ) -1 ) ) "  as long as Ut initial guess is over 0.5 which isn't practical either.

 

I hope it wasn't too long post, hopefully you have the clue of the problem now.

 

 

 

 

Message Edited by 049 on 09-13-2009 01:48 AM
Download All
0 Kudos
Message 1 of 10
(5,268 Views)
Can you attach the actual VIs and some typical data instead of pictures? Thanks!
0 Kudos
Message 2 of 10
(5,241 Views)

Here ar ethe actuals VIs , and the typical measurement files will follow in the next post

 

 

0 Kudos
Message 3 of 10
(5,234 Views)

here are some of the measurment files ..  normally I need only the I and V values for the whole optimization process

 

 

0 Kudos
Message 4 of 10
(5,232 Views)

Here are a few tips: 

  1. Make sure the number of parameter estimates matches the number of paramters in the model. Currently, you have 4 estimates, but 5 parameters.
  2. Use the model equation to graph the curve using the initial estimates. Unless it looks similar to the data, the fit will fail. The first step would be to find initial estimates that are reasonable. It will also tell you if the model has no bugs.
  3. I assume that both x and y have some error. Couldn't you fit X vs Y instead, eliminating the NR step?
  4. You do an extraordinary amount of duplicate operations in your model. Everything that is the same during all iterations belong before the loop.
  5. I would recommend to not use anything based on strings. It is very inefficient. Newer version have a Newton-raphson zero finder based on a VI model.
  6. The way you read the data is mindboggling. To slice out a column from a 2D array you would simply use index array (and not some complicated dance via transpose... array subset...to dynamic data...from dynamic data... insert into array...array subset, etc.) This is pure Rube Goldberg code. :D. (Attached is a quick rewrite of that VI as an example how it could be done).
Message 5 of 10
(5,213 Views)

first of all thank you for the simplified VI ,

 

 

1- I think I do use the same number of Parameters and estimates .. Iph, I0, m, Rp, Rs  they are five in both cases.

 

I don't really understand point 3 and 4 .. from my experience I could only solve this equation using the NR zero finder only..

 

 

I think the biggest confusion is what is X and Y , because mainly I is Y and V(or U) is X .. but in NR formula X is I.

0 Kudos
Message 6 of 10
(5,172 Views)

The "Fitting with VI model.vi" you have attached builds an array of only 4 elements for the estimates. (Iph, I0, Rp, Rs) and you also have a disconnected array with only three elements. Maybe you attached the wrong VI.

 

Message Edited by altenbach on 09-14-2009 09:24 AM
0 Kudos
Message 7 of 10
(5,156 Views)

I'm sorry . When I checked tha attached file I found it was absolutely the wrong file . Here there again 🙂

 

 

please ignore the two non-connected nodes , because I just forgot o remove them

 

Message Edited by 049 on 09-15-2009 02:48 AM
Download All
0 Kudos
Message 8 of 10
(5,130 Views)

I found out that the error I get from the fitting VI is due to "some" values of the Model function that are N/A which could be ignored in practical but the fitting VI couldn't ignore them .. How can I tell the model function to only send values and hide N/A values ?

 

 

0 Kudos
Message 9 of 10
(5,119 Views)

Well, first you need to know why some values are NaN. Maybe there is a division by zero?

 

It really depends on the problem, but you can do whatever you want in the model, e.g. replace all NaN with a finite large number, for example.

0 Kudos
Message 10 of 10
(5,103 Views)