# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution
Highlighted

## Fitting transcendental equation

Hello everybody,

I have experimental I-V data from a solar cell in the dark (basically a diode). I would like to fit this data into the following equation to obtain the optimized parameters Rs, Rsh and J01. As you can see, this is a transcendental equation and cannot be expressed as

I = I(V, I01, Rs, Rsh)

Is there any curve optimization VI that could help me fit this model?

I believe that all the non-linear fitting VIs in Labview require the function to be non-transcendental. Is there any alternative I could use?

Thank you very much for your help.

Message 1 of 11
(624 Views)
Highlighted

## Re: Fitting transcendental equation

Is VT a parameter or constant?

What is the typical range for V and I?

What are typical values for the parameters? LabVIEW Champion. It all comes together in GCentral What does "Engineering Redefined" mean??
Message 2 of 11
(573 Views)
Highlighted

## Re: Fitting transcendental equation

Is VT a parameter or constant?

What is the typical range for V and I?

What are typical values for the parameters?

Hi,

Thanks for the reply. VT is a constant.

Let's say that V = [-2, 2] V and I = [0, 0.045]

Typical values for the parameters let's say for example: I01= 50E-15 A/cm2, Rsh=800 Ohms*cm2, Rs= 4 Ohm*cm2.

Message 3 of 11
(541 Views)
Highlighted

## Re: Fitting transcendental equation

"If you weren't supposed to push it, it wouldn't be a button."
Message 4 of 11
(521 Views)
Highlighted

## Re: Fitting transcendental equation

@JesusIbarra wrote:

Hello everybody,

I have experimental I-V data from a solar cell in the dark (basically a diode). I would like to fit this data into the following equation to obtain the optimized parameters Rs, Rsh and J01. As you can see, this is a transcendental equation and cannot be expressed as

I = I(V, I01, Rs, Rsh)

Sure it can -- you just did, above (assuming Vt is a constant).

Is there any curve optimization VI that could help me fit this model?

How about "Nonlinear Curve Fit on the Mathematics/Fitting Palette?

I believe that all the non-linear fitting VIs in Labview require the function to be non-transcendental. Is there any alternative I could use?

Thank you very much for your help.

Bob Schor

Message 5 of 11
(494 Views)
Highlighted

## Re: Fitting transcendental equation

I apologize if I was not clear. On the right side of the equation there is I*Rs (they are separate variables). So we have I inside the exponential function and at the end of the equation as well. The equation cannot be solved for I because of the variable inside the exponential.

Thanks again.

Jesus

Message 6 of 11
(476 Views)
Highlighted

## Re: Fitting transcendental equation

@JesusIbarra wrote:

On the right side of the equation there is I*Rs (they are separate variables).

Sorry, my mistake.  Re-thinking ...

This is from a review of Solving Transcendental Equations: The Chebyshev Polynomial Proxy and Other Numerical Rootfinders, Perturbation Series, and Oracles, by John P. Boyd, 2014:

"Transcendental equations arise in every branch of science and engineering. While most of these equations are easy to solve, some are not, and that is where this book serves as the mathematical equivalent of a skydiver's reserve parachute—not always needed, but indispensible when it is. The author's goal is to teach the art of finding the root of a single algebraic equation or a pair of such equations."

There are clearly methods to do what you are asking, but you are correct, it is considerably more difficult (and highly specialized) that it might be "reasonable" to expect that most Programming Languages would not have built-in routines for doing this task.

The most sophisticated "M" (as in "Mathematics", including Mathematica, MathCad, Maple, and Matlab) with which I have some experience is Mathematica, which has some discussion of this topic.  You might find some useful information on the Web -- search for Transcendental Equation Mathematica.

Bob Schor

Message 7 of 11
(450 Views)
Highlighted

## Re: Fitting transcendental equation

Assuming the function s well behaved, you can place all terms to the right and use Newton-Raphson to find the value of I where the term is zero.

Basically find "I" where:

{right side equation} - I = 0

Given all other constants. repeat for all possible V's. Graph I vs V.

Now create a fit model model that uses this to solve for I given a V and all other parameters)

Do you know how the function is approximately supposed to look like? What is the value for VT?

(Also watch your terminology. You problem is not the transcendental equation but the fact that you cannot solve for I. Fitting typical transcendental functions (e.g. y=e^x) is no problem.) LabVIEW Champion. It all comes together in GCentral What does "Engineering Redefined" mean??
Message 8 of 11
(424 Views)
Highlighted
Solution
Accepted by JesusIbarra

## Re: Fitting transcendental equation

I think it is possible to sidestep the transcendental part of this problem entirely. As I understand it you are not trying to solve for x if given y, or y if given x. You are trying to find the parameters of the model that best fit your equation. So perhaps rearrange your equation slightly by subtracting I from both sides and call the left side Y, recognizing that Y should always be zero: Now treat this as your model for curve fitting. You will have an array of Y values that are all 0. I and V are treated as your X input to the Nonlinear Curve Fit.vi

Nonlinear curve fit.vi only allows a 1D array of values for X and Y, but does not check to make sure they are the same length (Thanks Christian!!!), so this allows you to concatenate your V and I arrays into a single "X" array. Below is a snippet that shows what I mean. Now your model must unpack the X array so you can evaluate your model. So the nonlinear curve fit will adjust the model parameters to make the model as close as possible to the Y values which are 0. This is the same way that we solve for a best fit circle or ellipse using Nonlinear Curve Fit. Ellipse fit is a shipping example (...\examples\Mathematics\Fitting\Ellipse fit.vi), but the code is a bit harder to read and the modeling aspect of the problem is not explicitly called out.

-Jim

Message 9 of 11
(423 Views)
Highlighted
Solution
Accepted by JesusIbarra

## Re: Fitting transcendental equation

@DSPGuy wrote:

So perhaps rearrange your equation slightly by subtracting I from both sides and call the left side Y, recognizing that Y should always be zero:

While that will give the best fit parameters, there is still the difficulty of graphing the original data and the corresponding fit on an "I vs. V" XY graph. For that we can still use my suggestion above.

On a side note, I would simplify some of the details (fewer primitives and coercions). I doubt there is a noticeable performance penalty. In most cases, we don't even need the FOR loop in the model, of course.  LabVIEW Champion. It all comes together in GCentral What does "Engineering Redefined" mean??
Message 10 of 11
(413 Views)