(* ZDE ZAČÍNÁ 1.CVIČENÍ 22.2.2017*)
(* takto vypadá komentář *)
1+1

(Sqrt[2])

N[(Sqrt[2])]

(Sqrt[8])

(Sqrt[8.])

(124/36)

(2^5)

αβγ
Sin[(π/5.)]

Pi

N[E]

I

((a+b)*(a-b)+1)

{1,2,3}*{a,b,c}

{1,2,3}.{a,b,c}

{1,2,3} {a,b,c}

a=3

a

a+2

a+b

fakulta je excelentna

fakulta*je*excelentna

napeti1

1napeti

?=

a=5+6

a:=5+6

a

a=Random[]

?a

{a,a,a}

a:=Random[]

?a

{a,a,a}

ClearAll[a]

a=5+6;

b=a*(∫_1^x)((Sin[x])/x)\[DifferentialD]x

b/.x->1.5

reseni=Solve[(x^2)+4x-16==0,x]

reseni[[1,1]]

x/.reseni[[1,1]]

5==4x

ClearAll[a]
ClearAll[b]

Solve[a*(x^2)+b*x+c==0,x]

Sin[π]

π//Sin

Sin@π

(*Tu je text komentara*)

Plot[{100*Sin[x],100*Tanh[100*Sin[x]]},{x,0,8π},AxesLabel->{"time [s]","Voltage1 [V]
Voltage2 [V]"},PlotStyle->{{Blue,Thick},{Red,Dashed}}]

??Plot

(* ZDE ZAČÍNÁ 2.CVIČENÍ 1.3.2017*)

funkce={20*Sin[(x^2)],Sinh[Tan[2x]]};
graf=Plot[funkce,{x,0,5},PlotRange->{{0,5},{-30,60}},PlotStyle->{{Orange,Thick},{Purple,Dashed}},PlotLabel->"Uloha za bonusove body",AxesLabel->{"x","20*Sin[(x^2)]
Sinh[Tan[2*x]"},Mesh->30,MeshStyle->Black,ImageSize->300]

SetDirectory[NotebookDirectory[]]

Export["Bonusovy graf.png",graf,ImageResolution->600]

Plot[funkce,{x,0,5},PlotRange->{{0,5},{-30,60}},PlotStyle->{{Orange,Thick},{Purple,Dashed}},PlotLabel->"Uloha za bonusove body",AxesLabel->{"x","f(x)"},Mesh->30,MeshStyle->Black,ImageSize->300,AxesOrigin->{0,-30},GridLines->Automatic,PlotLegends->{"20*Sin[(x^2)]","Sinh[Tan[2*x]"},AxesStyle->Directive[15,Thickness[0.005]]]

funkce2={(E^(-t/0.05))Sin[314t],(E^(-t/0.05)),(E^(-t/0.025))};

graf2=Plot[funkce2,{t,0,0.2},PlotStyle->{{Black,Dashed},{Red,Thick},{Blue,DotDashed}},PlotLegends->{"(E^(-t/0.05))Sin[314t]","(E^(-t/0.05))","(E^(-t/0.025))"},AxesLabel->{"t(s)","f(t)"},PlotLabel->"Přechodový děj",GridLines->Automatic,AxesOrigin->{0,-1}]
Export["Přechodový děj.png",graf2,ImageResolution->400]

(* ZDE ZAČÍNÁ 3.CVIČENÍ 8.3.2017*)

ClearAll[f]

f[t_]:=t+Cos[t]

f/.t->{4,5,10}

f[{4,5,10}]

f2[{t_,g_}]:=g+Cos[t]

f2[5]

f2[{5,2}]

t

f3[t_]:={t+Cos[t],Sin[t]}

Plot[f3[(Sqrt[1+(t^2)])],{t,0,10Pi}]

SeedRandom[1]

data=Table[f3[(Sqrt[1+(t^2)])],{t,0,10Pi,0.5}]

f4[t_]:=Sin[t];
(*dat=Table[f4[i],{i,0,10π,0.5}] puvodni zapis*)
dat=Table[{i,f4[i]},{i,0,10π,0.5}];

{Plot[f4[x],{x,0,10π}],
ListPlot[dat]};

Show[Plot[f4[x],{x,0,10π}],ListPlot[dat],AxesLabel->{"x","f4(x)"}]

f4[a]

Manipulate[Plot[(E^((-t)/τ))*A*Sin[2*π*frekv*t+φ],{t,0,0.1},PlotRange->{{0,0.1},{-1.5,1.5}}],{τ,0.01,0.1},{A,0.5,1.5},{frekv,48,52},{φ,((-π)/2),(π/2)}]

Module[{a,b},
a=5;
b=-11*I;
{a,b,Abs[a+b],a+b}
]

FceModule[k1_,k2_]:=Module[{a,b},
a=k1*5;
b=-11*I*k2;
{a,b,Abs[a+b],a+b}
]

FceModule[1,0]

sampledata=Table[{t,(1+Random[])*10*Sin[314*t]},{t,0,0.04,(1/10000.)}];
ListPlot[sampledata];

DataProces[data_,n_]:=Module[{xka,absx,maxx,novexka,datapom},
xka=data[[All,2]];
absx=Abs[xka];
maxx=Max[absx];
novexka=(1/maxx)*xka;
datapom=data/.{a_,b_}:>{a,(b/maxx)}
(*dalsi moznosti vypoctu datapom:
--------------------------------------
datapom=Map[{((#[[1]])),((#[[2]])/maxx)}&,data];
-----------------------------------------
datapom = Table[{data[[i,1]], data[[i,2]]/maxx}, {i,1,Length[data],1}];
-----------------------------------------
res1[g_]:=(g/maxx);
datapom=data/.{a_,b_}:>{a,res1[b]};
-----------------------------------------
*);
Table[datapom[[i]],{i,1,Length[datapom],Floor[n]}]
]

DataProces[sampledata,2];

Length[sampledata];

ListLinePlot[DataProces[sampledata,1]]
ListLinePlot[DataProces[sampledata,2]]

Manipulate[ListLinePlot[DataProces[sampledata,ii]],{ii,1,20}]

(* ZDE ZAČÍNÁ 4.CVIČENÍ 15.3.2017*)

Rez={30,30,30};
par[listodpor_]:=(((Total[(listodpor^(-1))]))^(-1))
par[Rez]

par2[listodpor_]:=(((Plus@@(listodpor^(-1))))^(-1))
par2[Rez]

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

par3[Rez]

ser[listodpor_]:=Total[listodpor]

ser[Rez]

ser2[listodpor_]:=(Plus@@listodpor)

ser2[Rez]

ser3:=(Plus@@#)&

ser3[Rez]

(*prvni priklad*)

Odpory={R1->100,R2->100,R3->100,R4->100,R5->100,Uz->100,Iz->0.1};

rce={iUz+Iz==iR1+iR2+iR3,
iR3==iR5+iR4+iOut,
iR4==Iz+iUz,
uA==R2*iR2,
uA==R1*iR1,
uB==R5*iR5,
R3*iR3==uA-uB,
R4*iR4==uC-uB,
Uz==uA-uC};

rceCiselne=rce/.Odpory;

TreeForm[rceCiselne];

promenne=Cases[rceCiselne,_Symbol,{0,∞}]//Union;

nezname=DeleteCases[promenne,iOut];

{Length[rce],Length[nezname]};

N[Solve[rce,nezname]/.Odpory]//Simplify

(*druhy priklad*)

ClearAll["Global`*"];

souc={R1->1000,R2->68000,c->470*(10^(-9)),L->2.2*(10^(-6))};
frev=1000;
amp=2.5;
vst={u[t]->amp*Sin[2π*frev*t]};

rceU={iU[t]==iR1[t],iR1[t]==iC[t]+iL[t],
iL[t]==0+iR2[t]};

rceS={uA[t]-uB[t]==R1*iR1[t],uA[t]==u[t],uB[t]==c*uB'[t],uB[t]-uC[t]==L*iL'[t],uC[t]==R2*iR2[t]};