フィルターのクリア

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 Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by