Morse potential constants using matlab

4 ビュー (過去 30 日間)
Carc
Carc 2023 年 1 月 16 日
編集済み: Luca Ferro 2023 年 1 月 16 日
V(r)=D[exp(−2a(r−ro))−2exp(−a(r−ro))]: This is the mores potential equation. I have the data V(r) and r, how can I find the constant D, a, ro using matlab? I really don’t know how to start. Could you give me some advices?
  1 件のコメント
Jiri Hajek
Jiri Hajek 2023 年 1 月 16 日
Hi, this is a nonlinear regression problem, which is solvable using optimization methods. Depending on whether you need to automate the task by using programmatic solution, whether you need to use MATLAB to achieve this, whether you have access to optimization toolbox and what is the size of your data, it is surely solvable in MATLAB, but Excel may give you a solution as well...

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

回答 (1 件)

Luca Ferro
Luca Ferro 2023 年 1 月 16 日
編集済み: Luca Ferro 2023 年 1 月 16 日
try this:
syms D a ro ; %create symbolic scalar variables
eq = V==D*(exp(-2*a*(r-ro))-2*exp(-a*(r-ro))); %create equation
sol=solve(eq); %solve the equation
since you have 1 equation and 3 variables the output will be symbolic (assuming V and r are scalars)
EDIT:
as Walter Robertson highlighted in the comments, it's better to specify what to solve for:
sol=solve(eq, [ro a D]); %solve the equation
  3 件のコメント
Walter Roberson
Walter Roberson 2023 年 1 月 16 日
One equation cannot be solved for three variables.
When you do not specify which variable to solve for, MATLAB uses symvar to figure out which free variables exist in the equation(s). It has a priority order that starts with x y z. After prioritizing it uses the first on the list, as many as there are equations.
Luca Ferro
Luca Ferro 2023 年 1 月 16 日
編集済み: Luca Ferro 2023 年 1 月 16 日
Specifying all of three at least returns a struct with values for all of them.
With only one you get the symbolic solution, that's why i left it without specification in first place.
I don't know what the OP is looking for, so i gave him some alternatives after you pointed out the inaccuracy of my reply.

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

カテゴリ

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