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_]:=(((Total[(list^(-1))]))^(-1))

ser[list_]:=Total[list]

R1=R2=R3=1000;
L1=L2=1;
C1=1*(10^(-6));
C2=1*(10^(-3));
R4=1;
z1=ser[{R1,par[{ser[{(1/(I*ω*C1)),R2}],I*ω*L1,R3}]}];
z2=par[{ser[{I*ω*L2,(1/(I*ω*C2))}],R4}];

transfer=(z2/(z2+z1));

LogLogPlot[Abs[transfer],{ω,0.0001,(10^16)},GridLines->Automatic,PlotStyle->{Black,Thick},PlotRange->All,AxesLabel->{"ω [(s^(-1))]","Abs[transfer] [-]"}]

Print["Real part of input impedance is ",
Re[totalImp=ser[{z1,z2}]/.ω->314.],"Imaginary part of input impedance is ",Im[totalImp=ser[{z1,z2}]/.ω->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)

fce[a_]:=x/.FindRoot[Cos[a*x]==x,{x,1}]

fce[10]

sol=Table[{(a^2),(Sqrt[fce[a]])},{a,0,2,0.1}]

ListPlot[sol,PlotStyle->{Red,PointSize[0.05]}]

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)

eq=Solve[6*(x^3)+2*(x^2)+x+1==0,x];
x1=x/.eq[[1]]
x2=x/.eq[[2]]
x3=x/.eq[[3]]
Chop[{x1,x2,x3}]

Print["Value is ",3*(x1+x2+x3)//Chop," and ", 6*x1*x2*x3//Chop]

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)

Rationalize[(Sqrt[2]),0.01];
Print[Rationalize[(Sqrt[2]),0.01],"=",(Sqrt[2])]

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)

FindSequenceFunction[{3,10,-5,22,-21,42,-45,70},9]