51 views (last 30 days)

x_p, y_p, z_p=(4, 5, 2)

x_1, y_1, z_1=(8, 9, 5)

x_2, y_2, z_2=(2, 5, 1)

x_3, y_3, z_3=(6, 1, 3)

t_1=5.692820*10^-9

t_2=-2.924173*10^-9

t_3=-12.010097*10^-9

c=3.0*10^8

and my three equations are

eqn1 = sqrt((x(s)-x_p)^2+(y(s)-y_p)^2+(z(s)-z_p)^2)-sqrt((x(s)-x_1)^2+(y(s)-y_1)^2+(z(s)-z_2)^2)-(c*t_1)

eqn2 = sqrt((x(s)-x_p)^2+(y(s)-y_p)^2+(z(s)-z_p)^2)-sqrt((x(s)-x_2)^2+(y(s)-y_2)^2+(z(s)-z_2)^2)-(c*t_1)

eqn3 = sqrt((x(s)-x_p)^2+(y(s)-y_p)^2+(z(s)-z_p)^2)-sqrt((x(s)-x_3)^2+(y(s)-y_3)^2+(z(s)-z_3)^2)-(c*t_1)

where only x(s), y(s), z(s) are unknown are rest all are known

BEST REGARDS

Walter Roberson
on 29 Sep 2020 at 4:03

x_p = 4; y_p = 5; z_p = 2;

x_1 = 8; y_1 = 9; z_1 = 5;

x_2 = 2; y_2 = 5; z_2 = 1;

x_3 = 6; y_3 = 1; z_3 = 3;

t1 = 5.692820*10^-9;

t2 = -2.924173*10^-9;

t3 = -12.010097*10^-9;

syms xs ys zs %our unknowns

syms c %constant not given in question

eqn1 = sqrt((xs-x_p)^2+(ys-y_p)^2+(zs-z_p)^2)-sqrt((xs-x_1)^2+(ys-y_1)^2+(zs-z_2)^2)-(c*t1);

eqn2 = sqrt((xs-x_p)^2+(ys-y_p)^2+(zs-z_p)^2)-sqrt((xs-x_2)^2+(ys-y_2)^2+(zs-z_2)^2)-(c*t2);

eqn3 = sqrt((xs-x_p)^2+(ys-y_p)^2+(zs-z_p)^2)-sqrt((xs-x_3)^2+(ys-y_3)^2+(zs-z_3)^2)-(c*t3);

sol = solve([eqn1, eqn2, eqn3], [xs, ys, zs]);

disp(sol.xs)

disp(sol.ys)

disp(sol.zs)

the values will be parameterized in c, which you indicate is a known value, but which you did not provide a value for.

There are two solutions for each variable.

You should probably re-substitute the solutions and verify that the values work, as MATLAB warns that some of the solutions produced might no be true solutions.

Walter Roberson
on 30 Sep 2020 at 10:26

Installing R2014a is getting to be a distinct nuisance. R2014a does not work with an operating system as new as mine. I created some virtual machines for operating system versions old enough that they supported R2014a, and I installed two different operating systems and as well a third that I had an existing virtual machine for -- but the MATLAB installer would not run on any of them, due to some kind of Java problems...

I would have to install an old operating system onto a hard drive partition in order to install R2014a.... unless I can manage to get it running on one of my old Windows virtual machines.

Walter Roberson
on 30 Sep 2020 at 16:39

That is not 6 possible solutions, that is two solutions with three components each.

possibleSol(:, all(possibleSol>0 & imag(possibleSol)==0, 1))

Opportunities for recent engineering grads.

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

Start Hunting!
## 1 Comment

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/601690-solution-of-3d-nonlinear-equation#comment_1028875

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/601690-solution-of-3d-nonlinear-equation#comment_1028875

Sign in to comment.