Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (4)
Matt Fig
le 6 Avr 2011
2 votes
What do you mean "without math methods?" MATLAB uses only math methods as far as I know...
14 commentaires
Tim Zaman
le 6 Avr 2011
he just wants the "I" out of the middle and last part of the equation singled out.
Matt Fig
le 6 Avr 2011
Perhaps...
Nuno
le 6 Avr 2011
Matt Tearle
le 6 Avr 2011
Matt, it's a dirty little secret that MATLAB was actually written by astrologers with ouija boards. fzero works by summoning demons from the Fourth Circle.
OK, seriously, Nuno, do you mean you want a symbolic answer (ie "rearrange the equation to get I = expression in terms of V1, etc")? Or perhaps a numeric answer ("for a given set of values for V1, IR, etc, I = 0.626782")?
Sean de Wolski
le 6 Avr 2011
@Matt T, if fzero summons demons; does bsxfun summon oompa-lumpas to perform the operations?
Matt Fig
le 6 Avr 2011
@Sean de, BSXFUN simply is the Fourth Circle.
Matt Tearle
le 7 Avr 2011
Oompa Loompa doompety doo
We have a binary expansion for you
Oompa Loompa doompety dee
It has squat to do with binary
Matt Fig
le 7 Avr 2011
They had to come up with something, because SXFUN looks too much like sucks-fun - hardly a good name for a built-in function!
the cyclist
le 7 Avr 2011
That's not the first thing that sprang to mind when I saw SXFUN.
Matt Fig
le 7 Avr 2011
That remark made me laugh out loud, cyclist! Too funny.
Nuno
le 7 Avr 2011
Matt Tearle
le 7 Avr 2011
Yeah, we wouldn't want any awkwardly named functions...
**cough CUMTRAPZ cough***
Image Analyst
le 12 Oct 2012
Or "ASSEMPDE".
Image Analyst
le 15 Oct 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.
the cyclist
le 6 Avr 2011
0 votes
You could use the function "fzero" to solve this equation.
1 commentaire
Nuno
le 7 Avr 2011
Tim Zaman
le 6 Avr 2011
0 votes
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 commentaires
Nuno
le 6 Avr 2011
Walter Roberson
le 6 Avr 2011
Symbolically, assuming 2.718 represents exp(1),
-(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
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.
Nuno
le 7 Avr 2011
Walter Roberson
le 7 Avr 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.
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.
Catégories
En savoir plus sur Symbolic Math Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!