2014  ABENDUA

1.

f[x_]=k^2*(x/10)+Cos[x]+Sin[x]-1.1

CountRoots[f[x],x]

b) BISEKZIOA

g[x_]=Cos[x]+Sin[x]-1.1

Plot[g[x],{x,0,10}]

Tartea [0,1]
Bisekzioa bi iterazio

For[a=0.;b=1;i=1,i<3,i++,c=(a+b)/2;If[g[a]*g[c]<0,b=c,a=c];Print[i," garren iterazioan tartea [",a,",",b,"] da"]]

c)NEWTON RAPHSON
t=12 zifra esanguratsu
err%=10^(-10)

For[x0=0;i=1;tol=10^(-10);err=tol+1,i<30&&err>tol,i++,x1=SetPrecision[x0-(g[x0]/g'[x0]),12];err=Abs[(x1-x0)/x1]*100;Print[i," garren iterazioan hurbilketa = ",x1," eta errorea %",err];x0=x1]

SetPrecision[FindRoot[g[x],{x,0}],12]

2.

eku=y''[t]+4y[t]==UnitStep[t-Pi]-UnitStep[t-2Pi]

ekutrans=LaplaceTransform[eku,t,s]/.{y[0]->1,y'[0]->0}

lys=LaplaceTransform[y[t],t,s]

soltrans=Solve[ekutrans,lys]

y1[s_]=lys/.soltrans[[1]]

Y1[t_]=InverseLaplaceTransform[y1[s],s,t]

Plot[y1[s],{s,-10,10}]

3.

eku=y'[x]==(y[x]+x)/(y[x]-x)

f[x_,y_]=(y+x)/(y-x)

b=StreamPlot[{1,f[x,y]},{x,0,2},{y,-1,0}]

sol=DSolve[eku,y[x],x]/.{y[1]->0,y[1]->1}

c=Plot[sol,{x,0,2}]

NDSolve[{eku,y[1]==0},y[x],{x,0,2}]