sbnr
04-13-2007, 08:19 AM
Hi everybody
I'm trying to solve a simple BV problem :
Y''(x) + w^2 Y(x) =0
Y=(y1,y2)
y1' = y2
y2' = -w^2 y1
with BC:
Y(0)=0
Y(1)=sin(w)
( solution should be: sin(wx) )
But I always obtain this error:
'singular matrix, row all 0 in pinvs' .
These are the settings of my difeq:
k=1 !first point
E(2,1)=y1(1)
k=M+1 !last point
E(1,M+1)=y1(M)-sin(w)
!internal points
E(1,k)=y1(k)-y1(k) -0.5(x(k)-x(k-1))*(y2(k)-y2(k-1))
E(2,k)=y2(k)-y2(k) +0.5(x(k)-x(k-1))*w^2*(y1(k)-y1(k-1))
and matrix S(nm) is computed as:
n=1...2
S(n,1) = dE(n,k)/dy1(k-1)
S(n,2) = dE(n,k)/dy1(k-1)
S(n,3) = dE(n,k)/dy2(k)
S(n,4) = dE(n,k)/dy2(k)
Can someone help me?
thank you very much
PS I saw a similar post dated on 5-6-2006 but I diddnt understand so much (and i would like NOT to change my "x" ...)
I'm trying to solve a simple BV problem :
Y''(x) + w^2 Y(x) =0
Y=(y1,y2)
y1' = y2
y2' = -w^2 y1
with BC:
Y(0)=0
Y(1)=sin(w)
( solution should be: sin(wx) )
But I always obtain this error:
'singular matrix, row all 0 in pinvs' .
These are the settings of my difeq:
k=1 !first point
E(2,1)=y1(1)
k=M+1 !last point
E(1,M+1)=y1(M)-sin(w)
!internal points
E(1,k)=y1(k)-y1(k) -0.5(x(k)-x(k-1))*(y2(k)-y2(k-1))
E(2,k)=y2(k)-y2(k) +0.5(x(k)-x(k-1))*w^2*(y1(k)-y1(k-1))
and matrix S(nm) is computed as:
n=1...2
S(n,1) = dE(n,k)/dy1(k-1)
S(n,2) = dE(n,k)/dy1(k-1)
S(n,3) = dE(n,k)/dy2(k)
S(n,4) = dE(n,k)/dy2(k)
Can someone help me?
thank you very much
PS I saw a similar post dated on 5-6-2006 but I diddnt understand so much (and i would like NOT to change my "x" ...)