Dioda

ClearAll["Global`*"];

Příklad nelineární charakteristiky

i[u_]:=0.01(0.4*u+0.01(u^3));
Plot[i[u],{u,-15,15},PlotStyle->Thick,AxesLabel->{"U[V]","I[A]"}]

uHUS=10*Sin[ω*t+0.4];
i[uHUS]
Chop[%//TrigReduce]

Ukázka idealizované charakteristiky diody

Zadefinujeme rovnici idealizované diody (závislost proudu diodou na napětí mezi svorkami diody)

(*iD[uD_]:=(10^(-7))*(Exp[19*uD]-1);*)
iD[uD_]:=(10^(-7))*((E^(19uD))-1)

Vykreslíme závislost iD(uD) na intervalu -1≤uD≤1.

Plot[iD[uD],{uD,-1,1},PlotRange->{Automatic,{-0.1,3}},PlotStyle->Thick,AxesLabel->{"uD[V]","iD[A]"}]

Vykreslíme tutéž závislost iD(uD) na intervalu -1≤uD≤0,1.

Plot[iD[uD],{uD,-1,0.1},PlotRange->All,PlotStyle->Thick,AxesLabel->{"uD[V]","iD[A]"}]

Usměrňovač

Zadání obvodu - hodnoty součástek a vstupu

L1=100;
L2=0.04;
M=0.999*(Sqrt[L1*L2]);
R1=.5;
R2=100;
c=(10^(-3));
ω=314;
T=2*(Pi/ω);
uz=230*(Sqrt[2])*Sin[ω*t];

Popis obvodu

induktory={uz==L1*i1'[t]+M*i2'[t],u1[t]==L2*i2'[t]+M*i1'[t]};
uzel1={0==i2[t]+((u1[t]-u2[t])/R1)};
uzel2=D[{((u1[t]-u2[t])/R1)==iD[u2[t]-u3[t]]},t];
uzel3={iD[u2[t]-u3[t]]==c*u3'[t]+((u3[t])/R2)};
pocs={i1[0]==0,i2[0]==0,u3[0]==0,u1[0]==0,u2[0]==0,u3[0]==0};
dohr=Union[induktory,uzel1,uzel2,uzel3,pocs];

Řešení

nezname=Cases[dohr,_[t],{0,∞}]/.a_'[t]:>a//Union;
tmax=5T;
res=NDSolve[dohr,nezname,{t,0,tmax},StartingStepSize->(10^(-6))*T,MaxSteps->(10^6)][[1]];

Zobrazení výsledků

Plot[u3[t]/.res,{t,0,tmax},PlotRange->All,PlotRange->All,PlotStyle->Thick,AxesLabel->{"t[s]","u3[V]"}]

Manipulate[
c=Exp[kC]*(10^(-6));
ω=314;
T=2*(Pi/ω);
uz=230*(Sqrt[2])*Sin[ω*t];
induktory={uz==L1*i1'[t]+M*i2'[t],u1[t]==L2*i2'[t]+M*i1'[t]};
uzel1={0==i2[t]+((u1[t]-u2[t])/R1)};
uzel2=D[{((u1[t]-u2[t])/R1)==iD[u2[t]-u3[t]]},t];
uzel3={iD[u2[t]-u3[t]]==c*u3'[t]+((u3[t])/R2)};
pocs={i1[0]==0,i2[0]==0,u3[0]==0,u1[0]==0,u2[0]==0,u3[0]==0};
dohr=Union[induktory,uzel1,uzel2,uzel3,pocs];
nezname=Cases[dohr,_[t],{0,∞}]/.a_'[t]:>a//Union;
tmax=10T;
res=NDSolve[dohr,nezname,{t,0,tmax},StartingStepSize->(10^(-6))*T,MaxSteps->(10^6)][[1]];
Plot[u3[t]/.res,{t,0,tmax},PlotRange->All,PlotRange->{Automatic,{0,6}},PlotStyle->Thick,AxesLabel->{"t[s]","u3[V]"}],{kC,0,10}]

Linearizace

Rz=1;
ClearAll[uzL];
uzL[t_]:=3+1*Sin[ω*t];
pr={Automatic,{0,2}};
plDioda=ParametricPlot[{iD[ud],ud},{ud,0,1.05},PlotStyle->{GrayLevel[0],Thick},AxesLabel->{"i[A]","u[V]"},PlotRange->pr];
pl[t_]:=Plot[uzL[t]-Rz*iz,{iz,0,((uzL[t])/Rz)},PlotStyle->{Hue[0],Thick},AxesLabel->{"i[A]","u[V]"},PlotRange->pr]
Manipulate[Show[plDioda,pl[t]],{t,0,T}]
rce[t_]:=((uzL[t]-ud)/Rz)==iD[ud];
uD[t_]:=ud/.FindRoot[rce[t],{ud,0.7}];
plNelin=Plot[uD[t],{t,0,T},PlotRange->{Automatic,{0.84,0.93}},AxesLabel->{"t[s]","uD[V],uDLin[V]"},PlotStyle->{GrayLevel[0],Thick}];
uD0=uD[0];
iD0=iD[uD0];
Print["Pracovni bod je  uD0= ",uD0," V","   iD0= ",iD0," A"]
linRce=id==Simplify[Normal[Series[iD[ud],{ud,uD0,1}]]];
Print["nahrada iD: ",linRce]
Print["nahrada uD: ",Simplify[(ud/.Solve[linRce,ud][[1]])==ud]]

rceLin={((uzL[t]-ud)/Rz)==id,linRce}
udLin=ud/.Solve[rceLin,{ud,id}][[1]]
plLin=Plot[udLin,{t,0,T},PlotRange->{Automatic,{0.84,0.93}},AxesLabel->{"t[s]","uD[V],uDLin[V]"},PlotStyle->{Hue[0],Thick}];
Show[plLin,plNelin]