用Mathematica 利用非线性最小二乘法 实现曲线拟合 盼您回信数据{0,0},{0.115,0.11},{0.173,0.14},{0.231,0.24},{0.346,0.29},{0.461,0.31},{0.5,0.32} 模型是 D^2/[D^2 + (0.7 D + 2416.4)^2]*(Sin[0.5*x*Sqrt[D*D + (0.84 D + 2899.7)^2]])
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 18:20:32
用Mathematica 利用非线性最小二乘法 实现曲线拟合 盼您回信数据{0,0},{0.115,0.11},{0.173,0.14},{0.231,0.24},{0.346,0.29},{0.461,0.31},{0.5,0.32} 模型是 D^2/[D^2 + (0.7 D + 2416.4)^2]*(Sin[0.5*x*Sqrt[D*D + (0.84 D + 2899.7)^2]])
用Mathematica 利用非线性最小二乘法 实现曲线拟合 盼您回信
数据{0,0},{0.115,0.11},{0.173,0.14},{0.231,0.24},{0.346,0.29},{0.461,0.31},{0.5,0.32} 模型是 D^2/[D^2 + (0.7 D + 2416.4)^2]*(Sin[0.5*x*Sqrt[D*D + (0.84 D + 2899.7)^2]])^2 ----3个方程合为一体 所以有点麻烦
Q1 利用非线性最小二乘法 实现曲线拟合
Q2 求出方程中 D的值
几个月前 经您指导 我照葫芦画瓢 写了代码 但是怎么也运行不了 请您指教
data = {{0,0},{0.115,0.11},{0.173,0.14},{0.231,0.24},{0.346,
0.29},{0.461,0.31},{0.5,0.32}};
model = D^2/[D^2 + (0.7 D + 2416.4)^2]*(Sin[0.5*x*Sqrt[D*D + (0.84 D + 2899.7)^2]])^2;
fit = FindFit[data,{model,{D >= 0}},{D},x]
modelf = Function[{x},Evaluate[model /.fit]]
Plot[modelf[x],{x,0,0.5},Epilog -> Map[Point,data]]
Methematica上面 提示的错误如下
Syntax::sntxf:"D^2/" cannot be followed by "[D^2+(0.7D+2416.4)^2]".
Syntax::tsntxi:"[D^2+(0.7D+2416.4)^2]" is incomplete; more input is needed.
Syntax::sntxi:Incomplete expression; more input is needed.
用Mathematica 利用非线性最小二乘法 实现曲线拟合 盼您回信数据{0,0},{0.115,0.11},{0.173,0.14},{0.231,0.24},{0.346,0.29},{0.461,0.31},{0.5,0.32} 模型是 D^2/[D^2 + (0.7 D + 2416.4)^2]*(Sin[0.5*x*Sqrt[D*D + (0.84 D + 2899.7)^2]])
呃,一个简单的笔误而已...
data = {{0,0},{0.115,0.11},{0.173,0.14},{0.231,0.24},{0.346,
0.29},{0.461,0.31},{0.5,0.32}};
model = D^2/(D^2 + (0.7 D + 2416.4)^2)*(Sin[
0.5*x*Sqrt[D*D + (0.84 D + 2899.7)^2]])^2;
fit = FindFit[data,{model,{D >= 0}},{D},x]
注意仅仅是把model的表达式的一组[]改成了().
运行前三行代码,结果为
{D -> 1.03161}
其实错误提示已经说得比较明显了,