1+1

Sin[25.]

{1,6,5}

(5-(3+Sin[x]))

myvar=5

N[Gamma[3.3],50]

(Sqrt[2])

(Sqrt[4])

(Sqrt[2.])

N[(Sqrt[2]),100];

var=5;

var =5

(*vari=5*)

vari
var

(Sqrt[6])(*ctrl+2*);
(5^6) (*ctrl+6*);
(7/6)(*ctrl+/*);

∫(t^7)*(E^t)\[DifferentialD]t

DSolve[y''[t]+3*y'[t]+6*y[t]==Sin[t],y[t],t]

vari=5
Solve[vari==5]

Solve[varib+3==5]

vari=6
vari==5

DSolve[y'[t]==6,y[t],t]

Solve[5+y==3,y]

Solve[{x+y==3,x-y==5},{x,y}]

1 2

∫Sin[x]*Cos[x]\[DifferentialD]x

myLap=LaplaceTransform[(((Sin[t]))^4),t,s]

myInvLap=InverseLaplaceTransform[myLap,s,t]

t=5;
Plot[Sin[x],{x,0,6Pi},AxesLabel->{"t [s]","sin(t) "},PlotLabel->"Current",PlotStyle->{Thick,Dashed,Red}]

DSolve[{y'[t]+5*y[t]==Sin[t],y[0]==3},y[t],t]
ClearAll[t]
sol=y[t]/.DSolve[{y'[t]+5*y[t]==Sin[t],y[0]==3},y[t],t][[1]]

a/.a->3

b/.{a->3,b->2}

Plot[sol,{t,0,6Pi},AxesLabel->{"t [s]","sin(t) "},PlotLabel->"Current",PlotStyle->{Thick,Dashed,Red}]

TreeForm[{1,2,5,{3,1},6}]

{1,2,5,{3,1},6}[[4,3]]

(*second lecture*)

myVar=DSolve[{y''''[t]+10*y''[t]+9*y[t]==Sin[t],y[0]==1,y'[0]==-1,y''[0]==2,y'''[0]==-2},y[t],t]

someN={1,4{1,3},{2,3,1},1}

TreeForm[someN]

someN[[2,3]]

PlotRes=y[t]/.myVar[[1]]

x=5.

Manipulate[Plot[{PlotRes,1.5Sin[t]},{t,0,6Pi},AxesLabel->{"x","Sin[s]"},PlotLabel->"My plot",PlotStyle->{{Hue[b], Thickness[0.01], Dashed},{RGBColor[0.5,0.2,0.2],Thick}}],{b,0,1}]

myVar[[1,1]]

{{5,3}}//TreeForm

data=Table[{i,(i^2)},{i,2,10,0.1}];

ListPlot[data,PlotStyle->{PointSize[0.01],Orange},Joined->True,PlotLegends->"some"]

Plot[Sin[x],{x,0,10},PlotRange->{{0,50},{0,1}},Grid]

ListPlot[Table[{(E^x),(Sqrt[x])},{x,1,10,0.1}],AxesLabel->{"Axis x","Axis y"},PlotLabel->"My plot",PlotStyle->{Green, PointSize[0.01]},PlotLegends->"Line"]

(*Third lecture 3.3.2015*)

ClearAll[x,y]
sol=FindRoot[{Sin[x]==(E^y),Cos[y]==(E^(-x))},{{x,1},{y,1}}]

x=x/.sol
y=y/.sol

ClearAll[E]

ClearAll[myF];
myF[a_,b_,c_]:=Module[{sol,x1,x2,x},
sol=Solve[a*(x^2)+b*x+c==0,x];
x1=x/.sol[[1,1]];
x2=x/.sol[[2,1]];
N[{x1,x2}]
]

myF[2,3,4]

a

ClearAll[sol,x,x1,x2]
sol=Solve[a*(x^2)+b*x+c==0,x];
x1=x/.sol[[1,1]];
x2=x/.sol[[2,1]];
N[{x1,x2}]

N[(Sqrt[2])]

myF[a,b,c]

myF[a_,b_]:=a+b

myF[a,b]

myF[1,3m,5]

myResistor=10;
data=Table[{current+RandomReal[{-0.05,0.05}],current*myResistor+RandomReal[{-0.1,0.1}]},{current,0.1,2,0.01}];

plData=ListPlot[data,PlotLabel->"plData"];

fceCurrent=Fit[data,{current},current]

plFit=Plot[fceCurrent,{current,0.1,2},PlotStyle->{Red,Thick},PlotLabel->"plFit"];

Show[plData,plFit]

data2=Table[{current,(E^current)},{current, 0.1,2,0.01}];
ListPlot[data2];

dataPower=data2/.{current_,voltage_}:> {(voltage/current),current*voltage};

ListPlot[dataPower]

(*Fourth lecture 10.3.2015*)

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

ClearAll[der,EulerStep];
der[{t_,y_}]:=Sin[t]-y;
EulerStep[point:{t_,y_}]:={t+Δt,y+Δt*der[point]};
initialPoint={0,10};
tmax=10.;
n=200;
Δt=(tmax/n);
sol=NestList[EulerStep,initialPoint,n];
plot1=ListPlot[sol,AxesLabel->{"t [s]","y [t]"},PlotStyle->{Red,PointSize[0.01]},PlotRange->All];
forNDSolve={der[{t,y[t]}]==y'[t],y[initialPoint[[1]]]==initialPoint[[2]]};
sol2=NDSolve[forNDSolve,y,{t,initialPoint[[1]],tmax}];
plot2=Plot[y[t]/.sol2,{t,initialPoint[[1]],tmax},PlotRange->All];
Show[plot1,plot2]

ClearAll[Δt]
Series[h[x],{x,0,5}]/.x->Δt

n=5;
eqn=0==(∑_(i=0)^n)(Subscript[a, i])*D[y[t],{t,i}];
Solve[0==(∑_(i=0)^n)(Subscript[a, i])*(λ^i),λ]

(*Fifth lecture 17.3.2015*)

sol=Solve[{a*(x^2)+b*x+c==0,d*(y^5)+e*y+f==0},{x,y}]
myF2[a_,b_,c_,d_,e_,f_]:=Module[{sol,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y},
sol=Solve[{a*(x^2)+b*x+c==0,d*(y^5)+e*y+f==5},{x,y}];
x1=x/.sol[[1,1]];
x2=x/.sol[[2,1]];
x3=x/.sol[[1,1]];
x4=x/.sol[[2,1]];
x5=x/.sol[[1,1]];
x6=x/.sol[[2,1]];
x7=x/.sol[[1,1]];
x8=x/.sol[[2,1]];
x9=x/.sol[[1,1]];
x10=x/.sol[[2,1]];
y1=y/.sol[[1,1]];
y2=y/.sol[[2,1]];
y3=y/.sol[[3,1]];
y4=y/.sol[[4,1]];
y5=y/.sol[[5,1]];
y6=y/.sol[[6,1]];
y7=y/.sol[[7,1]];
y8=y/.sol[[8,1]];
y9=y/.sol[[9,1]];
y10=y/.sol[[10,1]];
N[{x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10}]
]

(*Fifth lecture 17.3.2015*)

sol=y[t]/.NDSolve[{y''[t]+2*y'[t]+Sin[y[t]]==Tanh[100*Sin[3*t]],y'[0]==2,y[0]==1},y[t],{t,0,6}][[1,1]]

Plot[sol,{t,0,6},PlotLegends->"y",PlotLabel->"My graph",AxesLabel->{"t","y"}]

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

par[{R1,R2,R3}]

Z1=ser[{I*ω*L1,par[{R1,(1/(I*ω*c1))}]}];
Z2=ser[{R2,par[{R3,I*ω*L2,(1/(I*ω*c2))}]}];

transfer=(Z2/(Z1+Z2))/.{R1->5,R2->5,R3->1000,c1->1*(10^(-6)),c2->500*(10^(-9)),L1->1*(10^(-3)),L2->8*(10^(-3))};

LogLogPlot[Abs[transfer],{ω,(10^(-4)),(10^8)},PlotStyle->{Thick},AxesLabel->{"ω [(s^(-1))]","transfer [-]"}]

LogLinearPlot[Arg[transfer],{ω,(10^(-4)),(10^12)},PlotStyle->{Thick},AxesLabel->{"ω [(s^(-1))]","transfer [-]"}]