Sunday, August 18, 2024

Nuclear Advocacy Programme-2023 at ICTP, Trieste, Italy

International Visits • Participated on invitation in the Global Nuclear Advocacy programme organized by the International Centre for Theoretical Physics(ICTP) at Trieste, Italy -“Increasing dangers of Nuclear weapons: How physicists can reduce the threat” during 22 October – 25 October 2023 Follow up activity after my visit to ICTP, Italy: As a follow up of my visit to ICTP, Trieste, Italy, an open elective course with 5 modules was developed, under the Supervision of Dr.Juergen Altmann, Dortmund University, Germany and Dr. Stewart Prager, Princeton University, USA, to educate students on the dangers of nuclear weapons and their global threat. The course not only highlights the impact of nuclear weapons but also highlights the significant efforts by the United Nations towards arms control and global nuclear weapons reduction. Click on the link to explore the details about course: https://disarmamentcourses.github.io/

Saturday, June 22, 2024

Learn Python codes for the rate of decay of atoms in radioactivity

 import math


def compute_quantity(N0, lambda_, T):

    N = N0 * math.exp(-lambda_ * T)

    return N


# Example usage:

N0 = 100  # Initial quantity

lambda_ = 0.1  # Decay constant

T = 5  # Time


result = compute_quantity(N0, lambda_, T)

print(f"N = {N0} * exp(-{lambda_} * {T}) = {result}")

Chart a python program for the quadratic type x^2-5x+6=0 findings its roots.

 import math


def solve_quadratic(a, b, c):

    # Calculate the discriminant

    discriminant = b**2 - 4*a*c

    

    if discriminant < 0:

        return "No real roots"

    elif discriminant == 0:

        # One real root

        root = -b / (2*a)

        return (root,)

    else:

        # Two real roots

        root1 = (-b + math.sqrt(discriminant)) / (2*a)

        root2 = (-b - math.sqrt(discriminant)) / (2*a)

        return (root1, root2)


# Coefficients for the equation x^2 - 5x + 6 = 0

a = 1

b = -5

c = 6


# Solve the equation

roots = solve_quadratic(a, b, c)

print(f"The roots of the equation {a}x^2 + ({b})x + {c} = 0 are: {roots}")

Learn a program for a series (1-x)^2

ef compute_expression(x):

    return (1 - x) ** 2

# Example usage:

x_value = 3

result = compute_expression(x_value)

print(f"(1 - {x_value})^2 = {result}") 

Simple Code in Python (for beginners) for Prime numbers;

Def is_prime(n):

    """Check if a number is prime."""

    if n <= 1:

        return False

    if n <= 3:

        return True

    if n % 2 == 0 or n % 3 == 0:

        return False

    i = 5

    while i * i <= n:

        if n % i == 0 or n % (i + 2) == 0:

            return False

        i += 6

    return True


def generate_primes(limit):

    """Generate a list of prime numbers up to a given limit."""

    primes = []

    for num in range(2, limit + 1):

        if is_prime(num):

            primes.append(num)

    return primes


# Example usage

limit = 100

prime_numbers = generate_primes(limit)

print(f"Prime numbers up to {limit}: {prime_numbers}")