MATLAB Answers


Doubt math

Asked by Nuno
on 6 Apr 2011
Latest activity Commented on by Image Analyst
on 15 Oct 2015

I have the next expression and my unknown is "I".

I = ICC - IR.*(2.718.^((V1+Rs*I)./(m.*VT))-1) - ((V1+Rs.*I)/Rp);

Exist any function im Matlab that resolve this expression without math methods?



No products are associated with this question.

4 Answers

Answer by Matt Tearle
on 7 Apr 2011
 Accepted answer

OK, to expand on the cyclist's answer:

  1. rewrite your equation in the form f(I) = 0: ICC - IR.*(exp((V1+Rs*I)./(m.*VT))-1) - ((V1+Rs.*I)/Rp) - I = 0
  2. having defined all the constants (ICC, m, VT, etc), make a function of I using an anonymous function handle: f = @(I) ICC - IR.*(exp((V1+Rs*I)./(m.*VT))-1) - ((V1+Rs.*I)/Rp) - I;
  3. apply fsolve to f

Like Walter, I'm assuming 2.718.^foo really means e^foo, which, in MATLAB, should be implemented as exp(foo).


No, you can only solve for a single value of V1 if you are using fzero() . You could solve over multiple V1 if you had the optimization toolkit and fsolve() but the setup would change.

If you go back to the symbolic LambertW expression that I showed, then you should be able to vectorize that.

on 11 Apr 2011

This expression:


But, how do you transform the expression in this form?

I used a different symbolic package to get that, but it is likely that solve() like Tim showed should be able to handle it.

Answer by Matt Fig
on 6 Apr 2011

What do you mean "without math methods?" MATLAB uses only math methods as far as I know...


Matt Tearle
on 7 Apr 2011

Yeah, we wouldn't want any awkwardly named functions...

**cough CUMTRAPZ cough***


A new funny one is "removecats" (in the Statistics and Machine Learning Toolbox). People have been trying to use it on youtube and Facebook videos.

Answer by the cyclist
on 6 Apr 2011

You could use the function "fzero" to solve this equation.

  1 Comment

on 7 Apr 2011

But how fzero resolve this problem?

Answer by Tim Zaman
on 6 Apr 2011

I guess what you need is just a solver; for example you define

syms ICC IR V1 Rs m VT Rp;

solve('I = ICC - IR.*(2.718.^((V1+Rs*I)./(m.*VT))-1) - ((V1+Rs.*I)/Rp)')



Symbolically, assuming 2.718 represents exp(1),


Ugly. But it is the standard form to solve such equations, which is a fact you would have to know through mathematical experience as the Lambert W function is not one of the obvious ones.

on 7 Apr 2011

Ups... I don't understand...

"How this works" is that the symbolic solver does pattern matching and determines that the expression matches a pattern that it knows how to solve. It then substitutes the components from your actual expression in to the general solution to the kind of problem that it has decided your expression is. It so happens that the pattern matched is one whose answer is expressed in terms of the Lambert W function. _Why_ the Lambert W function is the answer for those kinds of problems is a topic for a series of lectures in complex analysis.

Join the 15-year community celebration.

Play games and win prizes!

Learn more
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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!