Question

In: Computer Science

Please use python! In the mean-field theory of ferromagnetism, the strength M of magnetization of a...

Please use python!

In the mean-field theory of ferromagnetism, the strength M of magnetization of a ferromagnetic material like iron depends on temperature T according to the formula

M=μtanhJMkBT

were μ is a magnetic moment, J is the coupling constant, and kB is the Boltzmann's constant. We can simplify this equation by definoing m=M/μ and C=μJ/kB so that:

m=tanhCmT

It is clear this has a solution m = 0 which means the magnet has no magnetization. The code below find solution for different values of T using C = 2. For this magnet, T=2 is the critical temperature, i.e. the temperature where magnetization starts to appear. This is a phase transition.

  1. For the magnetization code below, change the constant C from 2 to 3 and to 4 and plot again and comment on the critical temperature of the system

  2. Change the starting value x0 from 2 to a different values and see the effect. You can try 1,3, 10, 0. What happens when m0 = 0

  3. Consider the equation x=1−e−cx where c is a known parameter and x is unknown. Write a lambda function and solve this equation for x using the relaxation method for the case c = 2. Use the magnetization code below as guide

  4. (Optional) Write a funtion the solves this equation for any given c.

  5. (Optional) Plot x vs c using the previous function for c={0,3} is steps of 0.01

  6. Code for part 1

  7. fc = lambda m,T: np.tanh(2*m/T)

    def fixed_point1(x0, c, f1):

    x = x0

    diff = 100

    tol = 1e-6

    i=0

    while diff > tol:

    x = f1(x,c)

    diff = np.abs(f1(x,c) - x)

    i = i+1

    #print(i,x,diff)

    return x

    T = np.arange(0.1,5,0.02)

    m = np.zeros(T.size)

    m0 = 10

    for i in np.arange(T.size):

    m[i] = fixed_point1(m0,T[i],fc)

    plt.plot(T,m)

    plt.xlabel("Temperature")

    plt.ylabel("Magnetization")

Solutions

Expert Solution

1. When we are changing the value of C from 2 to 3 and 4. As we will increase the valur of C there will be increase in the critical temperature of the System. For C=2 it is 2, for C=3 it is 3 and for C=4 it is 4 and so on.

For C=2,

For C=3,

2. Now if we change the x0 there is no effect but if we change m0 to 0 then for any temperature the magnetization will remain Zero.

3. Solving the given Equation

from math import e
result = lambda x,c: (1-e/2)-1
def mp(x0,c, f1):
    x=x0
    diff = 100
    tol = 1e-6
    i=0
    while diff > tol:
        x = f1(x,c)
        diff = np.abs(f1(x,c) - x)
        i = i+1
    return x

c = np.arange(0, 3, step=0.01)
x = np.zeros(c.size)
x0=1
for i in np.arange(c.size):
    x[i] = mp(x0,c[i],result)
    
plt.plot(c,m)
plt.xlabel("C")
plt.ylabel("X")
plt.show()

Glimpse of the Solution as:

Have a Happy Coding!!


Related Solutions

1 a) What is the approximate electric field strength and magnetic field strength of the electromagnetic...
1 a) What is the approximate electric field strength and magnetic field strength of the electromagnetic waves radiated by a 60-W lightbulb, as measured 5.5 m from the bulb? You can assume that the bulb is 100% efficient in converting electrical energy to light energy. b.) Incandescent light bulbs are very inefficient. Find the electric field strength and magnetic field strength assuming 5% efficiency. Please show all work, thank you!
Betty Neuman theory under the strength of the theory, can you please provide me with 3...
Betty Neuman theory under the strength of the theory, can you please provide me with 3 live scenarios of the strength theory. thank you.
Please use the python and explain. Also please show python. Suppose that a cashier owes a...
Please use the python and explain. Also please show python. Suppose that a cashier owes a customer some change and that the cashier only has quarters, dimes, nickels, and pennies. Write a program the computes the minimum number of coins that the cashier can return. To solve this problem use the greedy algorithm explained below. PROBLEM STATEMENT: Your program should first ask the user for the amount of money he/she is owed (in dollars). You may assume that the user...
This is for an electric field mapping lab. Show that electic field strength is equal to...
This is for an electric field mapping lab. Show that electic field strength is equal to the potential gradient.
In the following situations, determine the magnetic induction,magnetic field,magnetization, and bound current inside qnd outside the...
In the following situations, determine the magnetic induction,magnetic field,magnetization, and bound current inside qnd outside the magnetic bodies. a.A magnetic wire with a uniform free current density along its length b. An infinite magnetic slab with a sheet current at its center
For the two state paramagnet, explain why the magnetization M approaches zero at high temperatures.
For the two state paramagnet, explain why the magnetization M approaches zero at high temperatures.
Please use mintab The strength of a part was monitored as a function of temperature within...
Please use mintab The strength of a part was monitored as a function of temperature within a process. Generate a Scatter Plot, determine the value of the coefficient of correlation, generate a Fitted Line Plot, generate a Residual Plot, and estimate the percentage of variability in strength as a function of temperature. Note: Data divided into six columns for visual display. Your analysis should have a single Temp column and a single Strength column. Temp Strength Temp Strength Temp Strength...
What are the strength and direction of the electric field at the position indicated by the...
What are the strength and direction of the electric field at the position indicated by the dot in the figure where q = 2.3 nC? Specify the direction as an angle above (positive) or below (negative) horizontal (the positive x-axis). Magnitude      N/C Direction      °
What are the strength and direction of the electric field at the position indicated by the...
What are the strength and direction of the electric field at the position indicated by the dot in the figure below, in which q = 2 nC, d = 12 cm, and the positive x-axis points to the right?
What are the strength and direction of the electric field at the position indicated by the...
What are the strength and direction of the electric field at the position indicated by the dot in the figure below, in which q = 2 nC, d = 12 cm, and the positive x-axis points to the right?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT