RCcircuit -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* This program has been designed to calculate the value of the current in an RC circuit for times in the range 0.0 to 0.4 seconds and return the values in table*/ a public class RCcircuit { public static void main(String[] args) { final double Vs=10; //Voltage Source final double R=1E4; //Resistance final double C=18E-6; //Capacitance double t=0.0; //Time / double b =(-t/(R*C)); double p= Math.pow(Math.E,b); double i =(Vs*(p)/R); //Current i System.out.println("Time(s)\tCurrent(A)");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: System.out.println("-------------------"); System.out.println("0.0\t"+i); t=0.1; b =(-t/(R*C)); p= Math.pow(Math.E,b); i =(Vs*(p)/R); System.out.println("0.1\t"+i); t=0.2; b =(-t/(R*C)); p= Math.pow(Math.E,b); i =(Vs*(p)/R); System.out.println("0.2\t"+i); t=0.3; b =(-t/(R*C)); p= Math.pow(Math.E,b); i =(Vs*(p)/R); System.out.println("0.3\t"+i); t=0.4; b =(-t/(R*C)); p= Math.pow(Math.E,b); i =(Vs*(p)/R); System.out.println("0.4\t"+i); } }...
View Full Document

This document was uploaded on 04/14/2010.

Ask a homework question - tutors are online