How to get the maximum value of an implicit function?

16 Ansichten (letzte 30 Tage)
Eungkyun Kim
Eungkyun Kim am 4 Feb. 2020
Kommentiert: Matt J am 5 Feb. 2020
I have the following implicit function:
I-Ipv+Io.*exp(((V+Rs.*I)/(Vt.*a))-1)-(V+Rs.*I)/Rp = 0
where I and V are unknowns and everything else is known. From this equation, I am trying to acheive the maximum value of P where P = V*I. To acheive this, I wrote the following codes:
fun = @(V,I) I-Ipv+Io.*exp(((V+Rs.*I)/(Vt.*a))-1)-(V+Rs.*I)/Rp;
f = fimplicit(fun,[0,40,0,9])
voltage = f.XData;
current = f.YData;
power = voltage.*current
maximum_power = max(power)
I believe this method does not allow me to change the number of points in X, therefore the calculated maximum power is not as accurate.
I would appreciate any suggestion regarding calculating a maximum power.
Thank you.

Akzeptierte Antwort

John D'Errico
John D'Errico am 4 Feb. 2020
If you have the otimization toolbox, then just formulate it as a nonlinear optimization. fmincon will be the correct tool. That is, minimize -V*I, subject to a nonlinear equality constraint, as you have written. So two variables, one equality constraint.
  3 Kommentare
Eungkyun Kim
Eungkyun Kim am 5 Feb. 2020
I think I got it actually. Thanks.
Matt J
Matt J am 5 Feb. 2020
If John's advice worked for you, please Accept-click his answer.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Matt J
Matt J am 5 Feb. 2020
Bearbeitet: Matt J am 5 Feb. 2020
I believe this method does not allow me to change the number of points in X,
It does, e.g.,
f = fimplicit(fun,[0,40,0,9],'MeshDensity',1000)
If it were me, though, I would probably use this method to initialize fmincon, as recommended by John.

Kategorien

Mehr zu Get Started with Optimization 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