poj 1045 Bode Plot问题
来源:互联网 发布:淘宝店铺提前收款条件 编辑:程序博客网 时间:2024/05/17 01:56
1045翻译:
假定电路处于稳定状态,1点的电压V1=VS*coswt,2点电压V2=VR*(cos(wt+b)),其中Vs为电源电压,w为频率(单位弧度每秒),VR为R两端的电压,b为相位。
Input
输入包括一行或多行。第一行包括三个实数和一个非负整数。实数按顺序是VS,R,C。
整数n是测试用例的个数。接下来的n行就是输入,要求一行一个实数,代表w的值。
Output
输出n行的VR值,注意,结果精确到小数点后三位。
程序需要实现的是:得到不同的w值对应的VR值问题解决步骤:
1.电学知识(欧姆定律):V2=iR;
2.电容知识:Q=CU(Q为电荷量,U为电容两端的电压,C为电容(常数)),i=Q/t(电流为单位时间内流过的电荷量的值),U为v1-v2。
V2=iR=(Q/t)*R=(CU/t)*R=(d(CU)/dt)*R=CR*(d(v1-v2)/dt)=CR*(d(VS*coswt-VR*(coswt+b))/dt) (1)式
接下来用数学求导知识求解
d(VS*coswt)/dt=-VS*wsinwt
d(VR*(coswt+b))/dt=-VR*w(sin(wt+b))
(1)式变为CRw*(VR*sin(wt+b)-VS*sin(wt)),又(1)式左边V2=VR*(cos(wt+b))
故(1)式可变为:CRw*(VR*sin(wt+b)-VS*sin(wt))=VR*(cos(wt+b))
令:w=0,wt+b=0可分别得到CRw*tanb=1,VR=CRw*VS*sinb,
由三角函数的万能公式得到:VR=CRw*VS/(sqrt(1+CRW^2));
代码:
<span style="font-size:18px;">#include <stdio.h>#include <math.h>int main(){int n,x;double VR,VS,R,C,w;scanf("%lf%lf%lf%d",&VS,&R,&C,&n);for(x=0;x<n;x++){scanf("%lf",&w);VR=C*R*w*VS/sqrt(1+C*C*R*R*w*w);printf("%.3lf\n",VR);}return 0;}</span>
0 0
- poj 1045 Bode Plot问题
- POJ 1045 Bode Plot
- Poj 1045 Bode Plot
- poj 1045 Bode Plot
- POJ 1045:Bode Plot
- POJ 1045 Bode Plot
- POJ 1045 Bode Plot 笔记
- (Relax ST1.3)POJ 1045 Bode Plot
- Bode Plot - 1045
- 1045 Bode Plot
- ACM ICPC 1045 Bode Plot
- Bode Plot
- ZOJ1070 Bode Plot
- ZOJ1070 Bode Plot
- zoj 1070 Bode Plot
- Bode Plot(poj1045)
- 1045. Bode Plot
- acm pku 1045 Bode Plot的计算过程
- JS新手,return,break,continue区别
- 面试题:不使用+-*/进行加法运算
- 设计模式之代理Proxy模式
- Science上发表的超赞聚类算法及相关链接
- 发动机太热 请不要用冷水降温
- poj 1045 Bode Plot问题
- javascript学习笔记之document.compatMode
- 曾经面试给问到了Java保留小数问题
- Spring in action 笔记
- VIKOR模数结合视频监控系统解决监狱管理难题
- Android private Libraires 无法查看源码的问题
- 浅谈 LRU算法
- 简单、快速的开发运用(电子地图)GIS引擎
- objc 复制