필터 지우기
필터 지우기

Solving a set of simultaneous equations

조회 수: 2 (최근 30일)
MarshallSc
MarshallSc 2022년 4월 8일
댓글: Alex Sha 2022년 4월 9일
I have the following set of simultaneous equations that I want to solve. I'm just confused as to what solver is the best choice!
Can it be even solved?
a = 0.5;
sqrt(x1^2 + a*x1*x2 + a*x1*x3 + a*x1*x4) = 30;
sqrt(a*x2*x1 + x2^2 + a*x2*x3 + a*x2*x4) = 33;
sqrt(a*x3*x1 + a*x3*x2 + x3^2 + a*x3*x4) = 25;
sqrt(a*x4*x1 + a*x4*x2 + a*x4*x3 + x4^2) = 10;
Thank you!
  댓글 수: 1
Alex Sha
Alex Sha 2022년 4월 9일
There will be multi-solution if no range limition:
No. x1 x2 x3 x4
1 -27.5584616528484 -31.4642304277135 -21.2013312551081 42.4667927458073
2 27.5584616528484 31.4642304277135 21.2013312551081 -42.4667927458073
3 21.092393187031 24.5327728282962 15.6460319211707 2.9752314576261
4 -35.124387658461 55.4211403974195 -28.2016268231437 -8.21718324886969
5 35.124387658461 -55.4211403974195 28.2016268231437 8.21718324886969
6 46.8115886629648 -42.6760633957222 -31.4217676113028 18.926670615613
7 -39.7163903825374 49.5555904803269 -32.6637611270595 17.2196122200305
8 39.7163903825374 -49.5555904803269 32.6637611270595 -17.2196122200305
9 -46.8115886629648 42.6760633957222 31.4217676113028 -18.926670615613
10 31.8811243735484 35.9706867855451 -49.7196043306907 6.44640901641614
11 -31.8811243735484 -35.9706867855451 49.7196043306907 -6.44640901641614
12 36.4849054651774 40.6839971426023 -42.3597267431898 -21.95861020684
13 -36.4849054651774 -40.6839971426023 42.3597267431898 21.95861020684
14 53.1637277627363 -38.0038803965751 -26.9964048344445 -7.46949936450619
15 -53.1637277627363 38.0038803965751 26.9964048344445 7.46949936450619

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

채택된 답변

Torsten
Torsten 2022년 4월 8일
a = 0.5;
fun =@(x1,x2,x3,x4) [x1^2 + a*x1*x2 + a*x1*x3 + a*x1*x4 - 30^2;...
a*x2*x1 + x2^2 + a*x2*x3 + a*x2*x4 - 33^2;...
a*x3*x1 + a*x3*x2 + x3^2 + a*x3*x4 - 25^2;...
a*x4*x1 + a*x4*x2 + a*x4*x3 + x4^2 - 10^2];
x = fsolve(@(x)fun(x(1),x(2),x(3),x(4)),[1 1 1 1])
fun(x(1),x(2),x(3),x(4))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by