フィルターのクリア

How to perform iteration calculations

1 回表示 (過去 30 日間)
dj
dj 2014 年 10 月 18 日
コメント済み: dj 2014 年 10 月 18 日
If we are given a set of data and we know that (Tx-T9)/(T1-T9) = cosh[m(L-x)]/cosh(mL), where the only unknown is m, how could we do the iteration calculations on Matlab?
Can we simply solve for m or is the iteration process necessary? We are assuming that m is initially equal to 7.4 m^-1. I tried using Excel for iteration calculations, but I couldn't obtain the value for m for the last 3 temperatures.
Thank you for your help!

採用された回答

Matt J
Matt J 2014 年 10 月 18 日
編集済み: Matt J 2014 年 10 月 18 日
You can use fzero,
fun=@(m) norm((Tx-T9)./(T1-T9) - cosh(m(L-x))./cosh(mL));
m = fzero(fun,m0);
Here m0=7.4 is your initial guess. You could also plot the function and look for an approximate root graphically.
  3 件のコメント
Matt J
Matt J 2014 年 10 月 18 日
編集済み: Matt J 2014 年 10 月 18 日
Sorry, I thought x was a vector of data, in which case you would use fminsearch instead of fzero. But since all data are scalars, you can do as follows,
L = 0.35; T9 = 27.4; T1 = 49.7; Tx = 42.5; x = 0.05; m0 = 7.4;
A=(Tx-T9)./(T1-T9); %pre-compute to conserve computation
B=L-x;
fun=@(m) A- cosh(m*B)./cosh(m*L);
[m,fval] = fzero(fun,m0)
from which I get the result
m =
7.8930
fval =
0
dj
dj 2014 年 10 月 18 日
x was a vector of data (x1, ...xn), but I just decided to type in values one by one 'cause I didn't know how to calculate all of the values at the same time, haha. I was wondering why I couldn't get a nice enough answer, but I realized that I was using the wrong values for T9. Thank you so much!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by