how to solve singular matrix problem?
이전 댓글 표시
i am trying to write a code for krlov method for statical stabiltiy of ship, i am using interpolation for finding ordinates of ship. but i am getting error of singular matrix and error with vpasolve please help me.
clear
syms x1
heel=1;
wl=1;
offsets=xlsread('input','offset');
delta=xlsread('input','Displacements');
water_l=offsets(:,1);
for i=1:1:21
sub_offsets(:,i)=offsets(:,i+1);
emg_offsets(:,i)=-offsets(:,i+1);
end
theta=[0;10;20;30;45;60;75;90];
for i=1:1:13
for j=1:1:13
a(i,j)=power(sub_offsets(i),(j-1));
end
end
b=inv(a)*(water_l );
yw=tan(deg2rad(theta))*x1+ delta(1,wl);
y1=b(1,1)+(b(2,1)*x1)+(b(3,1)*x1.^2)+(b(4,1)*x1.^3);
xv = vpasolve(y1-yw==0,x1) % X-Value At Intersection
yv = subs(yw, x1, xv) % Y-Value At Intersection

채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!