传送门

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Special Judge

Problem Description
There is a river on the Cartesian coordinate system,the river is flowing along the x-axis direction.

Rower Bo is placed at $(0,a)$ at first.He wants to get to origin $(0,0)$ by boat.Boat speed relative to water is $v_1$,and the speed of the water flow is $v_2$.He will adjust the direction of $v_1$ to origin all the time.

Your task is to calculate how much time he will use to get to origin.Your answer should be rounded to four decimal places.

If he can't arrive origin anyway,print "Infinity" (without quotation marks).

Input
There are several test cases. (no more than 1000)

For each test case,there is only one line containing three integers $a,v_1,v_2$.

$0\le a\le 100, 0\le v1,v2,\le 100, a,v_1,v_2$ are integers

Output
For each test case,print a string or a real number.

If the absolute error between your answer and the standard answer is no more than $10^{-4}$, your solution will be accepted.

Sample Input

2 3 3
2 4 3

Sample Output

Infinity
1.1428571429

Source
2016 Multi-University Training Contest 3


这题在现场做的时候试图直接解微分方程,但微分方程推出来却发现没法解,但题解上说,直接解微分方程可以搞,可能是我推微分方程的姿势不对,有待研究,微积分快忘干净了,好惨。

我现场的思路是:

考虑直角坐标下的运动学方程:

\begin{align} \frac{dx}{dt} &= v_2-\frac{x}{\sqrt{x^2+y^2}}v_1  \\       \frac{dy}{dt} &= -\frac{y}{\sqrt{x^2+y^2}}v_1  \end{align}

注意到如果将运动学方程写成直角坐标$(r,\theta)$的形式会更方便:

由$x=r\cos{\theta}, y=r\sin{\theta}, r=\sqrt{x^2+y^2}$, 上面两式可化成:

\begin{align} \cos{\theta} \, \dot{r} -\dot{\theta}\sin{\theta} \, r &= v_2-v_1\cos{\theta} \\ \sin{\theta} \, \dot{r} + \cos{\theta} \, \dot{\theta} r &= -v_1\sin{\theta} \end{align}

由上述两方程可解出$\dot{r}, r$:

\begin{align} \dot{r} &= v_2\cos{\theta}-v_1 \\  r &= -\frac{v_2\sin{\theta}}{\dot{\theta}}   \end{align}

将上两式代入

\begin{align}  \dot{r}=\frac{dr}{dt}   \end{align}

\begin{align}  \frac{v_2\sin{\theta} \, \ddot{\theta}}{\dot{\theta}^2}-v_2\cos{\theta} = v_2\cos{\theta}-v_1  \end{align}

要从这个微分方程解出$\theta=\theta(t)$比较困难,我目前还解不出。

这个微分方程是可解的:

\[ \frac{d\theta}{dt} = f \]

\[ \frac{d^2\theta}{dt^2} = \frac{df}{dt} =\frac{df}{d\theta}\frac{d\theta}{dt} = \frac{df}{d\theta}f \]

将上两式代入原方程,得

\[ \frac{df}{f} = \frac{2v_2\cos{\theta} - v_1}{v_2 \sin{\theta}} d\theta = (2\cot{\theta} -\frac{v_1}{v_2}\csc{\theta}) d\theta \]

积分得

\[ \ln{f} = 2\ln{| \sin{\theta} |} - \frac{v_1}{v_2}\ln{| \csc{\theta} -\cot{\theta} |} +C_1 \]

\[ f(\theta) = C_2\frac{\sin^2{\theta}} {|\csc{\theta}-\cot{\theta}|^{ \frac {v_1} {v2} } } \]

但到这一步貌似也没什么用,就算把右边的关于$\theta$的积分积出来,还要再求反函数才能得到$\theta (t)$。再次好惨。。

可能如果选择解$r=r(t)$会简单一点,再试试吧。。逃。。。


题解上给出的做法是:

\[ \frac{dr}{dt} = v_2\cos{\theta}-v_1 \]

\[ \frac{dx}{dt} = v_2-\frac{x}{\sqrt{x^2+y^2}}v_1 = v_2 - v_1 \cos{\theta}\]

实际上第一式($\frac{dr}{dt}$的表达式)可直接写出来,不需要像上面那样去推导。由于题目已说明船相对于水流的速度时刻指向原点,那么自然有$ \frac{dr}{dt} = v_2\cos{\theta}-v_1 $

两式对$t$积分,从时刻$0$积到(到达原点的)时刻$T$,这两个定积分就写成:

