Categories
Python

Task 1: collect the names of stdlib packages and modules

Task 1: Collect the names of StdLib packages and modules
Task 2: Find what is in each of the module’s namespace [Need to import them]
Task 3: Calculate the dependency between StdLib modules
Task 4: Explore the modules
Task 5: Are there any Cyclic module dependencies in StdLib?

Categories
Python

I worked on a python assignment last week and the new assignment that i have is a follow up assignment and i have to reflect on the work i did.

I worked on a python assignment last week and the new assignment that I have is a follow up assignment and I have to reflect on the work I did. I will attach the python notebook for the previous assignment and I will attach a screenshot of the new assignment.

Categories
Python

I have a 20 min quiz that’s taking place tommorow (6/102022), at 2:10 pm (arabian standard time) and it will be about object oriented programmig and graphical user interface.

I have a 20 min quiz that’s taking place tommorow (6/102022), at 2:10 pm (arabian standard time) and it will be about Object oriented programmig and graphical user interface.

Categories
Python

Task 4: explore the modules

Task 1: Collect the names of StdLib packages and modules
Task 2: Find what is in each of the module’s namespace [Need to import them]
Task 3: Calculate the dependency between StdLib modules
Task 4: Explore the modules
Task 5: Are there any Cyclic module dependencies in StdLib?

Categories
Python

Task 4: explore the modules

Task 1: Collect the names of StdLib packages and modules
Task 2: Find what is in each of the module’s namespace [Need to import them]
Task 3: Calculate the dependency between StdLib modules
Task 4: Explore the modules
Task 5: Are there any Cyclic module dependencies in StdLib?

Categories
Python

Hello, i need to get a python code for the function.

hello, i need to get a python code for the function. please check the attachment or message me. i have added examples in the doc file.

Categories
Python

Lab 5a

HELLO,
PLEASE ANSWER THE BELOW QUESTIONS IN SEPARATE DOCUMENT. BRIEF GUIDELINES ATTACHED IN BELOW PDF
LAB 5A
Complete the following programming exercises given in the attached PDF “week5_labA.pdf” and submit only Word file as your answer—please do read the submission requirements carefully.
week5_labA.pdf week5_labA.pdf – Alternative Formats
============================================================
LAB 5B
First complete Lab-5A and then work on the following programming exercises given in the attached PDF “week5_labB.pdf” and please do read the submission requirements carefully.
Must follow the submission requirements.

Categories
Python

Lab6b_more_code_examples.zip (4.159 kb)

Hello,
Please answer the folliwing tasks in separate document
Lab6A
Attached Files:
week6_labA.pdf week6_labA.pdf – Alternative Formats (169.496 KB)
Complete the following programming exercises given in the attached PDF “week6_labA.pdf” and submit only Word file as your answer—please do read the submission requirements carefully.
LInks :: file:///C:/Users/shanm/Downloads/week6_labA.html
===============================================
Lab6B
Attached Files:
week6_labB.pdf week6_labB.pdf – Alternative Formats (220.693 KB)
Lab6b_more_code_examples.zip (4.159 KB)
First complete Lab6A and then work on the following programming exercises given in the attached PDF “week6_labB.pdf” and please do read the submission requirements carefully.
Links :: file:///C:/Users/shanm/Downloads/week6_labB.html
Must follow the submission requirements.

Categories
Python

R=v*dt/2/dx

