1+1

(Sqrt[5.])

N[(Sqrt[5]),3]

n[(Sqrt[5])]

(5^2)+(Sqrt[(5/6)])

Sin[Pi]

sin[Pi]

sin=Cos

sin[π]

LaplaceTransform[x^2*Cos[2x],x,s]

((2 (-12 s+(s^3)))/(((4+(s^2)))^3))o

int=Integrate[(E^(-((2Pi)/3)x)),x];

Plot[int,{x,0,10}]

int

in222=Integrate[(E^(-((2Pi)/3)x)),x]

2222integ=Integrate[(E^(-((2Pi)/3)x)),x]

int
in t

a*b

int*Sin[2t]

ClearAll[int]

{{a,b},c,{d,e}}[[3]]

prom=Solve[(x^2)+y+4==0&&x+y+15==0,{x,y}]

res=DSolve[{y''[t]+4y'[t]-y[t]==(E^(-2t)) Cos[t],y'[0]==1,y[0]==0},y[t],t]

?==

?DSolve

Plot[y[t]/.res,{t,-5,5}]

DSolve[y''[t]+4y'[t]-y[t]==(E^(-2t)) Cos[t]&&y'[0]==1&&y[0]==0,y[t],t];

DSolve[{y''[t]+4y'[t]-y[t]==(E^(-2t)) Cos[t],y'[0]==1,y[0]==0},y[t],t];

fce=Cos[x*Sin[x*y]];

Plot3D[fce,{x,-4,4},{y,-4,4}]

N[3Pi](*predpis pro funkci*)
3Pi//N (*jiny predpis*)
N@3Pi

(*Zde zacina 2 cviko*)

x=tygrik;
Plot[Cos[x],{x,0,3Pi},AxesLabel->{"x","Cos[x]"}]

??Plot

Plot[{Cos[x],Sin[x]},{x,0,3Pi},AxesLabel->{"x","Cos[x],Sin[x]"},PlotStyle->{{Red,Thickness[0.01]},{Blue,Dashing[{0.01,0.02,0.03}]}}]

Red

graf1=Plot[{Sec[x],Csc[x]},{x,0,10},AxesLabel->{"x","Sec[x],Csc[x]"},PlotStyle->{Green,Magenta},PlotRange->{{0,10},{-50,50}},GridLines->Automatic]

graf1//FullForm;

NotebookDirectory[]

SetDirectory[NotebookDirectory[]]

Export["graf.jpg",graf1,ImageResolution->300]
Export["graf.png",graf1,ImageResolution->300]

%77

$HistoryLength=2

%30

graf2=Plot[{Tanh[x],ArcTanh[x],x},{x,-5,5},PlotRange->{Automatic,{-3,3}},PlotStyle->{{Red,Dashed,Thick},{Blue,Dashed},{Brown,Thick}},GridLines->Automatic,AxesLabel->{"x","Tanh[x],ArcTanh[x],x"}]

Export["graf2.png",graf2,ImageResolution->300]

x=4;
Plot[Sin[x],{x,0,2Pi}]

x=4;
Sin[x]//N
Plot[Evaluate[Sin[x]],{x,0,2Pi}]

n0=(10^7);
τ=0.1;

ClearAll[n]
Off[Solve::ifun]
par=t/.Solve[n==n0*(2^(-(t/τ))),t][[1]]

Plot[par,{n,0,5}]

n==n0*(2^(-(t/τ)))

?/.

ClearAll[x,y,t]

rov={x,y}/.Solve[{x+2*y==3*t,5*x-y==(t^2)-t},{x,y}][[1]]

Plot[rov,{t,-5,5}]

(*Zde zacina treti cviko*)

Solve[Cos[x]==0,x]

FindRoot[Cos[x]==1,{x,6}]

x=5

ClearAll[f]
f[x_]:=(x^3)+2(x^2)-(Sqrt[5])

f[4]

f[x_]=(x^3)+2(x^2)-(Sqrt[5])

Plot[f[a],{a,0,10}]

vyr=Abs[((R+I*ω*L*(1/(I*ω*C1)))/(R+I*ω*L+(1/(I*ω*C1))))]/.{R->10,L->0.002,C1->2*(10^(-6))};

LogLogPlot[vyr,{ω,(10^(-1)),(10^10)},GridLines->Automatic,AxesLabel->{"ω","Abs Z"},PlotStyle->Thick]

