Doubt math

3 Ansichten (letzte 30 Tage)
Nuno
Nuno am 6 Apr. 2011
Bearbeitet: Jenna am 23 Feb. 2023
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?

Akzeptierte Antwort

Matt Tearle
Matt Tearle am 7 Apr. 2011
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).
  13 Kommentare
Nuno
Nuno am 11 Apr. 2011
This expression:
-(V1-(-LambertW(-Rs*IR*Rp*exp(Rp*(Rs*ICC+Rs*IR+V1)/(m*VT*(Rp+Rs)))/(-Rs*m*VT-Rp*m*VT))+Rp*(Rs*ICC+Rs*IR+V1)/(m*VT*(Rp+Rs)))*m*VT)/Rs
But, how do you transform the expression in this form?
Walter Roberson
Walter Roberson am 11 Apr. 2011
I used a different symbolic package to get that, but it is likely that solve() like Tim showed should be able to handle it.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (4)

Matt Fig
Matt Fig am 6 Apr. 2011
What do you mean "without math methods?" MATLAB uses only math methods as far as I know...
  14 Kommentare
Image Analyst
Image Analyst am 12 Okt. 2012
Or "ASSEMPDE".
Image Analyst
Image Analyst am 15 Okt. 2015
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.

Melden Sie sich an, um zu kommentieren.


the cyclist
the cyclist am 6 Apr. 2011
You could use the function "fzero" to solve this equation.
  1 Kommentar
Nuno
Nuno am 7 Apr. 2011
But how fzero resolve this problem?

Melden Sie sich an, um zu kommentieren.


Tim Zaman
Tim Zaman am 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)')
-untested-
  4 Kommentare
Nuno
Nuno am 7 Apr. 2011
Ups... I don't understand...
Walter Roberson
Walter Roberson am 7 Apr. 2011
"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.

Melden Sie sich an, um zu kommentieren.


Jenna
Jenna am 23 Feb. 2023
Bearbeitet: Jenna am 23 Feb. 2023
Unfortunately, there is no built-in MATLAB function that can solve an equation like the one you have given without using any mathematical methods. However, MATLAB does have functions that can help you solve equations numerically using methods like Newton-Raphson or the Bisection method.
Here's an example of how you could use the fsolve function in MATLAB to solve your equation:
% Define the function you want to solve
fun = @(I) ICC - IR.*(2.718.^((V1+Rs*I)./(m.*VT))-1) - ((V1+Rs.*I)/Rp);
% Use fsolve to find the value of I that solves the equation
I = fsolve(fun, x0);
% Display the result
disp(['The value of I that solves the equation is ', num2str(I)]);
In this example, x0 is an initial guess for the value of I. You would need to define the values of ICC, IR, V1, Rs, m, VT, and Rp beforehand.

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by