Recent content by jam12

  1. J

    Maple Maple soft, transcendental equations

    Hello guys, I am new to maple software and I am stuck on solving a simple transcendental equation: sin(x)=x/2 over the range x=-3,...,3. I know how to solve this equation for individual intervals, for example: > fsolve(sin(x) = (1/2)*x, x = -3 .. -1); >...
  2. J

    Astronomy determining velocity

    Homework Statement Hello I wanted clarification on freeman's law and the Tully fisher relationship. Am i correct to say that the tully fisher relationship that states L=kv^4 where L=luminosity of galaxy and v= max rotational speed of galaxy. only applies to edge-on spiral galaxies...
  3. J

    Cohesive Energy of Atoms in a Crystal

    Homework Statement I would like to know what the cohesive energy of the crystal is. Homework Equations The Attempt at a Solution Is it the energy required to break the atoms free from a crystal (ie into free atoms with no potential)? So would it be the minimum energy of a...
  4. J

    C code, converting float into integer

    Thanks Mark44 for your explanation, very much appreciated. and thanks DH for keeping up with my mistakes.
  5. J

    C code, converting float into integer

    DH you genius, i just had to do 10 to 10.0 but why? i spent four hours on this piece of sh**
  6. J

    C code, converting float into integer

    how can I use cast? eg would it be r=pow(c,n/10); r=cast(r); Do i need to include a library for this? i tried this and it didnt work
  7. J

    C code, converting float into integer

    I am quite new to programming, i am using linux server connected to our campus. It has glut installed etc. Also math library is included right above main() (beginning of the whole code) Counter is just a single function in the whole code.
  8. J

    C code, converting float into integer

    i have included math library and gl glut library in program, so when i compile, these are included. All warnings are on
  9. J

    C code, converting float into integer

    scrap my first post, please read the second one and by the way when counter is called, the c variable is 80.62782 (changes depending on other parts of program).
  10. J

    C code, converting float into integer

    thanks changed that to %d but its still no use, basically my for function is scanning a grid in integer steps and grid function must take integer values as arguments actually that above statement is not true. The following works perfectly: void counter (double c) { FILE *fp; char...
  11. J

    C code, converting float into integer

    Hi guys, i am using the C language and have created the following function: void counter (double c) { FILE *fp; char output[]="output.xls"; int n,p=0; int r=0; int i,j; float x=0; fp=fopen(output,"w"); fprintf(fp,"rmax\tnumber of particles within rmax\r\r\n"); for(n=1;n<=10;n++)...
  12. J

    Solving Simple Harmonic Motion for All Time

    Looking at the squarewave function expression I see my function will be a sum of heaviside step functions? and i can change the period according to what i need. Many thanks
  13. J

    Solving Simple Harmonic Motion for All Time

    thanks, I've tried but its no use since i need a function that turns on and of and on etc an infinite number of times
  14. J

    Solving Simple Harmonic Motion for All Time

    Homework Statement I have that a oscillating mass undergoes shm. It is accelerated (forced oscillation) by 1ms^-2, for time pi/2 as it goes through the origin and then accelerated by -1ms^-2 for another time pi/2, then it is at the origin after the second acceleration. I need to determine...
Back
Top