how to solve singular matrix problem?
Show older comments
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

Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!