Comp Sci C+ (NOT C++) Resistance Caculation

  • Thread starter Thread starter vladittude0583
  • Start date Start date
  • Tags Tags
    Resistance
AI Thread Summary
To calculate the total resistance of a circuit with "infinite" resistor values in C+, a while loop combined with conditional statements is essential for handling the input of resistors. The discussion highlights confusion over the existence of C+ as a programming language, with some participants suggesting it may be a misunderstanding of C language. The need for more details about the circuit's topology is emphasized, as this information is crucial for applying the correct equations. The participant is currently studying Physics w/Calculus 2 and C programming, indicating a foundational understanding but lacking advanced coursework. Overall, clarity on the circuit structure and proper programming techniques are necessary for solving the resistance calculation problem.
vladittude0583
Messages
40
Reaction score
0
Our homework requires us to write a program that will calculate the total resistance of a circuit with "infinite" resistor values.

My question is, how would I calculate the "infinite" portion of the code? I already know that this will require a while loop with some if/for statements. I am just unsure of how to write the code that take will care of the "infinite" number of values of resistors.

If you could give me an idea as to how to do so it would be greatly appreciated - on a side note, I am in C+ programming and not C++ programming, so please provide me with an answer in terms of the language I am familiar too and not one above it. Thanks.
 
Physics news on Phys.org
vladittude0583 said:
Our homework requires us to write a program that will calculate the total resistance of a circuit with "infinite" resistor values.

My question is, how would I calculate the "infinite" portion of the code? I already know that this will require a while loop with some if/for statements. I am just unsure of how to write the code that take will care of the "infinite" number of values of resistors.

If you could give me an idea as to how to do so it would be greatly appreciated - on a side note, I am in C+ programming and not C++ programming, so please provide me with an answer in terms of the language I am familiar too and not one above it. Thanks.
I haven't heard the C+ language.
Did you mean C language?
 
Yes, it is the C language, however, it is not C++, but C+ instead.
 
I think the C language can't solve your problem.
( I suspect that you have some courses on "Electrical ciuruit" instead of having a programing language course).

I guess your problem can be solved by some equations by the "topology structure of the circuit" If you supply more details.
 
Well, I am currently taking Physics w/Calculus 2 and COP2220 (C programming) which is required before I transfer over to the university next year in their physics program. Therefore, I have not had any specialized courses taken yet in terms of upper-level.
 
Thread 'Have I solved this structural engineering equation correctly?'
Hi all, I have a structural engineering book from 1979. I am trying to follow it as best as I can. I have come to a formula that calculates the rotations in radians at the rigid joint that requires an iterative procedure. This equation comes in the form of: $$ x_i = \frac {Q_ih_i + Q_{i+1}h_{i+1}}{4K} + \frac {C}{K}x_{i-1} + \frac {C}{K}x_{i+1} $$ Where: ## Q ## is the horizontal storey shear ## h ## is the storey height ## K = (6G_i + C_i + C_{i+1}) ## ## G = \frac {I_g}{h} ## ## C...

Similar threads

Back
Top