fce[R_,L_,C1_,ω_]:=Abs[((R+I*ω*L*(1/(I*ω*C1)))/(R+I*ω*L+(1/(I*ω*C1))))]

fce[10,0.002,2*(10^(-6)),ω];

LogLogPlot[fce[10,0.002,2*(10^(-6)),ω],{ω,(10^(-1)),(10^10)}];

vyr;

Manipulate[
vyr=Abs[((R+I*ω*L*(1/(I*ω*C1)))/(R+I*ω*L+(1/(I*ω*C1))))]/.{L->0.002,C1->2*(10^(-6))};
LogLogPlot[vyr,{ω,(10^(-1)),(10^10)},GridLines->Automatic,AxesLabel->{"ω","Abs Z"},PlotStyle->Thick,PlotRange->{Automatic,{(10^(-5)),1000}}]

,{R,1,1000}]

Manipulate[Plot[a*Cos[b*t+c],{t,0,2*π},PlotRange->{Automatic,{-5,5}}],{a,1,5,0.2},{b,1,5,0.2},{c,1,5,0.2}]

Total[{a,b,3}]

par[list_]:=((Total[(list^(-1))])^(-1))

par[{R1,R2,R3}]

par2[list_]:=(((Plus@@(list^(-1))))^(-1))

par2[{R1,R2,R3}]

