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

1+1

(Sqrt[2])

N[(Sqrt[2])]

N[(Sqrt[2]),10]

(Sqrt[(Sqrt[(Sqrt[1508])])])

(Sqrt[(Sqrt[(Sqrt[1508.])])])

(15185415/1415.)

a

a=5

a

a+b

N=5

C

I

E=85

Cos[π]

Cos[Pi]

Sin=5

(4ab+5d)*(d+5)+c

4*5

4 5

Opice=5

Opice12

12Opice

(x^2)+15x+(x^5)+(x^3)+2(x^2)

dneska je hezky

b:=5

b

c=6;

ClearAll[a]

5+10a-25(a^2)==0

c==6

c==5

Solve[5+10a-25(a^2)==0,a]

pr=Solve[(x^2)+x+1==0,x][[1,1]]

N[(Sqrt[10])]

(Sqrt[10])//N

(Sqrt[10])@N

N@(Sqrt[10])

ClearAll[b,c]

{1,8,5}*{a,b,c}

{a,8 b,5 c}
{1,8,5}{a,b,c}

{1,8,5}\[Cross]{a,b,c}

list={4,5,{2,8,6},5.8}

NestList[x,f[]x,4];

list[[3,2]]

list[[4]]=6

list

list[[3]]={hodina1,hodina2}

list

Plot[100Sin[x],{x,0,30}];

t=5

Plot[{100Sin[x],100Tanh[100Sin[x]]},{x,0,30},AxesLabel->{"t (ms)","U(V) A(mA)"},PlotStyle->{{Thick,Dashed,Green},{Thin,Red}}]

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

ClearAll[a]

int=∫a*((Sin[(x^2)])/x)\[DifferentialD]x

int

?=

int/.x->5

nuse=5*hrusky+3*jablko+2*svestka

nuse/.svestka->5

nuse

nuse/.{svestka->5,jablko->1,hrusky->2}

nuse/.svestka->{1,2,3}

nuse

promenou = {Sin[x],Sin[(x^2)],Sin[(x^3)]}

promenou/.x->2

promenou2={{Sin[x]},{Sin[(x^2)],Sin[(x^3)]}}

promenou2[[1,1]]/.x->2

TreeForm[promenou2]

ClearAll[funkce,x]

funkce={20*Sin[(x^2)],Sinh[Tan[2x]]};

obrazek=Plot[funkce,{x,0,5},PlotStyle->{{Green,Thick},{Red,DotDashed}},PlotLabel->"Muj graf",AxesLabel->{"x","f1(x)
f2(x)"},PlotRange->{Automatic,{-60,60}},AxesOrigin->{0,-60},GridLines->{{2,4},Automatic},AxesStyle->Directive[15,Thickness[0.005]],PlotLegends->{"20*Sin((x^2))","Sinh(Tan(2x))"},ImageSize->300]

NotebookDirectory[]

SetDirectory[NotebookDirectory[]]

Export["Obrazek1.png",obrazek,ImageResolution->400]

ClearAll[t]

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

obrazek2=Plot[funkce2,{t,0,0.2},PlotStyle->{{Magenta,Thick},{Orange,Dotted},{Green,Dashed,Thickness[0.005]}},PlotLegends->{"(E^(-t/0.05))Sin[314t]","(E^(-t/0.05))","(E^(-t/0.025))"},AxesLabel->{"t(s)","f(t)"},PlotLabel->"Útlum",GridLines->Automatic,AxesOrigin->{0,-1},AxesStyle->Directive[12,Thickness[0.005]],Mesh->30,MeshStyle->{Black}]

Export["Obrazek2.png",obrazek2,ImageResolution->300]

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

ClearAll[f]

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

f1[{5.,4.,3.}]

(* nefunkcni zapis: f/.t->5 *)

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

f[5.]

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

f2[r_]:=Sin[r]

data=Table[f2[(Sqrt[1+(d^2)])],{d,0,10π,0.5}];

(* data nesedi se spojitou funkci - nutno upravit - chyba v ose x*)

Show[ListPlot[data],
Plot[f2[t],{t,0,10Pi}]]

data2=Table[{d,f2[(Sqrt[1+(d^2)])]},{d,0,10Pi,0.5}];

Show[ListPlot[data2],
Plot[f2[t],{t,0,10Pi}]]

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

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

fceModule[u1_,u2_]:=Module[{a,b,c,d},
a=u1*5;
b=-11*I*u2;
{c=a+b,d=a-b}]

c2=fceModule[5,1]

SeedRandom[1]

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

sampleData[[All,2]];

ListPlot[sampleData]

dataProc[data_]:=Module[{u,uAbs,uMax,uPom,dataPom},
u=data[[All,2]];
uAbs=Abs[u];
uMax=Max[uAbs];
uPom=u/uMax;
dataPom=data/.{a_,b_}:>{a,b/uMax} (*prvni zpusob*);
Table[dataPom[[i]],{i,1,Length[dataPom],5}]
]

dataProc[sampleData];

ListPlot[dataProc[sampleData]]

ListLinePlot[dataProc[sampleData]]

Show[ListPlot[dataProc[sampleData]],ListLinePlot[dataProc[sampleData]]]

(* ZDE ZAČÍNÁ 4.CVIČENÍ 17.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]

Rez2={R1->10,R2->10,R3->10,R4->10,R5->10,R6->10};

obvod=N[par[{ser[{par[{R5,R6}],R1}],R2,ser[{R3,R4}]}]/.Rez2]

(*metoda uzlovych napeti - prvni priklad*)

R1=100

R1

ClearAll["R1","iz","uz"]

Zadani={R1->100,R2->100,R3->100,R4->100,R5->100,uz->100,iz->0.1};

rce={iz+iuz==iR1+iR2+iR3,iR3+iR4==iOut+iR5,
0==iuz+iz+iR4,
uA==R1*iR1,
uA==R2*iR2,
uB==R5*iR5,
iR3*R3==uA-uB,
iR4*R4==uC-uB,
uz==uA-uC};

rceCiselne=rce/.Zadani

TreeForm[rceCiselne];

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

nezname=DeleteCases[promenne,iOut]

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

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

(*metoda uzlovych napeti - druhy priklad*)

ClearAll["Global`*"]

souc={R1->1000,R2->68000,c->470*(10^(-9)),L->2.2*(10^(-6))};

frek=1000;
amp=2.5;
vst={u[t]->amp*Sin[2π*frek*t]};

per=1/frek;
tmax=5*per;

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

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

rovnice=Union[rceS,rceU,poc];

rceDos=(rovnice/.souc)/.vst;

neznam=Cases[rceDos,_Symbol[t],{0,Infinity}]//Union

reseni=NDSolve[rceDos,neznam,{t,0,tmax}];

Plot[uC[t]/.reseni,{t,0,tmax}]