In Python 3...
I have a few lines of code that I want the user to choose how many times it will run. For example:
times=int(input())
'times' will be the number of times the lines of code will run.
How do I do it?
Homework Statement
Here's my problem. I am working with ROOT which uses C++ and I am making 3 different graphs. This particular part of the code is for the parabolic motion with density calculation.
The problem is, that I follow the rules in the powerpoint provided to me, the other two of my...
Hello everybody i hope you all will be happy and enjoying your life
i have a question about CINDER90 computer code. i am working on this code but my results are not what i am expecting, i try many option in input, material and fluxes file for this but not fine my results can anybody tell me what...
The expression to code is: (z complex, m some positive integer)
z^m ( ln(z/(z-1)) - sum( 1/(k z^k), {k=1,m} ) )
The way I code is (in fortran) (in case z<2)
Z_1=1.0_q/Z
ZV1=LOG(Z/(Z-1))
ZK=1.0_q
DO K=1,M; ZK=ZK*Z_1
ZV1=ZV1-ZK/K
ENDDO
ZV1=ZV1/ZK
But it gives quite big error...
Homework Statement
The goal is to create two arrays that have the values
a = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 }
b = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
And then graph them so that a=mb
slope m thus being 2.
I am working on the first part before I graph them.
Homework EquationsThe Attempt...
Hello;
First of all I apologize in advance if I make any wrong quotes as I am a Mech engineering and has nothing to do with biology and DNA. I wish to know the entire code or the program of the DNA structure in human brain. As I understood DNA is made up of Adenine, thymine, cytosine and...
My code is to find the largest and second-largest numbers, from an arbitrary number of postive integers.
For some reason, the part of the code in italics is not being recognized. How do I know? Because:
- Let's say we choose to compared two numbers, if my first number is 5, and second number is...
I have T1 MR images DICOM (http://www.osirix-viewer.com/datasets/DATA/BRAINIX.zip )
does anybody know the CODE to calculate T1 values from above DICOM images in MATHLAB?
I got a problem running my FORTRAN program in high performance computer cluster. It runs well in my PC but I want to have mass production of data with different initial conditions so I put it in a cluster node with eight cores, simulate eight sets of data.
The program can run without problem...
Hello, I have a code in C/ C++and I have just learned I am going to need it in a version compatible with Free Pascal. I would never bother anyone with it but as I need it pretty quickly and my knowledge of Pascal is very poor I would spend ages rewriting this and it probably woudn't even work at...
Hello everyone!
I am an undergrad currently doing research for a nuclear physicist at the University of Notre Dame.
My current project is taking a code (written in Fortran-63 in 1967 ?:)) that calculates relativistic kinematics for two-body nuclear reactions and converting into some sort of...
I have received this error :
Undefined symbols for architecture x86_64:
"start", referenced from:
-u command line option
(maybe you meant: __gfortrani_library_start)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
what is this mean??
the code is...
Hello PFers,
I'm trying to make a program in java which process user's position, initial velocity of the projectile and the elevation of the projectile and show the trajectory in GUI. The language is in java.
The problem is, the trajectory won't show. It is supposed to show the player's...
Hey, I recently received a message from one of my friends. He's a real joker, thinks it's funny to send my pieces of code. This one had me stumped; from the little, and I mean very little, I know about code, this looks like base64 does it not?
H05LekhYaNE3Y7Movd47Y0KYHnuX/srs/V0pEk22bl8=
But I...
Hi, I want to write an ebook on CSS, HTML and php, and I'm using a RTF copy/paste plugin to my code editor so i can copy and paste code directly into MS Word from my code editor.
I'm just wondering: Can i write the whole book in MS Word and then directly upload it to amazon, for ebook readers...
Homework Statement
I am trying to run code for the code below but MATLAB runs out of data.
The Attempt at a Solution
NumberOfVariables = 9;
k=NumberOfVariables^2-NumberOfVariables+1;
integers = 0:k-1;
numbers = 1:k-1;
tic
s = combnk(integers,NumberOfVariables);
AllAnswers = [];
for i =...
Hi folks,
I'm working on Fluka nowadays which you can found from here if you are not familiar. It's a very useful and widely used Monte Carlo simulation package.
My main goal is to be able to perform total cross section calculation with it. So far, please consider I'm a rookie, I've done some...
Hi,
I'm trying to take keyboard inputs to make changes to a turtle from the 'Turtle' graphics in Python.
I'm not able to register keyboard inputs for the code I've written. I've tested out the examples that had been provided online, and they seem to work fine. I'm not quite sure where I'm...
Homework Statement . [/B]Hello all ! I am currently trying to make my fortran95 code run in vain.I would really appreciate it if someone could lend my a hand since I am a starter in programming.So the problem goes like that:Create a program capable of calculating the following function: f(x)=1/x...
Hi,
I have been wanting to do this for a while but not too sure how to go about it. I have the following geometric algebra
\lbrace\mathbf{e}_{i}\rbrace_{i=0}^{3} which satisfy the following relations: \mathbf{e}_{i}\mathbf{e}_{j}=-\mathbf{e}_{j}\mathbf{e}_{i} and...
Homework Statement
Hi, I have a piece of code that I'm trying to comprehend but I don't understand some aspects. Here is that code:
#include <stdio.h>
/* function prototype declaration for FindSum */
void FindSum(int, int, int *);
int main(void)
{
int a=2, b=5, c=1, x=3, y=4, z=7;
/*...
I have the following python code:
I need to know how to best convert this to pseudocode. On one hand, I am afraid of making it too python specific, and on the other hand, it can't be too general. For example, for the 2nd and 3rd blocks of code, how would I write them in pseudocode? What...
Homework Statement
I'm using a PIC 16F877A microcontroller. An LDR and moisture sensor connect to the ADC. The main body of the code is ''void main'', and there is also a sub-code called "void light_the_led'' which is read inside the 'void main code'.
I cannot get access easily to hardware or...
100 VR=D+R
LR=R
VS = VR - (1-q)*F
LS = LR +f*Q
loop = loop +1
if (loop.GT.50) stop
x(1) = .....
CALL
for i=2 to nf
x(i) = .....
call
x(nf+1) = (vr*y(nf)+b*xb...)
if (x(nf+1).LT.x(nf)) go to 30
call
for i=nf+2 to nt
x(i)=(vr*y(n-1)...)
if ( x(i).GT.Xd) goto 40...
I've been making a go at writing out algorithms myself in MATLAB rather than using pre-existing code. I've just attempted to write the Nelder-Mead optimization method and I have hit a stumbling block where the code is now looping infinitely. It seems to have something to do with sorting the...
A friend of mine wrote some code in C# that he is wanting to use in order to basically make a house controlled by voice commands he would input via microphone connected to his computer. He wrote some code and asked for my opinion and I have no idea how to read C#. Anybody help me find where he...
Hello, I am looking into building a touch screen. I have been considering a capacitive touch screen but I am also interested in optical touchscreen using infrared like the ones one this link...
Motivation:
I am working with a code that minimizes the objective functional value in an optimal control problem. It takes $A_1,A_2,A_3,A_4$ (the balancing factors for various components of the objective functional) as inputs, and then outputs the values of the state variables, control...
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
This is the code for python I found (didn't create) which I believe is correct:
max = 1000
result = 0
for...
I constructed my code of the Angular Spectrum Method. However, as the distance between the object and the plane of interest increases, the diffraction pattern never disappears; there is still some sort of a diffraction pattern, and I am expecting that it disappears as distance increases.
Here...
I have just posted on the Linear and Abstract Algebra forum ... and the post needs a "not equivalent" symbol as shown in Rotman's Proposition 1.58 part (ii) see below ...
Can someone please help with the latex code for this symbol?
PeterProposition 1,58 in Rotman's Abstract Algebra reads as...
I've always made my own makefiles and it hasn't been an issue because it's usually a small number of subroutines. However, I am working on modernizing and optimizing a Latin Hypercube sampling code in Fortran which has close to 80 functions/subroutines that I am splitting up into different files...
Hi, I am working on Solar systems in Australia. I want to know the Australian standards for grid connected PV systems for voltage, power factor, reactive power etc.
Hello to all!
I have written this 1D FDTD code but the results I take are very large and after some timestep they get to infinite/NaN... I really don't know what's wrong. The expressions I have used are the exact given solution for the Maxwell equations.
Thank you for your help.
program yee...
Homework Statement
A code consists of at-most two identical letters followed by at-most four identical digits. The code must have atleast one letter and one digit. How many distinct codes can be generated using letters A-Z and digits 1-9.
Homework EquationsThe Attempt at a Solution
//One...
If you have multiple outlets connected to the same 20A breaker, do the outlets need to be rated for 20 A? Or, is it acceptable to have the outlets rated somewhat lower? Where can I find this information in the NEC? If I do not need each outlet to be rated for 20 A, then is the current rating...
I have written a C program to trace out the motion of a double pendulum, but am having difficulties in getting gnuplot (controlled from my c program) to trace out the paths of the masses (example video below). Thus far I have created the program such that it produces a number of png images at...
Homework Statement
A common way of displaying the distribution of a random variable is by a histogram. Consider the interval [a,b) divided into M sub-intervals (bins) of length ΔX. Given a set of N random values of x, call Nj the number of values that fall within the jth interval.
Homework...
There really is no specific guideline for this. Personally, I like to write my code as compact as I can, but is there really a problem with this? Having those small complicated statements can make code hard to read, but is that not up to the developer's/reader's level of skill?
For example, the...
Simple question. I understand that the product of two "large" primes is a nearly unbreakable code. How large is "large" and if it's that easy, why aren't big corporations using this?
Looks like my main pet GR project is about to enter something akin to maintenance mode, since it now does all I currently need it to.
It's nothing earth-shattering at first glance, but is very concise (e.g. ~100 lines of Python for the simulator script) and should be easier to understand than...
Homework Statement
Val-tRNA val is the tRNA that carries valine to the ribosome during translation. Which of the following sequences gives an appropriate anticodon for this tRNA?
A. CAU
B. AUC
C. UAC
D. GUG
Homework Equations
There are four different codons for Valine: GUU, GUC, GUA, and...
hi everyone,
nowadays i am working on muon detecting but i need something cheap.
i saw on the internet some people are using their smartphone as a detector with sensor or phones cameras. is there anyone can share their code ?
there are some samples but they don't share their code.. only can...
Note that the code I am using is Python. Currently, I am attempting to numerically solve the equations of state that give rise to the Chandrasekar limit for a white dwarf star. My code works for a simple harmonic oscillator given the correct equations of motion, but does not compute the correct...