$HistoryLength=2;
ClearAll["Global`*"];

1+1;
a=8;

ClearAll[a]
a==8

Sin[(5/8)Pi]

N[(5/8)Pi,100];

Sin[(5./8)Pi]

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

list={1,{ja,ty},{0,{alfa,romeo}}}

list[[-1,-1,-1]]

Length[list]

list[[2]][[1]]
list[[2,1]]

list[[0]]

list={1,{ja,ty},{0,{alfa,romeo}}}

TreeForm[list]

TreeForm[a+b]

a+b=3

FullForm[list]

List[1,List[ja,ty],List[0,List[alfa,romeo]]]

List[1,List[ja,ty],List[0,List[alfa,romeo]]]

vyr=(((x+3))^2)*Sin[(1/(2+Log[4+x]))];
FullForm[vyr]

vyr[[0]]

TreeForm[f[vyr]]

ClearAll[f];

?_

(*f[x:_]:="kuzle"+x;*)

ClearAll[f];
f[5]:="osel";
f[x_]:="kuzle"+x;
f[x_Integer]:=x+13;
f[x_,1]:=(x/("osel"));
f[x_,y_]:=((x+"kuzle")/("osel"));
f[{x_,y_}]:=x-y;
f[{1,1}]

ClearAll[a];
a[0]:=1;
a[n_]:=n*a[n-1];

Trace[a[3]]

?:=

?=

x

ClearAll[g,x];

g[x_]=Integrate[x*Exp[-x],x]
g[5]
?g

ClearAll[g,x];
g[x_]:=Integrate[x*Exp[-x],x]
?g

ClearAll[g];
g[x_]:=Integrate[x*Exp[-x],x]

ClearAll[res];
res[x_]:=FindRoot[Cos[x*y]==0.1y+0.02,{y,0.1}];
res[0.3]

Off[FindRoot::"nlnum"]

ClearAll[res];
res[x_]=Quiet[FindRoot[Cos[x*y]==0.1y+0.02,{y,0.1}]];
Quiet[res[0.3]]

Plot[{Sin[x],Cos[x]},{x,0,2Pi}]

Options[Plot];

Plot[x*Sin[(x^2)],{x,0,2Pi},PlotStyle->{Thickness[0.006],RGBColor[0,0.5,0.5],Dashing[{0.01,0.02,0.03}]}]

Plot[{x*Sin[(x^2)],x*Cos[(x^2)]},{x,0,2Pi},PlotStyle->{{Thickness[0.006],RGBColor[0,0.5,0.5],Dashing[{0.01,0.02,0.03}]},{Thickness[0.006],Blue}}];

plotik=Plot[{x*Sin[Tanh[(x^2)]],x*Cos[Tanh[(x^2)]]},{x,0,2Pi},PlotStyle->{{Thickness[0.006],Red},{Thickness[0.006],Blue}}];

SetDirectory[NotebookDirectory[]];

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

Head["f[x]"]
"f[x]"[[0]]

Plot[Tanh[5Sin[314t]],{t,0,0.04},PlotStyle->Thick,AxesLabel->{"x","f[x]"},PlotLabel->"nas graf",GridLines->Automatic]

Manipulate[
Plot[Tanh[ampl*Sin[314t]],{t,0,0.04},PlotStyle->Thick,AxesLabel->{"x","f[x]"},PlotLabel->"nas graf",GridLines->Automatic,PlotRange->{Automatic,{-1.1,1.1}}]
,{ampl,0,10},ControlPlacement->Top]

Solve[(x^2)==1]
%[[1,1,2]]

3x+5/.x->"osel"

3x+5y/.{x->"osel",y->"krava"}

(x^2)/.{{x->2},{x->3}}

Clear[a]

n=2;
rovnice=(∑_(i=0)^n)(Subscript[a, i])*(x^i)==0;
dosadZaKoreny=Solve[rovnice,x]
2(Subscript[a, 2])*x/.dosadZaKoreny

