Hi, this is my assignment in numerical mathematics, this runs in octave unfortunatly not in sagemath, can someone see what the problem is? Here is the link to the sage math cloud https://cloud.sagemath.com/projects/666fc8f9-8619-46f9-b41d-c85afdef2169/files/2015-10-29-090250.sagews Here is the code
a)
function y=f(x)
y=3/(2+x)
endfunction
function a=p(x)
y1=x^2
y2=x
y3=1
a=[y1,y2,y3]
endfunction
b)
Stützstellen vector x
x=[-1 0 1] f(x(1)) f(x(2)) f(x(3))
Anzahl der Stützstellen bestimmer
d=length(x) A=zeros(d,d)
for i=1:3 A(i,:)=p(x(i)) endfor
b=zeros(3,1)
for i=1:3 b(i)=f(x(i)) endfor
b [L,U,P] = lu(A) invL=inv(L) y=invLPb invU=inv(U) z=invUy Az b