Recent content by K_Physics

  1. K_Physics

    Python User-Defined Function in Python

    I got it to work! Thanks for the help!
  2. K_Physics

    Python User-Defined Function in Python

    This code was just designed to output the value of M, which happened to be around 1.7361319160639026 from math import sqrt L = 50 M = 0.0 for i in range(-L,L+1): for j in range(-L,L+1): for k in range(-L,L+1): if not (i==j==k==0): M +=...
  3. K_Physics

    Python User-Defined Function in Python

    The idea behind it was, the function will take the argument L multiple times list = [] L = 0 while int(L) < 50: list.append(L) L = int(L) + 1 print(function(L)) This way we can get the M values with the corresponding L value. I want to point out that I am a beginner. So I may not...
  4. K_Physics

    Python User-Defined Function in Python

    The end goal of the code is to graph values of L and the corresponding value of M with the use of user-defined functions. Sorry if this was unclear. I didn't continue to plot, as the values of M produced were incorrect.
  5. K_Physics

    Python User-Defined Function in Python

    Initially I was calculating only one value. In this new code, I have to graph values of L from 1-50 with the corresponding M value. The issue is, none of the M values were correct after changing it into a user-defined function.
  6. K_Physics

    Python User-Defined Function in Python

    Homework Statement So currently I'm working with user-defined functions. Initially, the code inside the user-defined function worked but when I attempted to change it into a user-defined function, it produces incorrect values. Homework Equations No need for any equations The Attempt at a...
  7. K_Physics

    Relative Intensity of Various Light Sources - Lab Experiment

    Homework Statement I've linked my data table down below. My problem is the relative intensity column. From the table, the units of relative intensity are w/m/s. I'm assuming this is power/velocity, where velocity is the speed of light. However, nowhere in the lab manual did it mention the...
  8. K_Physics

    Loudspeaker Question (Sound and Intensity)

    Homework Statement Suppose a spherical loudspeaker emits sound isotropically at 10 W into a room with completely absorbent walls, floor, and ceiling (an anechoic chamber). (a) What is the intensity of the sound at distance d = 3.0 m from the center of the source? (b) What is the ratio of the...
  9. K_Physics

    Standing Waves On Strings: Harmonic and Frequency Problem

    Thanks for the help! I will try the question both ways =D.
  10. K_Physics

    Standing Waves On Strings: Harmonic and Frequency Problem

    Homework Statement String A is stretched between two clamps separated by distance L. String B, with the same linear density and under the same tension as string A. String B is stretched between two clamps separated by distance 4L. Consider the first eight harmonics of string B. For which of...