DSolve[(1+(x^2))*y''[x]+y'[x]*x+x*y[x]==1,y[x],x]

(*zde druhy prednes pocina se*)
ClearAll["Global`*"];

ClearAll[f];
f:=Random[];
{f,f,f,f,f,f,f}

ClearAll[f];
f=Random[]
{f,f,f,f,f,f,f}

Table["opice",{12}]

Table[(opice^i),{i,12}]
Plot[%,{opice,0,1}];

Table[(opice^i),{i,2,4,0.3}];

vys=Table[(Pi^i)*(E^j),{i,3},{j,3}]
MatrixForm[vys];
Grid[vys,Frame->All]

ClearAll[a];
a[0]:=1;
a[n_]:=n*a[n-1];
$RecursionLimit=2000;
Timing[Table[a[i],{i,1450}]][[1]]

ClearAll[a];
a[0]:=1;
a[n_]:=a[n]=n*a[n-1];
$RecursionLimit=2000;
Timing[Table[a[i],{i,1450}]][[1]]

?/;

ClearAll[f];
f[x_]:=1-(x^2)/;-1<x≤1;
f[x_]:=f[x+2]/;x≤-1;
f[x_]:=f[x-2]/;x>1;
Plot[f[x],{x,-4,4}];
Trace[f[6.52]];

ClearAll[f];
f[x_]:=Module[{a,b,c},
a=Sin[x];
b=Cos[a];
c+a+b

];
f[5.]

ClearAll[f];
f[x_]:=Module[{a,b,c=1},
a=Sin[x];
Print["a= ",a];
b=Cos[a];
c+a+b

];
f[5.]

lide={ja,ty,on,ona,ono};
Map[ostrihej,lide]
ostrihej/@lide

Apply[natocPecko,lide]
natocPecko@@lide

{TreeForm[lide],TreeForm[natocPecko@@lide]}

Plus@@Range[100]

test[x_]:=x>2;
Select[{1,2,4,7,6,2},test]

test[3]

Select[{1,2,4,7,6,2},#>2&]

((#)^2)&[3]

Plot3D[((#1)^2)*Sin[#2]&[x,y],{x,-1,1},{y,-Pi,Pi}]

#=2

ClearAll[f];
f[x_Integer]:=5;
f[4.]

NumericQ[Pi]

?*Q;

ClearAll[f];
f[x_?NumericQ]:=5;
f[h]

(#>4&)[5]

ClearAll[f];
f[x_?(#>4&)]:=5;
f[6]

ClearAll[krok];
tmax=5.;
nKroku=100;
y0=1;
t0=0.;
Δt=(tmax/nKroku);
krok[{t_,y_}]:={t+Δt,y+(-y)*Δt};
NestList[krok,{t0,y0},nKroku];
ListPlot[%]

Nest[Cos,x,10]

Series[Cos[x],{x,0.,40}]//Chop;

NestList[Cos,0.,100]//ListPlot;

res

rce=y'[t]==-y[t];
poc=y[0]==1;
res=NDSolve[{rce,poc},y,{t,0,tmax}][[1]]
Plot[y[t]/.res,{t,0,tmax}]

FullForm[x->5]

x+3/.x->5

(y/.res)[2]

SetDirectory[NotebookDirectory[]]

(y/.res)>>"intfce"

res[[1,2]]

Plot[res[[1,2]][t],{t,0,tmax}]

(*zde treti prednes*)
ClearAll["Global`*"];

R1=100;
R2=500;
R3=253;
c=6.8*(10^(-6));
L=0.05;
uz=15*Tanh[30*Sin[314t+0.23]];
iz=0.01*Sin[628t-0.5];
Plot[uz,{t,0,tmax},AxesLabel->{"t [s]","u4 [V]"}];

uzly={0==iL[t]+iz+iR3[t],
iL[t]+iuz[t]==iR1[t],
iR1[t]==iC[t],
iz==iuz[t]+iR2[t]
};
soucastky={u2[t]-u3[t]==R1*iR1[t],
u4[t]==R2*iR2[t],
u1[t]==R3*iR3[t],
u1[t]-u2[t]==L*iL'[t],
iC[t]==c*u3'[t],
uz==u2[t]-u4[t],
iL[0]==0,
u3[0]==0
};
rcedohr=Union[uzly,soucastky];
nezname=Union[Cases[rcedohr,_Symbol[t],{0,∞}]];
tmax=0.08;
res=NDSolve[rcedohr,nezname,{t,0,tmax},StartingStepSize->(10^(-9))][[1]];
Plot[u4[t]/.res,{t,0,tmax},AxesLabel->{"t [s]","u4 [V]"},PlotStyle->{Thick,Red}]

uzly={0==iL[t]+iz+iR3[t],
iL[t]+iuz[t]==iR1[t],
iR1[t]==iC[t],
iz==iuz[t]+iR2[t]
};
soucastky={u2[t]-u3[t]==R1*iR1[t],
u4[t]==R2*iR2[t],
u1[t]==R3*iR3[t],
u1[t]-u2[t]==L*iL'[t],
iC[t]==c*u3'[t],
uz==u2[t]-u4[t]
};
rcedohr=Union[uzly,soucastky];
nezname=Union[Cases[rcedohr,_Symbol[t],{0,∞}]];
pocs=Union[Cases[rcedohr,a_'[t]:>a[0]==0,{0,∞}]]

tmax=0.08;
res=NDSolve[Union[rcedohr,pocs],nezname,{t,0,tmax},StartingStepSize->(10^(-9))][[1]];
Plot[u4[t]/.res,{t,0,tmax},AxesLabel->{"t [s]","u4 [V]"},PlotStyle->{Thick,Yellow},GridLines->Automatic,Background->Black]

R1=100;
R2=500;
R3=253;
c=6.8*(10^(-6));
L=0.05;
uz=15;
iz=0.01;
uzly={0==iL[t]+iz+iR3[t],
iL[t]+iuz[t]==iR1[t],
iR1[t]==iC[t],
iz==iuz[t]+iR2[t]
};
soucastky={u2[t]-u3[t]==R1*iR1[t],
u4[t]==R2*iR2[t],
u1[t]==R3*iR3[t],
u1[t]-u2[t]==L*iL'[t],
iC[t]==c*u3'[t],
uz==u2[t]-u4[t]
};
rcedohr=Union[uzly,soucastky];
rceDC=rcedohr/.{a_Symbol[t]:>a,a_'[t]:>0}
Solve[rceDC]

R1=100;
R2=500;
R3=253;
uz=15;
iz=0.01;
uzly={iz+iuz==iR3,
0==iR2+iuz,
iR3+iR2==iR1+iout
};
soucastky={u3==R1*iR1,
u2-u3==R2*iR2,
u1-u3==R3*iR3,
uz==u2-u1
};
rcedohr=Union[uzly,soucastky];
Length[rcedohr]
pom=Union[Cases[rcedohr,_Symbol,{0,∞}]];
nezname=DeleteCases[pom,iout]
Solve[rcedohr,nezname]//Simplify

tryList={Ra,Rb,Rc};
par[list_]:=(((Plus@@(list^(-1))))^(-1));
par[tryList]
ser[list_]:=Plus@@list;
ser[tryList]

$HistoryLength=2;
ClearAll["Global`*"];

uz=100*Sin[314t];
R=50;
L=0.05;
c=47*(10^(-6));
rceUzly={iL[t]==iR[t],iL[t]==ic[t]};
rceSoucastky={uz-u1[t]==R*iR[t],
u1[t]-u2[t]==L*iL'[t],
ic[t]==c*u2'[t]
};
rceDohr=Union[rceSoucastky,rceUzly];
nezname=Union[Cases[rceDohr,_Symbol[t],{0,∞}]];
poc=Union[Cases[rceDohr,a_'[t]:>a[0]==0,{0,∞}]];
res=NDSolve[Union[rceDohr,poc],nezname,{t,0,0.08},StartingStepSize->(10^(-9))];
Plot[iR[t]/.res,{t,0,0.08},PlotStyle->Thick]

res//FullForm;

TrigReduce[((Cos[t])^2)]

Series[Exp[x],{x,0,5}];

z=3+4I;
{Re[z],Im[z],Abs[z],Abs[z]*(E^(I*Arg[z]))//ComplexExpand}

5*(E^(I*0.3))

tryList={Ra,Rb,Rc};
par[list_]:=(((Plus@@(list^(-1))))^(-1));
par[tryList];
ser[list_]:=Plus@@list;
ser[tryList];

z1=ser[{R1,(1/(I*ω*c1))}];
z2=par[{z1,I*ω*L1}];
z3=ser[{I*ω*L2,(1/(I*ω*c2))}];
z4=par[{z3,R2}];
u2=u1*(z4/(z4+z2))//Simplify;
uplot=u2/.{u1->1,R1->0.1,R2->10000,L1->0.1,L2->0.05,c1->(10^(-9)),c2->(10^(-6))};
LogLogPlot[Abs[uplot],{ω,0.01,(10^7)},PlotStyle->Thick,PlotRange->All,GridLines->Automatic]

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

za=par[{R1,I*ω*L1}];
zb=ser[{za,(1/(I*ω*C1))}];
z1=par[{zb,R2}];
zc=ser[{R3,I*ω*L2}];
z2=par[{zc,(1/(I*ω*C2))}];
prenos=(z2/(z1+z2))//Simplify;
k=1000;
μ=(10^(-6));
m=0.001;
dos={R1->100k,R2->100k,R3->0.1,C1->5μ,C2->0.1μ,L1->100m,L2->5m};
vysprenos=prenos/.dos;
LogLogPlot[Abs[vysprenos],{ω,0.1,(10^8)},PlotRange->All,PlotStyle->Thick,AxesLabel->{"ω [(s^(-1))]","Abs[P]"},GridLines->Automatic]

nn=16;
data=Table[{x,Sin[x]},{x,0,2Pi,(Pi/nn)}]//N;
pl1=ListPlot[data,PlotStyle->{PointSize[0.015],Red}];
int=Interpolation[data,InterpolationOrder->3];
pl2=Plot[int[x],{x,0,3Pi},PlotStyle->Thick];
Show[pl2,pl1]
Plot[int[x]-Sin[x],{x,0,3Pi},PlotStyle->Thick];

int

{xmin,xmax}=int[[1,1]]

f[x_]:=0.1x+0.001(x^3)+Tanh[1+0.1(x^2)];
Plot[f[x],{x,-10,10}];
ikx[y_]:=x/.FindRoot[f[x]==y,{x,0}]
ikx[1]

dat=Table[{f[x],x},{x,-10,10,0.1}];
intikx=Interpolation[dat];
{ikx[0],intikx[0]}

n=1000;
Timing[Table[ikx[x],{x,-0.5,0.5,(1/n)}]][[1]]

n=100000;
Timing[Table[intikx[x],{x,-0.5,0.5,(1/n)}]][[1]]

body;

vyrpresne[x_]:=(((x-1))^2)+3;
vyrhledam[x_]:=a*(x^2)+b*x+c;
body=Table[{x,vyrpresne[x]+RandomReal[{-0.5,0.5}]},{x,-1,3,0.2}];
pl1=ListPlot[body,PlotStyle->{PointSize[0.015],Red}];

err[{x_,y_}]:=(((y-vyrhledam[x]))^2);
celkeror=Plus@@(err/@body);
vyrhledam[x]/.Solve[0==D[celkeror,#]&/@{a,b,c}][[1]]
vysl=Fit[body,{1,x,(x^2)},x]//Simplify;
pl2=Plot[vysl,{x,-1,3},PlotStyle->Thick,GridLines->{Table[i,{i,-1,3,0.2}],Table[i,{i,3,7,0.2}]}];
Show[pl2,pl1]

ClearAll[uz]
uz[t_]:=100*Sin[314t+0.123]+5*Sin[3*314t+0.569];

c=16*(10^(-6));
R=50;
res=NDSolve[{uz[t]==R*i[t]+uc[t],i[t]==c*uc'[t],uc[0]==0},{uc,i},{t,0,0.1}][[1]];
proud[t_]:=i[t]/.res;
data=Table[{proud[t],proud'[t],uz'[t]},{t,0,0.1,0.0001}];
Fit[data,{pr,derpr},{pr,derpr}]

(1/c)