# Revision history [back]

### runs in octave(testet)>sagemath cloud(errors)

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

# 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

 2 No.2 Revision slelievre 15399 ●18 ●144 ●304 http://carva.org/samue...

### runs in octave(testet)>sagemath cloud(errors)

Hi, this is my assignment in numerical mathematics, this runs in octave unfortunatly Octave but unfortunately not in sagemath, SageMath, can someone see what the problem is? Here is is?

See the link to the sage math cloud https://cloud.sagemath.com/projects/666fc8f9-8619-46f9-b41d-c85afdef2169/files/2015-10-29-090250.sagews SageMathCloud worksheet https://cloud.sagemath.com/projects/666fc8f9-8619-46f9-b41d-c85afdef2169/files/2015-10-29-090250.sagews

Here is the code

# a)

# a)
function y=f(x)
y=3/(2+x)
endfunctionendfunction
function a=p(x)
y1=x^2
y2=x
y3=1
a=[y1,y2,y3]
endfunctionendfunction
# b)
b) # Stützstellen vector xx
x=[-1 0 1]
f(x(1))
f(x(2))
f(x(3))f(x(3))
# Anzahl der Stützstellen bestimmerbestimmer
d=length(x)
A=zeros(d,d)
d=length(x)
A=zeros(d,d) for i=1:3
A(i,:)=p(x(i))
endforendfor
b=zeros(3,1)
b=zeros(3,1) for i=1:3
b(i)=f(x(i))
endforendfor
b
[L,U,P] = lu(A)
invL=inv(L)
y=invLPy=invL*P*b
invU=inv(U)
z=invU*y
A*z
b
invU=inv(U)
z=invUy
Az
b
 3 No.3 Revision slelievre 15399 ●18 ●144 ●304 http://carva.org/samue...

### runs in octave(testet)>sagemath cloud(errors)Octave (tested) but not SageMathCloud (errors)

Hi, this is my assignment in numerical mathematics, this runs in Octave but unfortunately not in SageMath, can someone see what the problem is?

See the SageMathCloud worksheet 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=invL*P*b
invU=inv(U)
z=invU*y
A*z
b

 4 retagged FrédéricC 4385 ●3 ●37 ●93

### runs in Octave (tested) but not SageMathCloud (errors)

Hi, this is my assignment in numerical mathematics, this runs in Octave but unfortunately not in SageMath, can someone see what the problem is?

See the SageMathCloud worksheet 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=invL*P*b
invU=inv(U)
z=invU*y
A*z
b