\[ 0-a = - v_1T + v_2\int_{0}^{T}{\cos{\theta} \, \text{d}\theta}  \]

\[0-0 = v_2T - v_1 \int_{0}^{T}{\cos{\theta} \, \text{d}\theta} \]

这样便可解出

\[ T = \frac{v_1a}{v_1^2 - v_2^2} \]

从而不能到达原点的情况是 $a>0$且$v_1\le v_2$。

HDU 5761 Rower Bo的更多相关文章

  1. hdu 5761 Rower Bo 物理题

    Rower Bo 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5761 Description There is a river on the Ca ...

  2. hdu 5761 Rower Bo 微分方程

    Rower Bo Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total ...

  3. 【数学】HDU 5761 Rower Bo

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5761 题目大意: 船在(0,a),船速v1,水速v2沿x轴正向,船头始终指向(0,0),问到达(0, ...

  4. hdu 5761 Rowe Bo 微分方程

    1010 Rower Bo 首先这个题微分方程强解显然是可以的,但是可以发现如果设参比较巧妙就能得到很方便的做法. 先分解v_1v​1​​, 设船到原点的距离是rr,容易列出方程 \frac{ dr} ...

  5. hdu-5761 Rower Bo(数学)

    题目链接: Rower Bo Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 131072/131072 K (Java/Others ...

  6. HDU 5761 物理题

    Rower Bo Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total ...

  7. HDU 5752 Sqrt Bo (数论)

    Sqrt Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5752 Description Let's define the function f ...

  8. HDU 5753 Permutation Bo (推导 or 打表找规律)

    Permutation Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5753 Description There are two sequen ...

  9. HDU 5762 Teacher Bo (暴力)

    Teacher Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5762 Description Teacher BoBo is a geogra ...

随机推荐

  1. 纯手工打造漂亮的瀑布流,五大插件一个都不少Bootstrap+jQuery+Masonry+imagesLoaded+Lightbox!

    前两天写的文章<纯手工打造漂亮的垂直时间轴,使用最简单的HTML+CSS+JQUERY完成100个版本更新记录的华丽转身!>受到很多网友的喜爱,今天特别推出姊妹篇<纯手工打造漂亮的瀑 ...

  2. [MCSM]随机搜索和EM算法

    1. 概述 本节将介绍两类问题的不同解决方案.其一是通过随机的搜索算法对某一函数的取值进行比较,求取最大/最小值的过程:其二则和积分类似,是使得某一函数被最优化,这一部分内容的代表算法是EM算法.(书 ...

  3. keypress,keydown,keyup,charCode,keyCode兼容性问题

    keypress对应的是字符编码,如“ABC”,“123”之类,有大小写之分(有兼容性问题) keydown,keyup对应的是键盘的键码,无大小写之分,每个键盘都有一个键码(无兼容性问题) 使用ke ...

  4. window php redis扩展下载地址

    redis扩展下载 http://windows.php.net/downloads/pecl/snaps/redis/

  5. 委托(delegate)

    委托(dekegate)是一种动态调用方法的类型,与类.接口和数组相同,属于引用型,可以用来实现多路广播(MulticastDelegate). 多路广播(MulticastDelegate):可以用 ...

  6. HTML5基础知识(4)--white-space属性

    1.white-space 属性设置如何处理元素内的空白. 这个属性声明建立布局过程中如何处理元素中的空白符.值 pre-wrap 和 pre-line 是 CSS 2.1 中新增的. 默认值: no ...

  7. 不停止MySQL服务的情况下修改root的密码

    首先我们得知道一个MySQL普通用户的密码 这里我来记录一下我的操作过程 这里我刚刚到一家公司上面装的是cacti,但是之前的运维不记得MySQL的root密码了 但是他知道cacti的密码, 用户: ...

  8. iOS开发遇到的错误 -- Label显示多行文字导致宽度和高度的问题

    Label的宽度问题 注意:UILabel下面需要设置preferredMaxLayoutWidth ,设置了autolayout和numberofline的UIlabel才显示多行 label宽度的 ...

  9. Shell命令_Cron使用

    chkconfig crond on d表示damon,后台进程 chkconfig --list | grep crond crontab [选项] 选项: -e: 编辑crontab定时任务 -l ...

  10. tomcat+javaWeb+spring的一个都市供求管理系统

    这个作为自己学习javaweb的第一个小项目,也是跟着视频自己学的,是来自java1234的小锋写的,那边有很多java视频可以作为学习参考哦 , 视频中使用的是tomcat作为后端,也( •̀ ω ...