(*cviko 16:15 Libor Straka*)

8+9+b

b=99;

(* komentář
ctrl+2 (Sqrt[\[Placeholder]])
ctrl+/ (\[Placeholder]/\[Placeholder])
ctrl+6 (x^\[Placeholder])
 *)

Cos[4]
Cos[4.]
(* 4-Integer, 4.-Real *)

cos[4.] (* chyba *)

N[Cos[5]]

(* ruzne volani funkce *)

N[Cos[5]];
N@Cos[5];
Cos[5]//N;

N[Pi]
N[Pi,20]

(* esc pi esc *)

ClearAll[π]
π=22

ClearAll[b]

b=Vul;

b

N[1/70]

funkce=(1+(z^2))*Sin[2*z];

aaa12;
12aaa;

x=Vul

Plot[funkce,{z,0,15}];
Plot[(1+(z^2))*Sin[2*z],{z,0,15},PlotStyle->{Red,Thick},AxesLabel->{"x","fce[x]"}]

ClearAll[x]

Int=Integrate[(x^12)*Cos[x],x];

Plot[Int,{x,-10,10},PlotRange->All]

FindRoot[(E^(2*x))==Sin[3*x],{x,0}]

(* zde zacina druhe cviceni *)

ClearAll["Global`*"]
g[y_]:=(y^3)*Sin[(y/2)]+(y^2)
Plot[{g[t],g[(Sqrt[t])]},{t,0,2π},PlotStyle->{{Thick,Blue},{Thick,Magenta}},AxesLabel->{"t","g[t],g[(Sqrt[t])]"},GridLines->Automatic,ImageSize->150]

?:=

t=105;

ClearAll["Global`*"]
Funkce[t_,nx_,ny_]:={Sin[nx*t],Cos[ny*t]}

Funkce[1,2,10];

Manipulate[

ParametricPlot[Funkce[t,nx,ny],{t,0,5π},ImageSize->150]

,{nx,1,5},{ny,1,5}
]

ClearAll["Global`*"]
f[k_]:=(k^3)*Sin[((4*k)/(k^2))]
Dvojice=Table[{k,f[k]},{k,1,40}];
Manipulate[ListPlot[Dvojice,PlotStyle->{PointSize[x],Hue[y]}],{x,0.005,0.08},{y,0,1}]

Graf1=ListPlot[Dvojice,PlotStyle->{PointSize[0.02],Red}];
Graf2=Plot[f[t],{t,0,40}];
Show[Graf1,Graf2]

ClearAll[Vyraz]
Vyraz=Sin[x]+Cos[x];
Taylor=Series[Vyraz,{x,0,10}]//Normal;
Plot[{Vyraz,Taylor},{x,0,2π}]

a*b*c-(d/5)//FullForm
a*b*c-(d/5)//TreeForm

Dvojice[[1]]//TreeForm;
Dvojice[[1,2]];
Dvojice[[All,2]];

Mnoz={a,{b,c},dd,k};
Mnoz[[3]];

Solve[3(x^2)+5*x+2==0,x]

(* 3. cviceni 5.3.19*)

ClearAll["Global`*"]

ResKvadrRov[a_,b_,c_]:=Module[
{diskr,Koren1,Koren2},
diskr=(b^2)-4*a*c;
Koren1=((-b+(Sqrt[diskr]))/(2*a));
Koren2=((-b-(Sqrt[diskr]))/(2*a));
If[diskr<0,"Koreny jsou Im",N[{Koren1,Koren1}]]
]

diskr=Opice*12;

%

?diskr

ResKvadrRov[1,20,5]

dat=Table[{i,Sin[5*i]},{i,1,5,π/100}];
ListPlot[%,PlotStyle->{Red,PointSize[0.02]},AxesLabel->{"i","sin(5i)"}]

?/.

{jablko,pomeranc,hruska,slon}/.slon->kapusta

mnozina={jablko,pomeranc,hruska,slon,{mrkev,{zajic}}};
TreeForm[mnozina]
mnozina[[5,1]]

ClearAll["Global`*"]

rovnice=Solve[{x+a==30*y,(y^2)+x==5+a},{x,y}];

X1=x/.rovnice[[1]];
X2=x/.rovnice[[2]];
Y1=y/.rovnice[[1]];
Y2=y/.rovnice[[2]];

Plot[X1,{a,-10,10}]

ClearAll["Global`*"]

Rov={D[y[t],t]==((Cos[t])/(1+((y[t])^2))),y[0]==0};
Reseni=NDSolve[Rov,{y[t],D[y[t],t]},{t,0,15}];
Ypsilon=y[t]/.Reseni;
YpsilonDer=D[y[t],t]/.Reseni;

Plot[{Ypsilon,YpsilonDer},{t,0,15},PlotStyle->{{Thick,Green},{Thick,Blue,Dashed}},AxesLabel->{"t","y(t), y'(t)"},GridLines->Automatic]

(* ctvrte cviceni 12.3.19 *)

ClearAll["Global`*"]
Uz[t_]:=20*Tanh[100*Sin[2*π*t+0.3]]
Plot[Uz[t],{t,0,6}];

Manipulate[Plot[Tanh[a*x],{x,-5,5}],{a,1,10}];

R1=50;
R2=100;
L1=10*(10^(-3));
L2=20*(10^(-3));
c=3*(10^(-6));

RceUzly={0==iUz[t]+iL1[t],iL1[t]==ic[t]+iR1[t]+iL2[t],iL2[t]+iR1[t]==iR2[t]};

RceSouc={u1[t]==Uz[t],u1[t]-u2[t]==L1*iL1'[t],ic[t]==c*D[u2[t],t],u2[t]-u3[t]==R1*iR1[t],u2[t]-u3[t]==L2*D[iL2[t],t],u3[t]==R2*iR2[t]};

RovniceVse=Union[RceSouc,RceUzly];
Nezname=Union[Cases[RovniceVse,_Symbol[t],{0,Infinity}]];

PocPodm=Cases[RovniceVse,parametr_'[t]:>parametr[0]==0,{0,Infinity}];

NDSolve[{RovniceVse,PocPodm},Nezname,{t,0,0.5}]