Instructions:

Problems to be solved in the notebook.

Prior to submission, delete all output, save your file and submit the file by email to hariradi@fel.cvut.cz

Name your file as... test1Name_Surname.nb

For questions involving circuits, work would be done on both paper and mathematica

QUESTION 1:
For the given voltage divider circuit create graph for the absolute transfer function values ​​in logarithmic coordinates, with GridLines, axes description with correct units, and plot graph in black colour with thick lines.
(3 Points). 

QUESTION 2 :
For ω = 314 (s^(-1)) print list using the real and imaginary part of impedance (in decimals) for the input terminals of the specified scheme. (1 Point)

par[list_]:=(((Plus@@((list^(-1)))))^(-1));
ser[list_]:=Plus@@list;
R1=1;
R2=10*(10^3);
R3=100;
R4=1*(10^3);
L1=1;
L2=10*(10^(-3));
L3=100*(10^(-6));
c1=1*(10^(-12));
c2=10*(10^(-9));
c3=100*(10^(-6));
Z1=ser[{R1,par[{I*ω*L2,(1/(I*ω*c1)),ser[{R2,I*ω*L1}]}]}];
Z2=ser[{R3, (1/(I*ω*c2)),par[{(1/(I*ω*c3)), ser[{R4,I*ω*L3 }]}]}];
transferFunction=(Z2/(Z1+Z2));
LogLogPlot[transferFunction,{ω,(10^(-12)),(10^20)},PlotStyle->{Black,Thick},AxesLabel->{"ω [(s^(-1))]","Transfer function [-]"},PlotRange->All,GridLines->Automatic]

Print["Real is ",Re[transferFunction/.ω->314.]," Imaginary is ",Im[transferFunction/.ω->314.]]

QUESTION 3 :
Using FindRoot, evaluate Cos[a*x]==x, create function that returns specified value of x. (2 Points) 
Using Table create a list of pairs for the function {(a^2),(Sqrt[f[a]])} for a∈<0,2> with the increment of 0.1. (1 Point)
Using ListPlot print the results and description, body in red colour for different size. (1 Point)

ClearAll[funkcion,list]
funkcion[a_]:=x/.FindRoot[Cos[a*x]==x,{x,1}]
list=Table[{(a^2),(Sqrt[funkcion[a]])},{a,0,2,0.1}];
ListPlot[list,PlotStyle->{Red,PointSize[0.02]}]

QUESTION 4 :
Solve the equation 6(x^3)+2(x^2)+x+1=0. (1 Point)
Using the Chop command remove the "almost zero". (1 Point)
Compute the value of the equation: 3*(x1+x2+x3) and 6*x1*x2*x3 and display the result using Print (1 Point)

res=Solve[6(x^3)+2(x^2)+x+1==0.,x];
x1=x/.res[[1]];
x2=x/.res[[2]];
x3=x/.res[[3]];
Print["first is ",Chop[3*(x1+x2+x3)]," second is ",Chop[6*(x1*x2*x3)]]

QUESTION 5 :
Using Rationalize command find a rational number (a substitute) that approximates square root of 2 with error being under 0.01.  (1 Point)
Display the result using Print command, in form: Substitute = *calculated value* (1 Point)
Calculate the error of the substitute (in percentage) and display it using Print command. (1 Point)

substitute=Rationalize[(Sqrt[2]),.01];
Print["Substitute = ",substitute]
Print["error is ",(((Sqrt[2])-substitute)/(Sqrt[2]))*100.," %"]

There's a given progression {3, 10, -5, 22, -21, 42, -45, 70}. Using FindSequenceFunction command, find the next element of the progression. (1 Point)

someList={3, 10, -5, 22, -21, 42, -45, 70}
FindSequenceFunction[someList,Length[someList]+1]