i m in trouble about global function

4 ビュー (過去 30 日間)
관 윤
관 윤 2021 年 1 月 28 日
編集済み: Walter Roberson 2021 年 1 月 28 日
function [temperature] = findSpinodal(x2,omegaSolid)
[temperature,eval] = fsolve(@(temperature) x2-(x2)^2-1.9858775*temperature/(2*omegaSolid),650);
[temperature,eval] = fsolve(@(temperature) x2-(x2)^2-1.9858775*temperature/(2*omegaSolid),450);
end
is this mean "solve @(temparture) brrbrbrbrbrr starting from 650"
then why they're use eval in [temparture, eval] ^^; so hard

採用された回答

Walter Roberson
Walter Roberson 2021 年 1 月 28 日
編集済み: Walter Roberson 2021 年 1 月 28 日
yes it does mean to try to find the temperature that makes the expression 0 and to start at 650.
However, you should just rewrite and solve directly.
x2-(x2)^2-1.9858775*temperature/(2*omegaSolid) == 0
x2-(x2)^2 == 1.9858775*temperature/(2*omegaSolid)
(x2-(x2)^2)*(2*omegaSolid) == 1.9858775*temperature
and so temperature is the left side divided by the 1.98 constant. No need to search.

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by