1. ## circuit

i need help with this \;
how will anyone write a program for a circuit
like this :

[code]
|-------------------{Resistor}--------------|
| |
voltageSource| |Capacitor|
| |
|-----------------------------------------------|
using varous voltages;
such as v(t) = 12exp(t/RC)*sin((2*PI)/P);
P = period = 0 to 2.
wHO'S INTERESTING IN A CHALLENGE?
WHO IS WILLING TO TRY TO SOLVE THE SAME PROBLEM USING THIS.
TYPE | VOLTAGE SOURCE | DURATION APLIED(SEC)
1 | Vs = 12 | CASE 1;2
| | CASE 2; 0.4
_____|__________________________|_________________ _
| |
2 |Vs = v(t) = 12exp(t/RC)*sin((2*PI)/P | CASE 1; 2
| | CASE 2 ; 0.4
| | CASE 3; 2
_____ |_____________________________|_______________
3 |Vs = 12)*sin((2*PI)/P) | CASE 1; 2
| | CASE 2; 0.4
| | CASE 3; 2
_____ |_____________________________|_______________
4 | Vs = 0 t= 0 |
| Vs =12 0<=t>=0.2 | CASE 1;2
| Vs = 0 0.2<=t>= 0.4 | CASE 2; 0.4
| |
<------------------------------------------------------------------------------->

THIS HERE IS A TABLE(BELOW) WHICH YOU HAVE TO FOLLOW FOR EACH CASE.
HERE I HAVE R,C, t, P DEFINE IN THE TABLE BELOW FOR EACH CASE #

CASE| R | C | Vc (VOLTS) | P(SEC) | final (SEC)
1 | 0.3 | 1 | calculate | 2 | 2
2 | 0.05 | 1 | calculate | 0.03 | 0.4
3 | 0.3 | 1 | calculate | 0.03 | 2

this are your properties. who is up to the challenge?
who ever is teach how to! please!
I will appreciate.
tank you
HERE IS YOU HAVE TO FOLLOW THE PROPERTIES ABOVE

#include<theOracle> [U]CASE |

2. do you need the formula? your formula in C++ would be:

Code:
`Vt = pow(12,(t/RC))*sin((2*3.14159/P);`
you would need to have t,RC, and P defined before it goes into this equation, and it would give you V(t)...

what are you trying to find in that system? I couldn't really follow your forumula...

3. Not quite.
Code:
`Vt = 12*pow(M_E,(t/RC))*sin((2*3.14159/P);`
Don't forget to include cmath.h for the pow() function and the value of e, represented by M_E.

But I'm as confused as major_small : what are you trying to compute ? Voltage, current, ... ?

4. >>Don't forget to include cmath.h for the pow() function and the value of e, represented by M_E.

Acutally, its just #include <cmath>.

5. Originally posted by major_small
3.14159
3.1415926535 is a little more accurate

And yes, I do have that memorized.

6. Make a "Circuit" object. Make a member function called voltage or something that returns the voltage of the circuit based in it's current resistor, capacitor, and whatver 'P' is in your formula states(make them private data members)

How bout a little bit of this action:

Code:
`const double PI = 3.1415926525;`
Actually, on second thought, I think pi might be defined in <cmath> as M_PI or something...

7. Originally posted by Trauts
3.1415926535 is a little more accurate

And yes, I do have that memorized.
Memorize this:
Code:
```#include <cmath>
using namespace std;
.
.
.
cout << "PI:" << setprecision(50) << M_PI << endl;```

8. My memory isn't that good... and I only memorized that part of pi because I was bored in math.

That was good tho :-)

9. >My memory isn't that good... and I only memorized that part of pi because I was bored in math.

>That was good tho :-)

Your memory is better than mine!!! I think me and the major tied.

10. i did have 3.1415926535 memorized at one point, but i forgot because of calculators... boredom does strange things to you sometimes...

11. I never knew that there was a constant defined for PI. Cool. I always just used 4 * atan( 1 ).

12. me neither... but i'll still be using the number... less steps...

13. Sorry, theOracle, even with your edit I have trouble understanding what you're looking for. Maybe the value of the RC constant ? Or the period ? Or maybe both ?

14. yeah, your edit didn't help that much... and include the closing [code] tag... the tags don't work if you only open it and never close them