1+1

(Sqrt[2])

(Sqrt[8])

(132/64)

(Sqrt[2.])

(2^5)

N[Pi]

∞

α

N[π]

N[π,100]

Sin[(π/5)]

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

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

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

Cross[{1,2,3},{a,b,c}]

{1,2,3}\[Cross]{a,b,c}

a=2

a+1

kyncl je vul

kyncl*je*vul

12opice

opice12

?=

a=5+6

?a

a:=5+6

?a

a

?:=

a=Random[]

?a

{a,a,a}

a:=Random[]

?a

{a,a,a}

a=5+6;
b=a*(∫_1^x)((Sin[x])/x)\[DifferentialD]x;
b/.x->1.567

LaplaceTransform[((t^2)+1)Exp[-2t],t,s]

x=3;

ClearAll[x]

Integrate[((Sin[x])/(Sqrt[1+a*x])),x];

Solve[x^17==1.,x];

Sin[Pi]
Pi//Sin
Sin@Pi

Plot[Tanh[50Sin[x]],{x,0,10Pi}]

(*blabla*)
Plot[{Sin[x],Tanh[50Sin[x]]},{x,0,10Pi}]

Tady je text

??Plot

x=RedDevil;
Plot[{Sin[x],Tanh[50Sin[x]]},{x,0,10Pi},PlotStyle->{{Red,Thick},{Magenta,Dashed}},AxesLabel->{"x","Sin[x],Tanh[Sin[10x]]"}]

(*zde zacina druhe cviko*)

ClearAll[f];
f[x_]:=((Sin[(Sqrt[(x^2)+1])])/((x^2)+1));
plotik=Plot[f[Sin[t]],{t,0,10Pi},AxesLabel->{"t","f[sin(t)]"},PlotStyle->{Red,Thick}];

SetDirectory[NotebookDirectory[]];
Export["mujPrvniGraf.png",plotik,ImageResolution->300]

?/.

5*hruska+3*jablko+2*osel/.{hruska->2Kc,jablko->1Kc,osel->20000Kc}

x/.{x->1,x->2+I}

x/.{{x->1},{x->2+I}}

n=2;
rce=0==(∑_(i=0)^n)(Subscript[a, i])*(x^i)

Solve[rce,x]

rce=(x^4)+((a+1)/((a^2)+1))*x+1.==0;
dosadZaKoreny=Solve[rce,x];
koreny=x/.dosadZaKoreny;
proPlot=Total[koreny];
Plot[proPlot,{a,-1,1}]

x/.{{x->1},{x->2},{x->3},{x->4}}

rce=(x^4)+((a+1)/((a^2)+1))*x+1.==0;
proPlot=Total[x/.Solve[rce,x]]
Plot[proPlot,{a,-1,1}]

x/.Solve[x+(Sqrt[x+1])==5]

x/.Solve[x+(Sqrt[x+1])==5][[1]]

(x^2)+x+3/.Solve[x+(Sqrt[x+1])==5][[1]]

{{x->3}}[[1]]

(x^2)+x+3/.{{x->3}}[[1]]

{1,2,5}[[2]]

ClearAll[f];
f[n_]:=Table[Random[],{n}]

ClearAll[f];
f[n_]:=Table[Random[],{n}]

f[5]/.List->Times

a*b*c//TreeForm

ClearAll[f];
f[n_]:=(Table[Random[],{n}]/.List->Plus)/n

f[50]

struct/.(E^(a_)):>(a^E)

test[x_]:=x>5;

