题目链接:
http://poj.org/problem?id=1045
思路:
v2=iR=CRd(v1−v2)/dt
dv1/dt=−wVssin(wt)
dv2/dt=−WVRsin(wt+θ)
所以有:
v2=CRw(VRsin(wt+θ)−Vssin(wt))
1
又因为:
v2=VRcos(wt+θ)
2
联立1,2式: CRw(VRsin(wt+θ)−Vssin(wt))=VRcos(wt+θ)
令
t=0
,有:
CRwsinθ=cosθ
3
令
wt+θ=0
,有:
VR=CRwVssinθ
4
联立3,4式,可得:
VR=CRwVs/(sqrt(1+(CRw)2))
代码:
#include<iostream>
#include<iomanip>
#include<math.h>
using namespace std;
int main()
{
double VS, R, C;
int n;
cin >> VS >> R >> C >> n;
while (n--)
{
double w, VR;
cin >> w;
VR = C*R*w / (sqrt(1 + C*C*R*R*w*w));
cout << setprecision(3) << fixed << VR << endl;
}
return 0;
}