Solving 4 equations with 4 unknowns.
5 views (last 30 days)
i have been trying to solve 4 equations with 4 unknowns but the result the code has been producing each time is a structure with values of 4 variables all equal to 0. Shown below is the code and the error.
% velocity of EM signal propagation %
c = 3e8; % meters per second %
% assuming errors for reference station %
Ir = 10e-9; % Ionospheric error, seconds %
Tr = 1.5e-9; % Tropospheric error, sedconds %
Er = 12e-9; % Ephemeris error, seconds %
Mr = 1e-9; % Multipath error, seconds %
Rr = 1e-9; % Reciever's noise, seconds %
Dr = 0.5e-9; % Dilution of precsion, seconds %
%total error in reference station's pseudorange%
Tr = c*(Ir + Tr + Er + Mr + Rr + Dr);
% Assumed pseudoranges of the satellites 1,2,3 and 4 from the user U %
Ru1 = 222;
Ru2 = 234;
Ru3 = 246;
Ru4 = 258;
equation1 = Ru1 - ((((S1(1,1) - x)^2 + (S1(1,2) - y)^2 + (S1(1,3) -z)^2)^0.5) + c*t + Tr);
equation2 = Ru2 - ((((S2(1,1) - x)^2 + (S2(1,2) - y)^2 + (S2(1,3) -z)^2)^0.5) + c*t + Tr);
equation3 = Ru3 - ((((S3(1,1) - x)^2 + (S3(1,2) - y)^2 + (S3(1,3) -z)^2)^0.5) + c*t + Tr);
equation4 = Ru4 - ((((S4(1,1) - x)^2 + (S4(1,2) - y)^2 + (S4(1,3) -z)^2)^0.5) + c*t + Tr);
sol = solve(equation1,equation2,equation3,equation4);
thank y'all for your inputs in advance.
Edited: Nikhil Sonavane on 31 Jan 2020
You can refer to the Tips section of the documention of solve function. It states that "If solve cannot find a solution and ReturnConditions is true, solve returns an empty solution with a warning. If no solutions exist, solve returns an empty solution without a warning". I would suggest you check if your system of equations have a solution.