Hello I need help in this code because i don’t know what’s wrong with it. JUST FOR THE THIRD QUESTION
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import erfc
x=np.linspace(0, L)
cO=100
v=5
D=8
+1=1
t2=3
t3=5
L=50
A1=(x-v*+1)/(2*np.sqrt(D*t1))
A2=(×+v*t1)/(2*np.sqrt(D*t1))
line c1=c0/2*(erfc(A1)+np.exp(v*x/D)*erfc(A2))
B1=(x-v*t2)/(2*np.sqrt(D*t2))
B2=(×+v*+2)/(2*np.sqrt(D*t2))
line_C2=c0/2*(erfc(B1)+np.exp(v*x/D)*erfc(B2))
C1=(x-v*t3)/(2*p.sqrt(D*t3))
C2=(x+v*[3)/(2*np.sqrt(D*t3)
line_C3=c0/2*(erfc(C1)+np.exp(v*x/D)*erfc(C2))
plt.plot(x, line_c1)
plt.plot(x, line_C2)
plt.plot(x,line_C3)
ca=0
cb=100
D=8 #m^2/d
v=5
L=50
dx=1
x=np.linspace(0, L, dx)
dt=(0.05)
tmax1=1
tmax2=3
tmax3=5
nsteps=int(tmax3/dt);
P=D*dt/dx/dx
R=v*dt/2/dx
A=P+R
B=1-2*P
C=P-R
nnodes=51
cold=np.zeros(nnodes)
cold[0]=cb
cold[nnodes-1]=ca
c=np.zeros(nnodes)
print(nnodes)
print(cold)
for k in range(0,nsteps):
c = ca*np.ones(nnodes)
c[0] = cb
for i in range(1, nnodes-1):
c[i]=A*cold[i-1]+B*cold[i]+C*cold[i+1]
val=A*cold[i-1]+B*cold[i]+C*cold[i+1]
#break
cold=c
# break
print(cold)
x_p=np.linspace(0, 50, 51)
print(len(cold), len(x_p))
plt.plot(x_p, cold,label=’numerical 5 days’)
#####################################################3
nsteps2=int(tmax2/dt);
P=D*dt/dx/dx
R=v*dt/2/dx
A=P+R
B=1-2*P
C=P-R
nnodes=51
cold=np.zeros(nnodes)
cold[0]=cb
cold[nnodes-1]=ca
c=np.zeros(nnodes)
print(nnodes)
print(cold)
for k in range(0,nsteps2):
c = ca*np.ones(nnodes)
c[0] = cb
for i in range(1, nnodes-1):
c[i]=A*cold[i-1]+B*cold[i]+C*cold[i+1]
val=A*cold[i-1]+B*cold[i]+C*cold[i+1]
#break
cold=c
# break
print(cold)
x_p=np.linspace(0, 50, 51)
print(len(cold), len(x_p))
plt.plot(x_p, cold,label=’numerical 3 days’)
nsteps3=int(tmax1/dt);
P=D*dt/dx/dx
R=v*dt/2/dx
A=P+R
B=1-2*P
C=P-R
nnodes=51
cold=np.zeros(nnodes)
cold[0]=cb
cold[nnodes-1]=ca
c=np.zeros(nnodes)
print(nnodes)
print(cold)
for k in range(0,nsteps3):
c = ca*np.ones(nnodes)
c[0] = cb
for i in range(1, nnodes-1):
c[i]=A*cold[i-1]+B*cold[i]+C*cold[i+1]
val=A*cold[i-1]+B*cold[i]+C*cold[i+1]
#break
cold=c
# break
print(cold)
x_p=np.linspace(0, 50, 51)
print(len(cold), len(x_p))
plt.plot(x_p, cold,label=’numerical 1 day’)
plt.legend()

Categories
Python

Plt.plot(x,c3)

Hello i need help in the third question only. I’ve write half of the code and i need your help to make it work.
this is my answer..
import matplotlib.pyplot as plt
import numpy as np
from scipy import special
D=8
v=5
ca=0
cb=100
L=50
dt=0.05
tmax=5
dx=1
x=np.arange(0,L+dx,dx)
t1=1
t2=3
t3=5
c1=(cb/2)*(special.erfc((x-(v*t1))/(2*np.sqrt(D*t1)))+np.exp((v*x)/D)*special.erfc((x+(v*t1))/(2*np.sqrt(D*t1))))
plt.plot(x,c1)
c2=(cb/2)*(special.erfc((x-(v*t2))/(2*np.sqrt(D*t2)))+np.exp((v*x)/D)*special.erfc((x+(v*t2))/(2*np.sqrt(D*t2))))
plt.plot(x,c2)
c3=(cb/2)*(special.erfc((x-(v*t3))/(2*np.sqrt(D*t3)))+np.exp((v*x)/D)*special.erfc((x+(v*t3))/(2*np.sqrt(D*t3))))
plt.plot(x,c3)
plt.legend([‘t= 1 year’, ‘t= 3 years’, ‘t= 5 years’])
plt.xlabel(‘x’)
plt.ylabel(‘c’)
P=(D*dt)/(dx**2)
R=(v*dt)/(2*dx)
A=P+R
B=1-2*P
C=P-R
nnodes=x+1
nsteps=tmax/dt
cold=0
c = ca*np.ones(nnodes)
c[0] = cb
for i in range(1,nnodes-1):
c[i] = A*cold[i-1]+B*cold[i]+C*cold[i+1]