필터 지우기
필터 지우기

Solving a System of Equations

조회 수: 1 (최근 30일)
Konstantinos
Konstantinos 2013년 11월 11일
댓글: Walter Roberson 2013년 11월 11일
I am experiencing difficulties in solving the following system of equations: Υ=Χ+Α-Β*e^(-Χ/6), Υ= -10log[10^(1.76)-10^(-X/10)], where A and B are parameters defined by the user (i.e A=5, B=4). Any help could be useful. Thanks in advance!

채택된 답변

Walter Roberson
Walter Roberson 2013년 11월 11일
You will need to solve this numerically. Subtract one from the other, numerically solve for a 0. Along the way you will need to decide if you are wanting natural logs or log10 .
Caution: this is pretty sensitive numerically, especially near X = -17.6
  댓글 수: 2
Konstantinos
Konstantinos 2013년 11월 11일
************************************************************************
clc;
clear all;
fprintf('This program solves the system of equations which have the following form:\nY=X+A-Be^(-X/6)\nY=-10*log[10^(1.76)-10^(-X/10)]\n')
syms OBO IBO
[IBO1,OBO1]=solve('OBO=IBO+6-6*exp(IBO/6)','10^(-IBO/10)+10^(-OBO/10)=10^1.76') ********************************************************************** this peace of code works and gives me the necessary results because I set A=6 , B=6. The problem appears when I want the user to set A and B. To achieve this i use the following lines: ************************************************************************
clc;
clear all;
fprintf('This program solves the system of equations which have the following form:\nY=X+A-Be^(-X/6)\nY=-10*log[10^(1.76)-10^(-X/10)]\n')
syms OBO IBO
syms A B
A=input('Enter the value of the variable A: ');
B=input('Enter the value of the variable B: ');
[IBO1,OBO1]=solve('OBO=IBO+A-B*exp(IBO/6)','10^(-IBO/10)+10^(-OBO/10)=10^1.76') ***********************************************************************************
Walter Roberson
Walter Roberson 2013년 11월 11일
eqn1 = sym('OBO=IBO+A-B*exp(IBO/6)');
eqn2 = sym('10^(-IBO/10)+10^(-OBO/10)=10^1.76');
sA = sym('A');
sB = sym('B');
seqn1 = subs(eqn1, {sA, sB}, {A, B});
seqn2 = subs(eqn2, {sA, sB}, {A, B});
solve(seqn1, seqn2)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by