Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Equation solving

Subject: Equation solving

From: Neeta

Date: 21 Oct, 2010 19:01:05

Message: 1 of 4

 I am stuck in the problem while working on matlab and looking for help.

I am using an equation as below and wonder if Matlab can solve this with out simulink..

I=((Isc*G)/1000)- Io*(exp(38.9*(V+I*Rs))-1)-((V+I*Rs)/Rsh)
Where all the other parameters are constant except ‘I’
 So the equation is a kind of
X=Function of (X) ….
Can we solve these equations with matlab without using simulink modeling where, of course, we can used feedback connections in the model.

Subject: Equation solving

From: Matt J

Date: 21 Oct, 2010 19:18:03

Message: 2 of 4

"Neeta " <neeta.khare@villanova.edu> wrote in message <i9q2lh$8ag$1@fred.mathworks.com>...
> I am stuck in the problem while working on matlab and looking for help.
>

doc fzero

Subject: Equation solving

From: Roger Stafford

Date: 22 Oct, 2010 00:25:05

Message: 3 of 4

"Neeta " <neeta.khare@villanova.edu> wrote in message <i9q2lh$8ag$1@fred.mathworks.com>...
> I am stuck in the problem while working on matlab and looking for help.
>
> I am using an equation as below and wonder if Matlab can solve this with out simulink..
>
> I=((Isc*G)/1000)- Io*(exp(38.9*(V+I*Rs))-1)-((V+I*Rs)/Rsh)
> Where all the other parameters are constant except ‘I’
> So the equation is a kind of
> X=Function of (X) ….
> Can we solve these equations with matlab without using simulink modeling where, of course, we can used feedback connections in the model.
- - - - - - - - -
  This problem can be transformed so that it can be solved in terms of the Lambert W function. By collecting terms appropriately your equation can be expressed in the form

 A*I + B = C*exp(D*I+E)

where A, B, C, D, and E are known. Then go through the following manipulations.

 (A*I+B)*exp(-D*I) = C*exp(E)

 (-D*I-B*D/A)*exp(-D*I) = -C*D/A*exp(E)

 (-D*I-B*D/A)*exp(-D*I-B*D/A) = -C*D/A*exp(E-B*D/A)

If the substitution W = -D*I-B*D/A and Z = -C*D/A*exp(E-B*D/A) is made, this last equation becomes

 W*exp(W) = Z

which is the form of the Lambert W function. Since you know Z you can find W with this function. Then from W you can find I.

  This function is in the Symbolic Toolbox and is called 'lambertw'. Note that for some real values of Z there are two real roots to the equation, for some there is one, and for others there are no real roots. The different roots can be obtained with the use of the K-th branch argument which as I recall should either be 0 or -1 for real roots. (Other branch values pertain to complex roots which I assume you are not trying to find.)

Roger Stafford

Subject: Equation solving

From: Neeta

Date: 22 Oct, 2010 17:59:06

Message: 4 of 4

I will try this out. Actually this function (mentioned above) is a part of big expression. The expression works as an objective function for an optimization problem. I assume if I get "I" as a function of rest of the parameters (without a feed back loop) I can used this function in the objective function.
 


"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <i9qll1$g6l$1@fred.mathworks.com>...
> "Neeta " <neeta.khare@villanova.edu> wrote in message <i9q2lh$8ag$1@fred.mathworks.com>...
> > I am stuck in the problem while working on matlab and looking for help.
> >
> > I am using an equation as below and wonder if Matlab can solve this with out simulink..
> >
> > I=((Isc*G)/1000)- Io*(exp(38.9*(V+I*Rs))-1)-((V+I*Rs)/Rsh)
> > Where all the other parameters are constant except ‘I’
> > So the equation is a kind of
> > X=Function of (X) ….
> > Can we solve these equations with matlab without using simulink modeling where, of course, we can used feedback connections in the model.
> - - - - - - - - -
> This problem can be transformed so that it can be solved in terms of the Lambert W function. By collecting terms appropriately your equation can be expressed in the form
>
> A*I + B = C*exp(D*I+E)
>
> where A, B, C, D, and E are known. Then go through the following manipulations.
>
> (A*I+B)*exp(-D*I) = C*exp(E)
>
> (-D*I-B*D/A)*exp(-D*I) = -C*D/A*exp(E)
>
> (-D*I-B*D/A)*exp(-D*I-B*D/A) = -C*D/A*exp(E-B*D/A)
>
> If the substitution W = -D*I-B*D/A and Z = -C*D/A*exp(E-B*D/A) is made, this last equation becomes
>
> W*exp(W) = Z
>
> which is the form of the Lambert W function. Since you know Z you can find W with this function. Then from W you can find I.
>
> This function is in the Symbolic Toolbox and is called 'lambertw'. Note that for some real values of Z there are two real roots to the equation, for some there is one, and for others there are no real roots. The different roots can be obtained with the use of the K-th branch argument which as I recall should either be 0 or -1 for real roots. (Other branch values pertain to complex roots which I assume you are not trying to find.)
>
> Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us