1 / 16

数学实验

数学实验. 李尚志 教授 中国科学技术大学数学系. 实验十:寻优. 10 .1 光的折射定律 光在同一种介质中走最短路线(直线), 聪明! 从一种介质进入另一种介质发生折射, 傻了?. 问题:. 设光在两种介质中的速度比为 u, 两介质分界线为直线。从第一介质的 A 点到第二介质的 B 点,走怎样的路线时间最短?. 求 f(x) 的最小值. 1) 利用Mathematica: 画出 y=f(x) 的图象,观察最小值点的近似位置 x=c.

Download Presentation

数学实验

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 数学实验 李尚志 教授 中国科学技术大学数学系

  2. 实验十:寻优 • 10.1 光的折射定律 • 光在同一种介质中走最短路线(直线),聪明! • 从一种介质进入另一种介质发生折射,傻了?

  3. 问题: • 设光在两种介质中的速度比为 u,两介质分界线为直线。从第一介质的A点到第二介质的B点,走怎样的路线时间最短?

  4. 求 f(x) 的最小值 • 1)利用Mathematica: • 画出 y=f(x) 的图象,观察最小值点的近似位置x=c. • 运行语句 FindMinimum[f,{x,c}]

  5. 2) 0.618 搜索法(求每一点的 f 值需花成本): • 确定最初的搜索区间[a,b] • 记d=b-a. 插入两分点 x1= a+0.382d (0.382点)x2= a+0.618d (0.618点) • 求出 f(x1),f(x2).

  6. 如果f(x1)优于f(x2),用[a,x2] 代替[a,b]。 x1已是0.618点,只须再求0.382点的值。 • 否则,用[x1,b]代替[a,b]。 • 不断重复以上过程。

  7. 10.2 奔向最优点 • 问题:设A,B,C是平面上三点。求点P(x,y)到三点距离之和 s=f(x,y) 最小。 • Mathematica语句:FindMinimum[f[x,y],{x,x0},{y,y0}]

  8. 多元搜索:最速下降法 • 从初始位置P0(x0,y0)出发 • 求P0点及点(x0+d,y0), (x0,y0+d)的f值s0,s1,s2。 • u=(s1-s0)/d,v=(s2-s0)/d. • 梯度方向G=(u,v).

  9. 最快下降方向 - G=(-u,-v) • 选步长 h。从 P0 到 P1(x0-hu,y0-hv)。 • 从 P1出发再前进。

  10. 10.3最小二乘法 • 数据点集t={(xi,yi)}. • 用直线 y=kx+b 去拟合,使所有 kxi+b-yi 的平方和 s(k,b)最小。 • Fit[t,{1,x},x]

  11. 实验十一: 最速降线 • 重力场中高度不同的两点A,B。 • 在A静止的质点沿怎样的路径下滑到B点,时间最少?

  12. 时间的计算 • 设A(0,0),B(a,h). • 将x区间[0,a]平均分成n段:xi=ia/n,i=0,1,2,…,n. • 曲线上的点Pi(xi,yi)将曲线分成n段,逐段计算时间T。

  13. 寻找最速降线 • 求T=f(y1,y2,…,yn-1 )的最小值点(y1,y2,…,yn-1 ) 。 • 用光滑曲线连接点Pi • 等时曲线

  14. 最速降线的形状

  15. 网上实验室 网址: • 202.38.68.76/~mathexp/ • 或:http://www.ustc.edu.cn  院系介绍数学系常用连接  网上数学实验

  16. The End • 再见

More Related