i dont know why there is no anwser about this 'solve'

조회 수: 1 (최근 30일)
cehua liu
cehua liu 2023년 3월 8일
편집: Torsten 2023년 3월 9일
clc;
close all;
clear;
a1=20;
b1=20;
k1=sqrt((a1+10)^2+b1^2)-sqrt((a1-10)^2+b1^2)
syms a b k;
equ2= a==20;
equ3= b==20;
equ1= k==sqrt((a+10)^2+b^2)-sqrt((a-10)^2+b^2);
k=solve(equ1,equ2,equ3,k)

채택된 답변

Fabio Freschi
Fabio Freschi 2023년 3월 8일
편집: Fabio Freschi 2023년 3월 8일
Your call to solve is incorrect
clear all
syms a b k
equ2= a==20;
equ3= b==20;
equ1= k==sqrt((a+10)^2+b^2)-sqrt((a-10)^2+b^2);
sol=solve([equ1; equ2; equ3],[k a b])
sol = struct with fields:
k: 1300^(1/2) - 500^(1/2) a: 20 b: 20

추가 답변 (1개)

Torsten
Torsten 2023년 3월 8일
편집: Torsten 2023년 3월 8일
Three equations need three unknowns, not only one.
clc;
close all;
clear;
a1=20;
b1=20;
k1=sqrt((a1+10)^2+b1^2)-sqrt((a1-10)^2+b1^2)
k1 = 13.6948
syms a b k
equ2= a==20;
equ3= b==20;
equ1= k==sqrt((a+10)^2+b^2)-sqrt((a-10)^2+b^2);
sol=solve([equ1,equ2,equ3],[a b k])
sol = struct with fields:
a: 20 b: 20 k: 1300^(1/2) - 500^(1/2)
k = double(sol.k)
k = 13.6948
  댓글 수: 3
cehua liu
cehua liu 2023년 3월 8일
clc;
close all;
clear;
syms a b;
equ1= sqrt((a+10)^2+b^2)-sqrt((a-10)^2+b^2)==sqrt((20+10)^2+20^2)-sqrt((20-10)^2+20^2);%a=b=20
equ2= a>=0;
equ3= b>=0;
sol=solve([equ1;equ2;equ3],[a b]);
a=sol.a
sir,i am sorry.if i have only tow unknowns,but three equations are needed.,What should we do in this case.
Then why can't the above code run correctly? Isn't there a clear result of 20
Torsten
Torsten 2023년 3월 9일
편집: Torsten 2023년 3월 9일
All the points on the blue curve below are solutions. MATLAB cannot list all of them - thus it lists none.
hold on
fimplicit(@(a,b)sqrt((a+10).^2+b.^2)-sqrt((a-10).^2+b.^2)-(sqrt((20+10)^2+20^2)-sqrt((20-10)^2+20^2)),[0 40 0 40])
plot(20,20,'o')
hold off
grid on

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by