Solving 4 equations with 4 unknowns.

조회 수: 5 (최근 30일)
Himalay Desai
Himalay Desai 2020년 1월 29일
댓글: Walter Roberson 2020년 1월 31일
hello everyone!
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;
syms x
syms y
syms z
syms t
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.

답변 (2개)

Nikhil Sonavane
Nikhil Sonavane 2020년 1월 31일
Can you share S1, S2 and S3 matrices which you are using?
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 1월 31일
They just happen to be completely visible in the image of the IDE:
S1 = [118, 118, 117];
S2 = [130, 130, 130];
S3 = [140, 140, 140];
S4 = [152, 152, 152];

댓글을 달려면 로그인하십시오.


Nikhil Sonavane
Nikhil Sonavane 2020년 1월 31일
편집: Nikhil Sonavane 2020년 1월 31일
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.
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 1월 31일
Maple is not finding any solution. I am working on some step-by-step work in Maple that just might find a solution.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by