/*Bode Plot
2008-08-20 08:22:24 Accepted 1070 C++ 00:00.00 840K 天将降大任于我
有大牛如是解说:
给没学过高等物理的同学们看的, 允许高手们在一边偷笑
----------------------------------------------------
这是一道物理题。先整理出题目中给出的公式:
v1 = VS * cos ωt (1)
v2 = VR * cos (ωt + θ) (2)
v2 = i * R (3)
i = C * d/dt(v1 - v2) (4)
先将(2)(3)联立,并将(4)代入,得:
VR * cos (ωt + θ) = R * C * d/dt (VS * cos ωt - VR * cos (ωt + θ
))
补充一个知识:d/dt表示求关于t的导数。我们又用D[f, x]表示df/dx,即求函数
f关于x的导数。下面计算求导的部分:
D[VS * cos ωt - VR * cos (ωt + θ), t]
= D[VS * cos ωt, t] - D[VR * cos (ωt + θ), t]
= VS * D[cos ωt, t] - VR * D[cos (ωt + θ), t]
此时变量不一致,不能直接求导,需要用到链式求导法则:
设有D[f,x] = df/dx,函数f = f(g), 函数g = g(x)。因为df/dx = df/dg *
dg/dx,所以函数f关于x的导数,等于函数f关于g的导数乘上函数g关于x的导数。
又由常用公式D[cosx, x] = -sinx,D[x, x] = 1, D[ab, x] = a * D[b, x] +
D[a, x] * b,我们继续可得:
D[cos ωt, t]
= D[cos ωt, ωt] * D[ωt, t]
= - sin ωt * (ω * D[t, t] + D[ω, t] * t)
= - sin ωt * ω
D[cos (ωt + θ), t]
= D[cos (ωt + θ), ωt + θ] * D[ωt + θ, t]
= - sin (ωt + θ) * (D[ωt, t] + D[θ, t])
= - sin (ωt + θ) * ω
由此可得求导的结果:
D[VS * cos ωt - VR * cos (ωt + θ), t]
= VS * D[cos ωt, t] - VR * D[cos (ωt + θ), t]
= - (VS * sin ωt * ω - VR * sin (ωt + θ) * ω)
将求导结果代入原式并化简,得到结果为:
VR * cos (ωt + θ) = - R * C * ω(VS * sin ωt - VR * sin (ωt + θ))
令t = 0,得
cos θ = R * C * sin θ 即 tan θ = 1 /(R * C * ω)
由此可以求出θ = arctan(1 / (R * C * ω))。
再令ωt = - θ,得
VR = R * C * ω * VS * sin θ
给没学过《电路基础》的人看
因为这里不需要算瞬时电压,直接用欧姆定律,
I = U / R
电流,电压都是正弦信号,可以用相量法表示(表示为复数)
I = VS / (R - j/W/C)
(R是电阻阻抗, - j/W/C 是电容容抗,二者串联; j是虚数单位)
VR = I * R = VS * R / (R - j/W/C)
取模值:
|VR| = |I * R| = R*|VS| = R*VS/sqrt(R*R+1.0/(W*W*C*C)
即可求出题目所要求的VR。
*/
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
double vs,c,r,w;int n;
scanf("%lf%lf%lf%d",&vs,&r,&c,&n);
for(int i=1;i<=n;i++)
{
scanf("%lf",&w); //函数atan()为反三角函数
printf("%.3lf\n",r*vs*1.0/sqrt(r*r+1.0/(w*w*c*c))); //double angle=atan(1.0/(c*r*w)), vr=c*w*r*vs*sin(angle);
}
return 0;
}