struct=Table[(E^j),{j,2,10}]
struct/.(E^(a_?test)):>(a^E)
struct/.(E^(a_?(#>5&))):>(a^E)

a="olifant"
struct/.(E^(a_))->(a^E)

(* cviko treti tyden *)

(*smazani z minula*)
ClearAll[Evaluate[Context[]<>"*"]];
(* rozcvicka*)
f[t_]:={t+Cos[t],Sin[t]};

ParametricPlot[f[(Sqrt[1+(t^2)])],{t,0,10Pi},AxesLabel->{"t","uu"},PlotStyle->{Black,Thick},AspectRatio->0.5]

Manipulate[

ParametricPlot[f[(Sqrt[a+(t^2)])],{t,0,10Pi},AxesLabel->{"t","uu"},PlotStyle->{Hue[b],Thick},AspectRatio->0.5,PlotRange->{{0,30},Automatic}]

,{a,1,100},{b,0,1}];

Manipulate[
f[t_]:={t+Cos[t],Sin[c*t]};
ParametricPlot[f[(Sqrt[a+(t^2)])],{t,0,10Pi},AxesLabel->{"t","uu"},PlotStyle->{Hue[b],Thick},AspectRatio->0.5,PlotRange->{{0,30},Automatic}]

,{{a,5},1,100},{b,0,1},{{c,5},1,10,1}]

ClearAll[f]
f[a_]:=x/.FindRoot[x==Cos[a*x],{x,1}]
Plot[f[(Sqrt[t])],{t,0.25,1},PlotStyle->{Orange,Thick},AxesLabel->{"t","f((Sqrt[t]))"},GridLines->Automatic]

Attributes[Plot]

Plot[Evaluate[D[Tanh[x],x]],{x,-5,5}]

Tanh'

pl1=Plot[Tanh'[x],{x,-5,5}];
body=Table[{x,Tanh'[x]},{x,-5.,5,0.9}];
pl2=ListPlot[body,Joined->True,PlotStyle->{Red,Opacity[0.5]},PlotMarkers->Automatic];
Show[pl1,pl2]

pl1//InputForm;

Solve[{a*10+b==0.03,a*20+b==0.0456}]
a*12.6+b/.%[[1]]

a*12.6+b/.Solve[{a*10+b==0.03,a*20+b==0.0456}][[1]]

data={{10,0.03},{20,0.0456}};
Quiet@Interpolation[data][12.6]

Fit[data,{1,T},T]
%/.T->12.6

(* zacatek cviceni 
4. tyden 13.3.2017 *)

(*bodA:=(Subscript[I, u])+(Subscript[I, k])==(Subscript[I, (Subscript[R, 1])])+(Subscript[I, (Subscript[R, 2])])+(Subscript[I, (Subscript[R, 3])])
bodC:=(Subscript[I, (Subscript[R, 3])])==(Subscript[I, (Subscript[R, 4])])+(Subscript[I, (Subscript[R, 5])])+(Subscript[I, out])
bodD:= (Subscript[I, (Subscript[R, 4])])==(Subscript[I, U])+(Subscript[I, k])*)

dos={R1->100,R2->100,R3->100,R4->100,R5->100,uZ->100,iZ->0.1};
rce={iU+iZ==iR1+iR2+iR3,
iR3==iR4+iR5+iOut,
iR4==iZ+iU,
uA==R1*iR1,
uZ==uA-uD,
uC==iR5*R5,
uA==R2*iR2,
R3*iR3==uA-uC,
uC-uD==R4*iR4
};
rceCiselne=rce/.dos;
promenne=Cases[rceCiselne,_Symbol,{0,∞}]//Union;
nezname=DeleteCases[promenne,iOut];
{Length[rce],Length[nezname]};
N[Solve[rce,nezname]/.dos]//Simplify

Pi//Sin
Sin@Pi
Sin[Pi]

(* druhy priklad *)
dos={R1->100,R2->100,R3->100,R4->100,R5->100,uZ->100,iZ->0.1};
rce={iU==iR1+iR2,iR2==iZ+iR3,iR3==iOut+iU,u1==iR1+R1,u1-u2==R2*iR2,u2-u3==iR3*R3,uZ==u3-u1};

rceCiselne=rce/.dos;

promenne=Cases[rceCiselne,_Symbol,{0,∞}]//Union
nezname=DeleteCases[promenne,iOut]
{Length[rce],Length[nezname]}

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

(* priklad 3 *)

R1=R2=1000;
c=4.7*(10^(-6));
L=0.05;
uz[t_]:=Tanh[100Sin[2*Pi*50t+0.123]];
rce={uz[t]==uA[t],
iU[t]==iL[t],
iL[t]==iR1[t]+iR2[t],
iR2[t]==iC[t],
uB[t]==R1*iR1[t],
uB[t]-uC[t]==R2*iR2[t],
iC[t]==c*uC'[t],
uA[t]-uB[t]==L*iL'[t]
};
pocpodm=Cases[rce,a_'[t]:>a[0]==0,{0,∞}]//Union;
nezname=Cases[rce,_Symbol[t],{0,∞}]//Union;
rceDohr=Union[rce,pocpodm];
tmax=0.08;
res=NDSolve[rceDohr,nezname,{t,0,tmax},StartingStepSize->(10^(-9))][[1]];
Plot[{uz[t],uC[t]/.res},{t,0,tmax},PlotRange->All]

(*Zde zacina paty cviko*)

par[list_]:=((Total[(list^(-1))])^(-1));
ser[list_]:=Total[list];
za=ser[{R1,I*ω*L1,(1/(I*ω*C1))}];
zb=ser[{R2,I*ω*L2}];
zc=par[{zb,(1/(I*ω*C2))}];
z1=za;
z2=zc;
prenos=(z2/(z1+z2));
dos={R1->1,R2->1,C1->(10^(-6)),L1->0.1,C2->(10^(-9)),L2->(10^(-6))};
proTisk=Abs[prenos/.dos];
LogLogPlot[proTisk,{ω,(10^(-2)),(10^9)},PlotRange->All,AxesLabel->{"ω [(s^(-1))]","Abs[P[ω]]"},GridLines->Automatic,PlotStyle->{Red,Thickness[.006]}]

par[list_]:=((Total[(list^(-1))])^(-1));
ser[list_]:=Total[list];
za=(1/(I*ω*C1));
zc=par[{R1,(1/(I*ω*C1)),I*ω*L1}];
z1=za;
z2=zc;
prenos=(z2/(z1+z2));
dos={R1->(10^5),C1->(10^(-9)),L1->(10^(-6)),C2->(10^(-9))};
proTisk=Abs[prenos/.dos];
LogLogPlot[proTisk,{ω,(10^2),(10^10)},PlotRange->All,AxesLabel->{"ω [(s^(-1))]","Abs[P[ω]]"},GridLines->Automatic,PlotStyle->{Magenta,Thickness[.006]},PlotPoints->1000];
Print["Zvstupni pro ω=100 je: ",z1+z2/.dos/.ω->100.," Ω" ]

Manipulate[
za=(1/(I*ω*C1));
zc=par[{R1,(1/(I*ω*C1)),I*ω*L1}];
z1=za;
z2=zc;
prenos=(z2/(z1+z2));
dos={R1->(10^5)};
proTisk=Abs[prenos/.dos];
schovka={C1,L1};
LogLogPlot[proTisk,{ω,(10^2),(10^10)},PlotRange->{Automatic,{(10^(-5)),1400}},AxesLabel->{"ω [(s^(-1))]","Abs[P[ω]]"},GridLines->Automatic,PlotStyle->{Magenta,Thickness[.006]},PlotPoints->1000]
,{C1,(10^(-9)),(10^(-6))},{L1,(10^(-6)),(10^(-3))}]

schovka

par[list_]:=((Total[(list^(-1))])^(-1));
ser[list_]:=Total[list];
za=(1/(I*ω*C1));
zc=par[{R1,(1/(I*ω*C1)),I*ω*L1}];
z1=za;
z2=zc;
prenos=(z2/(z1+z2));
dos={R1->(10^5),C1->(10^(-9)),L1->(10^(-6)),C2->(10^(-9))};
proTisk=Arg[prenos/.dos];
LogLinearPlot[proTisk,{ω,(10^2),(10^10)},PlotRange->All,AxesLabel->{"ω [(s^(-1))]","Arg[P[ω]]"},GridLines->Automatic,PlotStyle->{Magenta,Thickness[.006]},PlotPoints->1000]

(* cviko 6. tyden
- 27.3.2017 
-viz. test1JanKyncl *)

(* cviko 7. tyden - 3.4.17*)
ClearAll[Evaluate[Context[]<>"*"]];
SetDirectory[NotebookDirectory[]];
FileNames[]

pom=Import["scope_7.csv"];

pom

info=Grid[Take[pom,2],Frame->All]

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

datau1=Table[{data[[i,1]],data[[i,2]]},{i,1,Length[data]}];
ListPlot[datau1];

datau1=data/.{t_,u1_,u2_,u3_}:>{t,u1};
datau2=data/.{t_,u1_,u2_,u3_}:>{t,u2};
datau3=data/.{t_,u1_,u2_,u3_}:>{t,u3};
ListPlot/@{datau1,datau2,datau3}

ClearAll[f1,derf];
f1[t_]:=t/;-1≤t≤1;
f1[t_]:=2-t/;1≤t≤3;
T=4;
f1[t_]:=f1[t-T]/;T>3;
Plot[f1[t],{t,-1,15}];
derf[t_]:=((f1[t+0.01]-f1[t])/0.01);
Plot[derf[t],{t,-1,15}];

Accumulate[{a,b,c,d}]

Plot[f1[t],{t,-1,15}];
nBoduNaPeriodu=300.;
Δt=(T/nBoduNaPeriodu);
hodnoty=Table[f1[t],{t,0,2T,Δt}];
ListPlot[hodnoty];
akumulovaneHodnoty=Accumulate[hodnoty];
integralniBody=Table[{Δt*(i+1),Δt*akumulovaneHodnoty[[i]]},{i,1,Length[akumulovaneHodnoty]}];
ListPlot[integralniBody]

resUc=DSolve[{a*t==C1*uc'[t],uc[0]==0},uc[t],t][[1]]
uc[t]/.resUc/.t->tZlom
Solve[%==ucZLom,C1]

resIL=DSolve[{a*t==L*iL'[t],iL[0]==0},iL[t],t][[1]];
iL[t]/.resIL/.t->tZlom
Solve[%==iLZLom,L]

resUc=DSolve[{Iskok==C1*uc'[t],uc[0]==0},uc[t],t][[1]]
uc[t]/.resUc/.t->tZlom
Solve[%==ucZLom,C1]

resIL=DSolve[{Uskok==L*iL'[t],iL[0]==0},iL[t],t][[1]];
iL[t]/.resIL/.t->tZlom
Solve[%==iLZLom,L]

L=0.156;
R=10;
T=0.02;
f=(1/T);
ω=2.*Pi*f;
uz[t_]:=10*Sin[ω*t+0.123];
tmax=0.09;
soliL=NDSolve[{uz[t]==L*iL'[t]+R*iL[t],iL[0]==0},iL,{t,0,tmax}][[1]];
nDat=1000;
dats=Table[{t,iL[t]/.soliL},{t,0,tmax,(tmax/nDat)}];
intIL=Interpolation[dats];
dataProFit=Table[{intIL[t],intIL'[t],uz[t]},{t,0,tmax,(tmax/nDat)}];
Fit[dataProFit,{proud,derproud},{proud,derproud}]