フィルターのクリア

system of equations (solve exponentiel equations

1 回表示 (過去 30 日間)
Marwen Tarhouni
Marwen Tarhouni 2018 年 9 月 10 日
コメント済み: madhan ravi 2018 年 9 月 12 日
Hi,
I want to solve this system of equations
P= exp(-r.^2.*P+R.^2.*Q).*sum((r.^2.*P +R.^2.*Q).^m./factorial(m)) // with m=(0:1:k-1); ;k=5
Q=exp(-r.^2.*P + R.^2.*Q.*sum((r.^2*P + R.^2.*Q).^n./factorial(n)) // n=(k:1:K_avg); K_avg=10
I tried to solve this system with solve. the result of execution : error eqns.
do you have an idea ?
th = -80:-3:-106;
list1 = zeros(size(th));
list2 = zeros(size(th));
r=[ 15.8 20.8 27.5 36.3 47.6 63.9 83.1 109.6 115.2];
R=[ 8.12 10.9 14.4 19.2 25.6 33.1 43.5 75.6 80.2];
for i = 1:numel(th)
K_avg=17;
k=9;
m=(0:1:k-1);
n=(k:1:K_avg);
syms P Q
eqns= [exp(-r.^2.*P+R.^2.*Q).*sum((r.^2.*P +R.^2.*Q).^m./factorial(m))-P==0,exp(-r.^2.*P + R.^2.*Q.*sum((r.^2*P + R.^2.*Q).^n./factorial(n))-Q==0)];
vars = [P Q];
[sol1,sol2]=solve(eqns,vars);
list1(i) = sol1;
list2(i) = sol2;
end

採用された回答

madhan ravi
madhan ravi 2018 年 9 月 10 日
@Marwen you get error/s because the number of elements m,n and R,r are not the same in order to make the loop perform calculations all the arrays should have the same number of elements.
  9 件のコメント
Marwen Tarhouni
Marwen Tarhouni 2018 年 9 月 12 日
@madhan ravi, thank you :problem solved
madhan ravi
madhan ravi 2018 年 9 月 12 日
@Marwen your welcome.

サインインしてコメントする。

その他の回答 (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