par3:=(((Plus@@((#)^(-1))))^(-1))&

par3[{R1,R2,R3}]

ser[list_]:=Total[list]

ser[{R1,R2,R3}]

ser2[list_]:=Plus@@list

ser2[{R1,R2,R3}]

R2=ser[{R,R}];

R1=ser[{R,par[{R,R}]}];

Rtot=par[{R1,R2}]

(*Zde zacina ctvrte cviko*)

ser[list_]:=Total[list]
par[list_]:=((Total[(list^(-1))])^(-1))

ser[{R,par[{ser[{R,par[{R,R,R}],R}],ser[{R,R}]}]}]

R1=R2=R3=100;
UZ=10;
IZ=0.5;
rce={R1*IR1==U2-U1,R2*IR2==U3-U2,R3*IR3==U3,U1==-UZ,IR2==IR1,IR1==IZ+IU,IZ==IR2+IR3+IOUT};
Solve[rce,{U1,U2,U3,IR1,IR2,IR3,IU}]

UZ=230*Sin[314t+(Pi/2)];
IZ=0.1*Sin[314t];
C1=C2=C3=(10^(-6));
L1=L2=0.2;
R1=R2=R3=R4=200;
tmax=0.1;
rceSoucastky={R1*iR1[t]==u1[t]-u5[t],R2*iR2[t]==u5[t]-u3[t],R3*iR3[t]==u2[t]-u1[t],R4*iR4[t]==u4[t],D[UZ==u1[t],t],u4[t]-u3[t]==L1*iL1'[t],u3[t]-u2[t]==L2*iL2'[t],iC1[t]==C1*u5'[t],uC2[t]==u5[t]-u4[t],iC2[t]==C2*uC2'[t],iC3[t]==C3*u3'[t]};
rceUzly={iR3[t]==IUZ[t]+iR1[t],iL2[t]==iR3[t],iL1[t]+iR2[t]==iL2[t]+iC3[t],iC2[t]==iL1[t]+iR4[t],iR1[t]+IZ==iC1[t]+iC2[t]+iR2[t]};
pocPodm={u3[0]==0,uC2[0]==0,u5[0]==0,iL1[0]==0,iL2[0]==0,u1[0]==0};
rceVse=Union[rceSoucastky,rceUzly,pocPodm];
nezname=Union[Cases[rceVse,_Symbol[t],{0,∞}]];

res=NDSolve[rceVse,nezname,{t,0,tmax}];

Plot[{UZ,u5[t]-u4[t]/.res},{t,0,tmax},PlotStyle->{{Black,Thick},{Blue,Thick}},GridLines->Automatic,AxesLabel->{"t (s)","U (V)"},PlotLabel->"(Subscript[u, Z])(t)    (Subscript[u, L1])(t)  "]
Plot[{IZ,iL1[t]/.res},{t,0,tmax},PlotStyle->{{Black,Thick},{Red,Thick}},GridLines->Automatic,AxesLabel->{"t (s)","I (V)"},PlotLabel->"(Subscript[u, Z])(t)    (Subscript[i, L1])(t)  "]

(*Zde zacina ctvrte cviko*)

list=Table[(x^i),{i,5,30,5}]//MatrixForm

list2=Table[i+j,{i,1,4,1},{j,1,4,1}]//MatrixForm

Table[Prime[5*(x-1)+y],{x,1,5,1},{y,1,5,1}]//MatrixForm

SetDirectory[NotebookDirectory[]]

data=Import["scope_7.csv"];

data2=Cases[data,{_Real,_Real,_Real,_Real}];

ProudVCase=data2/.{t_,U1_,i_,U2_}:>{t,i};

ListPlot[ProudVCase]

?:>

n=Length[data2]

intI=Interpolation[ProudVCase]
{tmin,tmax}=intI[[1,1]];
Plot[intI[t],{t,tmin,tmax}]

intI[[1,1]]

(5+I)[[0]]

ProudVCaseVyhl=MovingAverage[ProudVCase,200];
ListPlot[ProudVCase]
ListPlot[ProudVCaseVyhl]
intIVyhl=Interpolation[ProudVCaseVyhl];
{tmin,tmax}=intIVyhl[[1,1]];
Plot[intIVyhl[t],{t,tmin,tmax}]

prumPrevod=Mean[data2/.{t_,U1_,i_,U2_}:>(U2/U1)];
Print["Převod je: ",prumPrevod]

(*Co jsme nestihli minule*)

SetDirectory[NotebookDirectory[]];
data=Import["scope_7.csv"];
data2=Cases[data,{_Real,_Real,_Real,_Real}];
NapetiVCase=data2/.{t_,U1_,i_,U2_}:>{t,U1};
NapetiVCaseVyhl=MovingAverage[1NapetiVCase,100];
intUVyhl=Interpolation[NapetiVCaseVyhl];
{tmin,tmax}=intUVyhl[[1,1]];
Plot[intUVyhl[t],{t,tmin,tmax},AxesOrigin->{tmin,0},AxesLabel->{"t (s)","U1 (V)"}]

UZ=intUVyhl[t];

R1=10;
R2=100;
R3=50;
R4=30;
L1=0.5;
L2=0.1;
C1=1*(10^(-3));

rceProudy={0==IR1[t]+IUZ[t],IUZ[t]==IR2[t]+IL1[t],IL1[t]==IC1[t]+IR4[t],IR3[t]+IC1[t]==IL2[t],IR2[t]==IR3[t],UZ==U2[t]-U1[t]};
rceSoucastky={U1[t]==R1*IR1[t],U2[t]-U5[t]==R2*IR2[t],U5[t]-U4[t]==R3*IR3[t],U3[t]==IR4[t]*R4,U2[t]-U3[t]==L1*IL1'[t],U4[t]==L2*IL2'[t],IC1[t]==C1*UC1'[t],UC1[t]==U3[t]-U4[t]};
pocPodminky={IL1[tmin]==0,IL2[tmin]==0,UC1[tmin]==0};
rceVse=Union[rceProudy,rceSoucastky,pocPodminky];
nezname=Union[Cases[rceVse,_Symbol[t],{0,∞}]];

res=NDSolve[rceVse,nezname,{t,tmin,tmax},StartingStepSize->(10^(-15)),MaxSteps->(10^8)]

Plot[{UZ,10UC1[t]/.res,(U2[t]-U3[t])/.res,U4[t]/.res},{t,tmin,tmax},PlotStyle->{{Black,Thick},{Blue,Thick},{Red,Thick},{Green,Thick}}, AxesLabel->{"t","Uz 10·Uc UL1 UL2 (V)"},GridLines->Automatic,PlotRange->All,AxesOrigin->{tmin,0}]

(*Zde zacina 6. cviko*)

ClearAll[par,ser];
par[list_]:=(((Plus@@(list^(-1))))^(-1))
ser[list_]:=Plus@@list

μF=(10^(-6));
R=100;
c=2μF;
L=0.1;

(*C=2*)(*nelze pouzit velke C je protected*)

j=I;

z1=par[{j*ω*L,ser[{R,(1/(j*ω*c))}]}];
z2=ser[{R,(1/(j*ω*c))}];

(1/I)

prenos=(z2/(z1+z2))

LogLogPlot[Abs[prenos],{ω,(10^(-4)),(10^8)},PlotRange->All,GridLines->Automatic,PlotStyle->{Red,Thick},AxesLabel->{"ω [(s^(-1))]","Abs[prenos] [-]"}]

LogLogPlot[Abs[z2],{ω,(10^(-4)),(10^8)},PlotRange->All,GridLines->Automatic,PlotStyle->{Red,Thick}]

μF=μH=(10^(-6));
pF=(10^(-12));
mF=mH=(10^(-3));
R1=100;
R2=20;
R3=500;
L1=1mH;
L2=2μH;
L3=1;
C1=10pF;
C2=2μF;
C3=10mF;
za=par[{R1,ser[{j*ω*L1,R1}]}];
zb=par[{(1/(j*ω*C2)),R2,ser[{(1/(j*ω*C2)),par[{R2,j*ω*L2}]}]}];
z1=ser[{za,(1/(j*ω*C1)),zb}];
z2=ser[{par[{j*ω*L3,R3}],(1/(j*ω*C3))}];
prenos=(z2/(z1+z2));

Print["Prenos je ",Abs[prenos/.ω->600.], " pro ω= 600 (s^(-1))"]
LogLogPlot[Abs[prenos],{ω,(10^(-4)),(10^12)},PlotRange->All,GridLines->Automatic,PlotStyle->{Magenta,Thick,Dashed},AxesLabel->{"ω [(s^(-1))]","Abs[prenos] [-]"}]

iz=0.5*Sin[ω*t+0.9]
0.5*(E^(j*0.9))

IZ=iz/.a_*Sin[b_*t+c_]:>a*(E^(I*c))

Im[IZ*(E^(I*ω*t))]
ComplexExpand[Im[IZ*(E^(I*ω*t))]]//TrigFactor//Chop

R1=R2=1.;
R3=R4=2*(10^3);
L1=0.1*(10^(-3));
c1=c2=5*(10^(-6));
z1=ser[{R1,par[{I*ω*L1,ser[{R1,(1/(I*ω*c1))}]}]}];
z2=ser[{I*ω*L1,par[{ser[{R4,(1/(I*ω*c2))}],R3,ser[{R2,I*ω*L1}]}]}];

prenos=(z2/(z1+z2));

LogLogPlot[Abs[prenos],{ω,(10^(-4)),(10^12)},PlotRange->All,GridLines->Automatic,PlotStyle->{Magenta,Thick,Dashed},AxesLabel->{"ω [(s^(-1))]","Abs[prenos] [-]"}]

(*Zde zacina 8. cviceni*)

SetDirectory[NotebookDirectory[]];
data=Import["dat.csv"];
pl2=ListPlot[data];
polynom1={1,x,(x^2),(x^3)};
polynom2=Table[(x^i),{i,0,3}];
proFit=Fit[data,polynom2,x];
pl1=Plot[proFit,{x,data[[1,1]],data[[-1,1]]},PlotStyle->{Thick,Red},AxesLabel->{"x","y"}];
Show[pl1,pl2]

R=100;
L=0.5;
c=3*(10^(-6));
f=50;
ω0=2*Pi*f;
T=(1/f);

Z[ω_]:=R+I*ω*L+(1/(I*ω*c))
U1=10*(E^(I*0.5));
U2=2*(E^(I(-0.3)));

I1=(U1/(Z[ω0]))
I2=(U2/(Z[5*ω0]))

doCasu[fazor_,ω_]:=Im[fazor*(E^(I*ω*t))]

Cas1=doCasu[I1,ω0];
Cas2=doCasu[I2,5*ω0];

Soucet=Cas1+Cas2

Plot[{Soucet},{t,0,T},PlotStyle->{Thick}]

i[t_]=ComplexExpand[Soucet]

U1=10*(E^(I*0.5));
U2=2*(E^(I(-0.3)));

u[t_]:=10*Sin[ω0*t+0.5]+2*Sin[5*ω0*t-0.3]

tabulka=Table[{i[t],i'[t],i''[t],u'[t]},{t,0,T,(T/100)}];
Fit[tabulka,{i1[t],i1'[t],i1''[t]},{i1[t],i1'[t],i1''[t]}]