
#include <iostream>
#include <math.h>
using namespace std;
int main ()
{
int opcion;
cout<<"hallar la capacitancia\n";
cout<<"hallar impedancia \n";
cout<<"hallar conrriente inductiva\n";
cout<<"hallar capacitancia\n";
cout<<"ingrese una opcion";
cin>>opcion;
switch ( opcion )
{
case 1:{
double v1,v2,I,r,xl,xc;
cin>>v1;cin>>v2;cin>>xl;cin>>xc;
r=50;
do{
I=v2-v1/sqrt(pow(r,2)+pow(xl+xc,2));
r=r+10;
cout<<I<<endl;
}
while(r<=200);
}
break;
case 2:{
double vp,w,c,I,t,pi=3.14;
cin>>vp;
cin>>w;
cin>>t;
a=30;
do{
I=(vp*w*c)*cos(w*t+pi/2);
a=a+5;
cout<<I<<endl;
}
while(a<=50);
}
break;
case 3:{
double r,z,A,i,w,l,c;
cout<<"resistencia: ";cin>>r;
cout<<"ingrese i: "; cin>>i;
cout<<"ingrese w: "; cin>>w;
cout<<"capacitancia: "; cin>>c;
l=10;
do{
A=((w*m)-1/w*c);
cout<<"z="<<r<<" + i" << A <<endl;
m=m+6;
}
while(m<=80);
}
break;
case 4:{
double i,l,t,v1,v2,w,pi=3.14;
cout<<"ingrese l "; cin>>l;
cout<<"tiempo ";cin>>t;
cout<<"voltaje 1 ";cin>>v1;
cout<<"voltaje 2 ";cin>>v2;
w=5;
do {
i=((v2-v1)/w*l)*sin(w*t-pi/2);
w=w+20;
cout<<i<<endl;
}
while(w<=80);
}
break;
}
}