how to solve singular matrix problem?
Afficher commentaires plus anciens
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

Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!