How to solve 4 nonlinear equations (in 4 unknowns) ITERATIVELY
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi,
Please help me in solving 4 nonlinear equations ITERATIVELY...
a1, b1, c1 d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4, k1, k2, k3 all are known
(a1-x(1))^2+(a2-x(2))^2+(a3-x(3))^2-x(4)^2=0
(b1-x(1))^2+(b2-x(2))^2+(b3-x(3))^2-k1*(x(4))^2=0
(c1-x(1))^2+(c2-x(2))^2+(c3-x(3))^2-k2*(x(4))^2=0
(d1-x(1))^2+(d2-x(2))^2+(d3-x(3))^2-k3*(x(4))^2=0
*I know how to solve them using solve command to get just a single solution*
Help!
Thanks
댓글 수: 0
채택된 답변
Andrei Bobrov
2011년 11월 19일
variant
a = rand(4);
a(1,end) = 1;
f1 = @(x)sum(bsxfun(@minus,a(:,1:end-1),reshape(x(1:end-1),1,[])).^2,2) - a(:,end)*(x(end)^2);
x = fsolve(f1,randi(12,4,1));
댓글 수: 3
Andrei Bobrov
2011년 11월 21일
in our case:
a = [a1 a2 a3 1
b1 b2 b3 k1
c1 c2 c3 k2
d1 d2 d3 k3]
x = [x(1);x(2);x(3);x(4)]
추가 답변 (1개)
Nuno
2015년 5월 7일
편집: Nuno
2015년 5월 7일
this can be applied to this I have x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4
(x0-x1)^2+(y0-y1)^2+(z0-z1)^2=r^2
(x0-x2)^2+(y0-y2)^2+(z0-z2)^2=r^2
(x0-x3)^2+(y0-y3)^2+(z0-z3)^2=r^2
(x0-x4)^2+(y0-y3)^2+(z0-z4)^2=r^2
I need to get x0,y0,z0 and r.
I applied that code and the results are very weird
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!