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.

 채택된 답변

Stephan
Stephan 2018년 8월 20일
편집: Stephan 2018년 8월 20일

0 개 추천

Hi,
use:
syms t
and
solt = double(solve(vGS == VT, t));
instead of:
syms t
var vGS
and
solt = solve(vGS == VT, t);
Then you get the desired result.
Regarding the 596.3333 result i am not sure what exactly happens, but in this context var is definetly not correct, since it is the variance function. If you want to declare vGS as a function of t, use:
syms vGS(t)
I guess that you wanted to do this.
Best regards
Stephan

댓글 수: 1

Hi Stephan, Thank you very much, that solved my problem! Thank you for quick answer too!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품

릴리스

R2017b

태그

Community Treasure Hunt

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

Start Hunting!

Translated by