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个家的最小花费是多少. 思路:通过这个题目学了最小费用最大 ...
随机推荐
- 使用input:file控件在微信内置浏览器上传文件返回未显示选择的文件
使用input:file控件在微信内置浏览器上传文件返回未显示选择的文件 原来的写法: <input type="file" accept="image/x-png ...
- 输入、输出(iostream)
在一个程序当中输入和输出都扮演着重要的角色,所以掌握基本输入输出是入门一门语言所必不可少的.本文主要简单叙述java的输入和输出. package ios; import java.util.Scan ...
- Django(十五)模板详解:模板标签、过滤器、模板注释、模板继承、html转义
一.模板的基础配置及使用 [参考]https://docs.djangoproject.com/zh-hans/3.0/topics/templates/ 作为Web框架,Django提供了模板,用于 ...
- 吴裕雄--天生自然JAVA面向对象高级编程学习笔记:包装类
public class WrapperDemo01{ public static void main(String args[]){ int x = 30 ; // 基本数据类型 Integer i ...
- P1087 有多少不同的值
P1087 有多少不同的值 转跳点:
- MySQL学习之SQL基础(一)DML
DML(data Manipulation language) INSERT DELETE UPDATE SELECT INSERT mysql> desc emp; +----------+- ...
- s2010编译C++ 链栈的使用
// CTest.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <iostream> #include &l ...
- Python 使用 requests 模块发送请求的使用及封装
一.requests 模块基本使用 1.准备接口的URL.请求参数.请求头 # 1. 构造注册.登录.充值请求的url register_url = "注册url" login_u ...
- 007.CI4框架CodeIgniter, 加载自己的helper辅助类,调用自己helper中定义各种全局函数
01. 我们在Helpers文件中创建一个Tx_helper.php的文件,里面就下一个函数 <?php //输出 function ShowMessage($AMsg) { echo &quo ...
- 吴裕雄 Bootstrap 前端框架开发——Bootstrap 字体图标(Glyphicons):glyphicon glyphicon-trash
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name ...