POJ 1045:Bode Plot
| Time Limit: 1000MS | Memory Limit: 10000K | |
| Total Submissions: 13392 | Accepted: 8462 |
Description
(wt + q ) where VS is the voltage of the source,w is the frequency (in radians per second),
and t is time. VR is the magnitude of the voltage drop across the resistor, and q is its phase.

You are to write a program to determine VR for different values of w. You will need two laws of electricity to solve this problem. The first is Ohm's Law, which states v2 = iR where
i is the current in the circuit, oriented clockwise. The second is i = C d/dt (v1-v2) which relates the current to the voltage on either side of the capacitor. "d/dt"indicates the derivative with respect to t.
Input
will have one real number per line. Each of these numbers is the angular frequency, w.
Output
Sample Input
1.0 1.0 1.0 9
0.01
0.031623
0.1
0.31623
1.0
3.1623
10.0
31.623
100.0
Sample Output
0.010
0.032
0.100
0.302
0.707
0.953
0.995
1.000
1.000
水题,公式推导。话说真不能再总纠结这水题了,越做越水了现在。
v1 =
VS
v2 =
VRcos (wt + q )
v2 =
iR
C=d/dt (v1-v2)
即(v1-v2)
对t求导
已知Vs,C,R,w,求 VR。因为任意的t,等式都成立,所以对t取特殊值,解方程即可。
代码:
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std; int main()
{
double Vs,R,C,w;
int n,i;
cin>>Vs>>R>>C>>n; for(i=1;i<=n;i++)
{
cin>>w;
printf("%.3f",sqrt(1.0/(1+C*C*w*w*R*R))*C*w*R*Vs);
cout<<endl;
}
return 0;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。
POJ 1045:Bode Plot的更多相关文章
- POJ1045 Bode Plot
题目来源:http://poj.org/problem?id=1045 题目大意: 如图所示的交流电路,假设电路处于稳定状态,Vs为电源电压,w是频率,单位为弧度每秒,t表示时间. 则:V1 = Vs ...
- 九度oj 题目1045:百鸡问题
题目1045:百鸡问题 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:10418 解决:4559 题目描述: 用小于等于n元去买100只鸡,大鸡5元/只,小鸡3元/只,还有1/3元每只的一 ...
- POJ 3321:Apple Tree + HDU 3887:Counting Offspring(DFS序+树状数组)
http://poj.org/problem?id=3321 http://acm.hdu.edu.cn/showproblem.php?pid=3887 POJ 3321: 题意:给出一棵根节点为1 ...
- POJ 3252:Round Numbers
POJ 3252:Round Numbers Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 10099 Accepted: 36 ...
- 1045 Bode Plot
题目链接:http://poj.org/problem?id=1045 一道数学物理题, 推理公式:http://www.cnblogs.com/rainydays/archive/2013/01/0 ...
- [POJ] Bode Plot
Description Consider the AC circuit below. We will assume that the circuit is in steady-state. Thus, ...
- POJ 1459:Power Network(最大流)
http://poj.org/problem?id=1459 题意:有np个发电站,nc个消费者,m条边,边有容量限制,发电站有产能上限,消费者有需求上限问最大流量. 思路:S和发电站相连,边权是产能 ...
- POJ 3436:ACM Computer Factory(最大流记录路径)
http://poj.org/problem?id=3436 题意:题意很难懂.给出P N.接下来N行代表N个机器,每一行有2*P+1个数字 第一个数代表容量,第2~P+1个数代表输入,第P+2到2* ...
- POJ 2195:Going Home(最小费用最大流)
http://poj.org/problem?id=2195 题意:有一个地图里面有N个人和N个家,每走一格的花费是1,问让这N个人分别到这N个家的最小花费是多少. 思路:通过这个题目学了最小费用最大 ...
随机推荐
- 伪类:after,:before的用法
:after和:before是css3中的伪类元素.用法是像元素的前或者后插入元素.以after为例: li:after{ content: ''; color: #ff0000; } 意思是向li元 ...
- JS监听手机物理返回键,返回到指定页面
pushHistory(); window.addEventListener("popstate", function(e) { window.location = data.in ...
- selenium+chrome抓取淘宝宝贝-崔庆才思路
站点分析 源码及遇到的问题 在搜索时,会跳转到登录界面 step1:干起来! 先取cookie step2:载入cookie step3:放飞自我 关于phantomJS浏览器的问题 源码 站点分析 ...
- NoNodeAvailableException异常的解决
Elasticsearch 相关学习,昨天还好好的,今天就出错了!!! 完整异常为 : NoNodeAvailableException[None of the configured nodes ar ...
- 开源Web测试工具介绍
HtmlUnitHtmlUnit 是 JUnit 的扩展测试框架之一.HtmlUnit 将返回文档模拟成 HTML,这样您便可以直接处理这些文档了.HtmlUnit 使用例如 table.form 等 ...
- 二十一 JDK注解&注解案例
什么是注解? 注解和接口,类属于同一个级别 注解可以在变量.方法.类上加载 注解可以有属性也可以没有属性 注解是有作用范围(源码.编译期间,运行期间) 源码期间:例如String类上@Author ...
- jmeter断言之响应code:200
因为Jmeter只要检测到网页的响应,就认为是Pass而并不管当前网页内容的正确性.在进行压力测试时,为了检查Web服务器返回的网页是否正确,我们可以设置断言,这些断言是验证网页上是否存在指定的Tex ...
- Codestorm:Game with a Boomerang
题目连接:https://www.hackerrank.com/contests/codestorm/challenges/game-with-a-boomerang 上一篇博客不知怎么复制过来题目, ...
- 2-10 就业课(2.0)-oozie:8、定时任务的执行
4.5.oozie的任务调度,定时任务执行 在oozie当中,主要是通过Coordinator 来实现任务的定时调度,与我们的workflow类似的,Coordinator 这个模块也是主要通过xml ...
- VUE - vue.runtime.esm.js?6e6d:619 [Vue warn]: Do not use built-in or reserved HTML elements as component i
<script> export default { name:'header' // 不要使用内置或保留的HTML元素 , 改为Header或者置或保留的HTML元素 ...