Obtain first answer of a multiple answers solve
2 views (last 30 days)
Show older comments
Louis-Félix Baillargeon
on 21 Aug 2018
Answered: Louis-Félix Baillargeon
on 22 Aug 2018
Hi, I am trying to make a program that solves power electronics equations for me to save a lot of time. Anyways, I have equations containing trigonometric functions and when I'm solving them, I get the message that MATLAB cannot find an explicit solution. I'm guessing it's because there are multiple answers (maybe infinite) to my equation, but as a matter of fact, I only need the first answer after 0. I already assumed t > 0 and now I would like to have the nearest positive solution to 0 possible. A sample of my code is below in which vGS, iD and vD are all functions of t and the rest are constants.
if true
% syms t %Temps
assume (t > 0)
syms vGS(t) %Tension Gate-Source du MOSFET en fonction du temps
syms iD(t) %Courant de Drain du MOSFET en fonction du temps
syms vD(t) %Tension Drain du MOSFET en fonction du temps
syms VDp %Tension de Drain du MOSFET de l'étape précédente
syms IDp %Courant de Drain du MOSFET de l'étape précédente
%
%
vGS(t) = (VT+VF)-VF*exp(-t/T3)*(cos(w3*t)+(sin(w3*t)/(w3*T3)));
iD(t) = gfs*VF-gfs*VF*exp(-t/T3)*(cos(w3*t)+sin(w3*t)/(w3*T3));
vD(t) = V_D-gfs*w3*Ll*VF*exp(-t/T3)*(1+(1/((w3^2)*(T3^2))))*sin(w3*t);
solt = double(solve(iD(t) == I0, t));
solt1 = double(solve(vD(t) == iD(t)*RDS_ON, t));
if(solt < solt1)
Time2 = solt;
VDp = vD(solt);
else
Time2 = solt1;
IDp = iD(solt1);
end
end
3 Comments
Walter Roberson
on 22 Aug 2018
solt1 appears to have no real-valued solutions. V_D would have to be smaller for a solution. Roughly 8.9 at most, it looks to me.
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!