In computer science, a for-loop (or simply for loop) is a control flow statement for specifying iteration, which allows code to be executed repeatedly. Various keywords are used to specify this statement: descendants of ALGOL use "for", while descendants of Fortran use "do". There are other possibilities, for example COBOL which uses "PERFORM VARYING".
A for-loop has two parts: a header specifying the iteration, and a body which is executed once per iteration. The header often declares an explicit loop counter or loop variable, which allows the body to know which iteration is being executed. For-loops are typically used when the number of iterations is known before entering the loop. For-loops can be thought of as shorthands for while-loops which increment and test a loop variable.
The name for-loop comes from the word for, which is used as the keyword in many programming languages to introduce a for-loop. The term in English dates to ALGOL 58 and was popularized in the influential later ALGOL 60; it is the direct translation of the earlier German für, used in Superplan (1949–1951) by Heinz Rutishauser, who also was involved in defining ALGOL 58 and ALGOL 60. The loop body is executed "for" the given values of the loop variable, though this is more explicit in the ALGOL version of the statement, in which a list of possible values and/or increments can be specified.
In FORTRAN and PL/I, the keyword DO is used for the same thing and it is called a do-loop; this is different from a do-while loop.
Hi, so, I got help from this homework problem by posting it on chegg, but I want clarification.
A circular loop of wire of radius 12.0 cm is placed in a magnetic field directed perpendicular to the plane of the loop and into the page. The field is decreasing at a constant rate of 0.050 T per...
A square loop of wire in the x-y plane, centred on the origin, is made up of four straight segments, each of length 2d=10cm. A current I =10A flows in the wire in the direction shown. Find the magnetic field at z=d on the z-axis.
(See "Diagram" for the diagram of the problem)
Here is the...
I originally posted this to the advanced homework -section, but maybe this isn't advanced enough to warrant being posted there :oops:. If a mod sees this, feel free to delete the original on the other forum. I'd do it myself, but I can't. 1. Homework Statement Calculate the mutual inductance for...
Homework Statement
Rigid contour of an isosceles triangle and a long line cable lie in a plane and are located in vacuum . Determine the intensity of the magnetic force F acting on the loop. Current I = 100 A.
free upload image
Correct answer:
F = 386 mN.
I am getting 2 mN.
Notice that I...
Homework Statement
I'm working on my research project at uni, running a gas-liquid flow loop for horizontal stratified flow exhibiting wave propagation. The equipment I have however is setup to investigate vertical flow primarily and the flow meters are located on the vertical sections. I need...
Homework Statement
I have attached a picture that details the problem. This is my practice test and I have no clue what I am doing wrong. Essentially a loop of wire is moving in constant velocity into a magnetic field. The magnetic field lines are pointing into the page. The problem is...
Homework Statement
[/B]
I need to work out the open loop transfer function of the above. I've drawn it on word so it's not great; the + and - represent a summing junction.
Homework Equations
Everywhere I read, I find a different definition of open loop transfer function. I see G*H is an oft...
This is a continuation of a previous thread in which I was informed my TA was mistaken on an aspect of magnetism. This thread is just to verify another problem within the homework is correct. Other threads will be posted to continue.
1. Homework Statement
A) What is the magnetic flux...
Homework Statement
A square of wire with side length 1.4 m rotates about an axis through one corner that is perpendicular to the plane of the square with an angular speed of 3 rev/s. There is a uniform magnetic field of 1.2 T perpendicular to the square. Calculate the EMF induced in the...
I am having problems with printing out each elements of the array using a for loop
It's suppose to look like this:
Enter non-negative numbers (ints) terminated by -99
1 2 3 4 5 6 -99
Original list (6 values):
1, 2, 3, 4, 5, 6.
the code's output looks like:
Enter non-negative numbers (ints)...
Homework Statement
A square wire loop 12.0 cm on each side carries a clockwise current of 15.0 A
Find the magnitude of the magnetic field at its center due to the four 1.30 −mm wire segments at the midpoint of each side.
Homework Equations
B = (μ0*I)/(4π)*(2a)/(x√(x^2+a^2))
The Attempt at a...
Homework Statement
A square wire loop 12.0 cm on each side carries a clockwise current of 15.0 A
Find the magnitude of the magnetic field at its center due to the four 1.30 −mm wire segments at the midpoint of each side.
Homework Equations
B = (μ0*I)/(4π)*(2a)/(x√(x^2+a^2))
The Attempt at a...
Homework Statement
Imagine a ball with moment of inertia I_{cm} = \beta MR^2 encountering a circular loop of radius R_0 > R after rolling on a level surface at a speed of v_0. Assume that the ball does not slip. Attached a diagram.
A) What is the minimum value of v_0 required for the ball...
Homework Statement
Full problem statement and diagram is attached.
Homework Equations
Kirchhoff's rules, ohm's law
The Attempt at a Solution
So I presume that what I'll be looking at here is the use of Kirchhoff's Rules and Ohm's Law. I do not know how to approach this as I have never come...
Homework Statement
A little stuck on the second question it basically boils down to not quite understanding the question. Was hoping someone here could push me in the right direction. The Question is two part, already completed the first half but wouldn't mind if someone looked over it while...
Consider the following integral that comes out of a loop calculation along with some fermionic propagators (e.g virtual one loop correction to a ##p \gamma^* \rightarrow p'## process such as in DIS):
$$ \int \frac{\text{d}^d l}{l^2 (l-p)^2 (p+q-l)^2} \text{Tr}(\not p \gamma^{\nu} (\not p + \not...
Homework Statement
(sorry for possible notation errors, that might arise during the translation)
Why an electric current passing through a closed loop, can be defined only in stationary conditions?
Homework Equations
The Attempt at a Solution
I think that the reason is that, if the...
1. Situation and Variables:
A circuit is constructed with four resistors, one capacitor, one battery and a switch as shown. The values for the resistors are: R1 = R2 = 30 Ω, R3 = 66 Ω and R4 = 113 Ω. The capacitance is C = 64 μF and the battery voltage is V = 12 V. The positive terminal of the...
Write code that prints: userNum ... 2 1 Blastoff! Your code should contain a for loop. Print a newline after each number and after Blastoff!. Ex: userNum = 3 outputs:
3
2
1
Blastoff!
#include <iostream>
using namespace std;
int main() {
int userNum = 0;
int i = 0;
userNum = 3;
i =...
Write a while loop that prints 1 to userNum, using the variable i. Follow each number (even the last one) by a space. Assume userNum is positive. Ex: userNum = 4 prints:
1 2 3 4
#include <iostream>
using namespace std;
int main() {
int userNum = 0;
int i = 0;
userNum = 4; //...
So i want to calculate an r value 5 different times then find the mean of the 5 calculated values.
I have 2,187 data points. the first line of code generates 100 random points 1-2187.
The code has a bug but my major issue is it calculates r then loops again calculates r, loops again calculates...
Write code to complete DoublePennies()'s base case. Sample output for below program:
Number of pennies after 10 days: 1024
The if statement is what I am trying to complete, however this places it in an infinite loop
#include <stdio.h>
// Returns number of pennies if pennies are doubled...
A 5μF capacitor is connected in parallel with a 2MΩ resistor and the combination is then connected in series with a 1MΩ resistor through a switch to a 12V battery. Find the time taken for the voltage across the capacitor to rise from zero initial value to 2V after the switch is closed.From what...
I read on a source from a paper from John D. Ramboz that explains:
The incremental pitch-advancement of the coil's helical winding sums over its circumferential length to create an undesirable one-turn loop normal to the axis of the coil (the plane of this loop is parallel to the surface of the...
So I'm trying to exploit the idea of audio feedback and applying it to different Sciences, The one I had in particular in mind is social media.
But before I go hammering away at how to exploit it, I need a better understanding of how feedback actually works
I believe that the way feedback in...
Okay guys
So I was studying up some electric current and doing electric current problems
I am clear with kirchhoffs rules
And with series-parallel resistor combinations
But I am not quite clear with the symmetric distribution of current
Or symmetry in circuits, in particular
Could you guys...
Homework Statement
<I will attach a diagram below> In terms of m, g and r. FInd the normal force at the top of the loop.
Homework Equations
∑F = Fc = FN+Fg ∴ Fc=FN+Fg ∴FN = Fc - Fg ∴ N=mV2/r - mg
The Attempt at a Solution
Fc=mV2/r - mg and V2=ra and a=g ∴C=mrg/r ∴C = mg ∴mg-mg=N ∴ N=0 N. BUT...
This is a 3 part question.
1. I've come to understand that the mass values in the mass terms (pole mass) of the standard model don't represent what we actually measure. That there are loop corrections. (I understand the concept: there's screening either adding or subtracting from the true...
Homework Statement
A loop of wire and a bar magnet are moving relative to one another. Which motion in the diagrams shown below will NOT induce a current in the loop?
Homework Equations
Lenz's Law: A changing magnetic field can induce a current in a direction that produces its own...
Homework Statement
The loop-the-loop machine has radius R of 18m
(a) What is the minimum speed at which a cart must travel so that it will safety loop the loop
(b) what will the speed at the top be in this case
Homework Equations
Centipetal force = m*v^2/r
Kinetic and potential energies =...
If current I passes through a circular loop of radius R,then what will be the self inductance of that loop?
(calculating flux through the loop leads to calculating magnetic field at every point inside the loop which is an elliptic integral.)
Hi all,
Has anyone an idea about the loop correction for quartic Higss coupling?
In [arXiv:1507.03618v2 [hep-ph]], equ. (13) it's pointed out that the perturbativity constrains on the quartic couplings in the Higgs potential is ## \lambda^2 < 16 \pi^2 ##
Which means that loop factor is ##...
Hi all,
How would one go about determining the flow(GPM) of a closed loop parallel piping system.
I believe this has to do with the pressure intake and outlet of the pump as I have a pump in the mentioned system rated at 4350GPM@50Hz but it is pumping at 4500 GPM at 37Hz,
Thank you all for...
Hi all,
Some processes can not happen at the tree level, but it happen via loops, like for Higgs decay to pair of glouns or pair of photons, (h -> gg), (h -> y y) . For instance, effectively h -> gg written as ##~ h~ G^a_{\mu\nu} G_a^{\mu\nu}~ ## which is Lorentz and gauge invariant ..
Now if...
edit: turned out to be a calculator typo...mods feel free to delete this thread if you wish, I won't complain.
Homework Statement
[/B]
Having issues with part a)
imgur link: http://i.imgur.com/4hzLyhb.jpg
Homework Equations
Resistivity of muscle (from table in text): \rho \approx 13...
If for example we have in a loop a DC and 2 resistors connected in series, the current in each resistor is different ##I=\frac{V}{R_i}## but we say that the current is ##I=\frac{V}{R_1+R_2}##?
That means we are looking at the average current in a loop?
loop quantum gravity and loop quantum cosmology gravity becomes weaker then repulsive instead of stronger, towards the Planck regime, due to the onset of quantum effects. gravity near Planck energies and densities, LQG/LQC becomes repulsive.
at the inflection point where LQG gravity strength...
Homework Statement
A 21cm×21cm square loop has a resistance of 0.12 Ω . A magnetic field perpendicular to the loop is B=4t−2t^2, where B is in tesla and t is in seconds.
(A) What is the current in the loop at t=0.0s?
(B) What is the current in the loop at t=1.0s?
Homework Equations
for a...
Is it possible to find the magnetic field on the axis above a current loop using Ampere's law? I was thinking you could treat an infinitesimal piece of the loop as a straight wire and draw a circle around it with radius sqrt(a^2 + z^2), with a=radius of current loop and z=position of point of...
Homework Statement
A piece of wire slides, without friction, along two similar wires. The resistance per unit length of all wires is 0.350 ohms/m, and a constant magnetic field, B= 1.90T, points up, perpendicular to the loop. The distance between the parallel, fixed wires is 10.0cm. At the...
self-dual loop quantum gravity results when the immirizi parameter y=i has been the subject of many recent research papers here is a partial listGravitational axial perturbations and quasinormal modes of loop quantum black holes
M.B. Cruz, C.A.S. Silva, F.A. Brito
(Submitted on 26 Nov 2015)...
Homework Statement
A circular loop of radius R is on the xy plane and the center is at the origin, the current is flowing in a counter-clockwise manner. a) Let Q=(a,0,a) be a point such that a>>R. Find Br and Bθ at Q. b) Let Q=(ha,0,0) be a point on the x-axis such that h<1. Find the vector...
interesting new paper on possible new research direction for LQG
http://arxiv.org/abs/1511.07332
Towards self dual Loop Quantum Gravity
Jibril Ben Achour
(Submitted on 23 Nov 2015)
In this PhD thesis, we introduced a new strategy to investigate the kinematical and physical predictions of self...
Could someone please tell me the difference between tree diagrams and loop diagrams? If I'm thinking correctly tree diagrams are before contracting? Also how do vacuum diagrams fit into the picture?
Thanks!
I have got a question. If we do electrolysis with waterand get : H2 + 02 , and then we make hydrogen explode and make a piston move , for example. Then it would be H2O again? So we could do this forever and get as much energy as we want? That would be super awesome but i am not sure.