Problem with solve and syms variable
이전 댓글 표시
Hi, I'm fairly new (and bad) with MATLAB script. I'm trying to build a program to compute MOSFET power losses on each commutation interval. So what I want to do is just input some constants and MATLAB solves the power losses for me and the time taken by each interval. This is where I have some problems. I am trying to use the function solve to solve a simple 1 equation and 1 variable system for the first interval. The code is the following:
if true
% %CONSTANTE DU CIRCUIT À DÉTERMINER
V_DR_m = 0; %Tension d'attaque minimale de la gate du MOSFET
V_DR_p = 15; %Tension d'attaque maximale de la gate du MOSFET
Rg = 5; %Résistance connectée à la gate du MOSFET
%
%CONSTANTE DU MOSFET À DÉTERMINER
Rg_FET = 5; %Résistance parasite de la gate de MOSFET
Cdg = 100*10^(-12); %Capacitance de Miller Drain-Gate du MOSFET
Cgs = 2000*10^(-12); %Capacitance de Miller Gate-Source du MOSFET
VT = 6; %Tension de mise en conduction du MOSFET (threshold)
%
%VARIABLES DU CIRCUIT
syms t %Temps
var vGS %Tension Gate-Source du MOSFET en fonction du temps
%
%--------------INTERVALLES DU TURN ON--------------
%INTERVALLE 1
%Mise à ON du gate driver. Intervalle se terminant lorsque
%la tension de gate atteint la tension de mise en conduction
%du MOSFET VT.
R_DR = Rg_FET+Rg;
tauG = R_DR*(Cdg+Cgs);
vGS = ((V_DR_m-V_DR_p)*exp(-t/tauG))+V_DR_p;
solt = solve(vGS == VT, t);
%
end
And when I run the program, not only there is nothing in all the variables defined as syms, but ans also gives the answer 596.3333 which I have no clue at all where it is from. The values of solt, t and vGS are all specified as 1x1 sym and when I click on them, there is nothing in what I suppose should be a 1x1 array containing my solve's answer. I haven't seen any code differences compared to some other simple solve function on the internet. Also the answer to t should be t=10.7273e-9. Also, ignore the french comments. They are only there to explain how the commutation intervals of the MOSFET work. Thank you very much in advance.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!