Domain changed to archive.palanq.win . Feb 14-25 still awaits import.
[9 / 1 / 1]

Python modelling

No.1455587 View ViewReplyOriginalReport
I'm struggling a lot in answering or even getting started with this question. I'm doing a process modelling course, and they've decided to add in python coding to the last quarter of the semester.

The course is difficult as shit and I haven't done python in ages so I'm struggling to even get started.

The code I have so far is:

import numpy as np
from numpy.linalg import eig
from scipy.integrate import odeint
from scipy.optimize import fsolve
import matplotlib.pyplot as plt

def dxdt(theta, t, *params):
f, v, k = params
dtheta = f * v**2 * np.cos(theta) - k*theta**2
return dtheta
v = 1.8
f = 2.1
k = 6.2
theta = np.linspace(0,90,101).T # assume the lid angle ranges between 0 and 90 degrees
#print(theta)
n = 0
for x in theta:
dtheta = fsolve(dxdt,x,args = (0,f,v,k))
print(theta[n],dtheta)
n = n+1

Any help would be great. I just need to know how to even get around forming the foundational code for the function and stuff. thanks.