Bode Plot
Time Limit: 1000MS   Memory Limit: 10000K
Total Submissions: 13392   Accepted: 8462

Description

Consider the AC circuit below. We will assume that the circuit is in steady-state. Thus, the voltage at nodes 1 and 2 are given by v1 = VS coswt and v2 = VRcos
(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

The input will consist of one or more lines. The first line contains three real numbers and a non-negative integer. The real numbers are VS, R, and C, in that order. The integer, n, is the number of test cases. The following n lines of the input
will have one real number per line. Each of these numbers is the angular frequency, w. 

Output

For each angular frequency in the input you are to output its corresponding VR on a single line. Each VR value output should be rounded to three digits after the decimal point.

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的更多相关文章

  1. POJ1045 Bode Plot

    题目来源:http://poj.org/problem?id=1045 题目大意: 如图所示的交流电路,假设电路处于稳定状态,Vs为电源电压,w是频率,单位为弧度每秒,t表示时间. 则:V1 = Vs ...

  2. 九度oj 题目1045:百鸡问题

    题目1045:百鸡问题 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:10418 解决:4559 题目描述: 用小于等于n元去买100只鸡,大鸡5元/只,小鸡3元/只,还有1/3元每只的一 ...

  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 ...

  4. POJ 3252:Round Numbers

    POJ 3252:Round Numbers Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 10099 Accepted: 36 ...

  5. 1045 Bode Plot

    题目链接:http://poj.org/problem?id=1045 一道数学物理题, 推理公式:http://www.cnblogs.com/rainydays/archive/2013/01/0 ...

  6. [POJ] Bode Plot

    Description Consider the AC circuit below. We will assume that the circuit is in steady-state. Thus, ...

  7. POJ 1459:Power Network(最大流)

    http://poj.org/problem?id=1459 题意:有np个发电站,nc个消费者,m条边,边有容量限制,发电站有产能上限,消费者有需求上限问最大流量. 思路:S和发电站相连,边权是产能 ...

  8. POJ 3436:ACM Computer Factory(最大流记录路径)

    http://poj.org/problem?id=3436 题意:题意很难懂.给出P N.接下来N行代表N个机器,每一行有2*P+1个数字 第一个数代表容量,第2~P+1个数代表输入,第P+2到2* ...

  9. POJ 2195:Going Home(最小费用最大流)

    http://poj.org/problem?id=2195 题意:有一个地图里面有N个人和N个家,每走一格的花费是1,问让这N个人分别到这N个家的最小花费是多少. 思路:通过这个题目学了最小费用最大 ...

随机推荐

  1. SpringBoot 入门demo

    创建SpringBoot项目方式一 (1)新建maven项目,不使用骨架. 使用maven管理依赖就行了,不必使用骨架(模板). (2)在pom.xml中添加 <!--springboot核心. ...

  2. MAC电脑如何播放.SWF文件

    很简单,不需要专门的播放器,只需要将.swf文件直接拖拽到浏览器页面就可以播放了. 亲测safari , 谷歌chrome浏览器,火狐浏览器 ,都是可以的 下面是图示 step1 电脑上找到swf文件 ...

  3. PHP获取远程图片

    <?php // // Function: 获取远程图片并把它保存到本地 // // // 确定您有把文件写入本地服务器的权限 // // // 变量说明: // $url 是远程图片的完整UR ...

  4. Java安全中的“大坑”,跨平台真“浮云”

    Java安全HttpDB 最近在做一个开源项目HttpDB,它的目标是在互联网中通过JDBC安全的查询数据库,解决云计算报表的数据库访问问题. 数据传输使用AES加密算法,用到了Java提供的安全库j ...

  5. 2017 青岛网络赛 Chenchen, Tangtang and ZengZeng

    Chenchen, Tangtang and ZengZeng are starting a game of tic-tac-toe, played on a 3 × 3 board. Initial ...

  6. NFC性价比高频读卡器首选方案:FM17550

    FM17550具有低电压.低功耗.驱动能力强.多接口支持.多协议支持等特点.适用于低功耗.低电压.低成本要求的非接触读写器应用,及NFC协议兼容的NFC设备. FM17550是一款高度集成的工作在13 ...

  7. iOS Framework制作流程

    1.新建工程选择iOS —> Cocoa Touch Framework 2.进入创建好的工程删除掉自带的工程同名头文件 3.添加所需文件 4.TARGETS —> Build Setti ...

  8. 【LeetCode】寻找右区间

    [问题] 给定一组区间,对于每一个区间 i,检查是否存在一个区间 j,它的起始点大于或等于区间 i 的终点,这可以称为 j 在 i 的“右侧”. 对于任何区间,你需要存储的满足条件的区间 j 的最小索 ...

  9. other#apache-commons

    if you want to be a better javaer, you should  spent time on apache commons.

  10. Day8 - G - Bound Found ZOJ - 1964

    Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronaut ...