How to solve 4 nonlinear equations (in 4 unknowns) ITERATIVELY

8 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Andrei Bobrov
Andrei Bobrov il 19 Nov 2011
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 Commenti
manish sharma
manish sharma il 29 Nov 2011
Thanks,
BTW I got the desired results by using Newton Raphson method for solving a sysytem of non linear equations.
Bye

Accedi per commentare.

Più risposte (1)

Nuno
Nuno il 7 Mag 2015
Modificato: Nuno il 7 Mag 2015
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

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by