mathcad

From Mathcad Minimize to SciPy Minimize

From Mathcad Minimize to SciPy Minimize Question: I tryed to convert this Mathcad code into the SciPy Python. My code in Python: from scipy.optimize import minimize from scipy.optimize import LinearConstraint import numpy as np A=[[1,1,0,1],[-1,-1,1,0],[0,0,-1,-1]] V=[[1000, 1000], [0, 0],[-1000, -1000]] linear_constraint = LinearConstraint (A, V[0],V[1],V[2]) x0 = np.array([0.1,0.1,0.1,0.1]) f = [5*10**-9,2*10**-9,6*10**-8,2*10**-8] def func(x): sum=0 for …

Total answers: 1

Translation from Mathcad to Python

Translation from Mathcad to Python Question: I can’t translate a formula from Mathcad to Python. Stuck on "a". Here’s what I was able to do: from matplotlib import pyplot as plt import numpy as np k1 = 1 b = 1.51 D = (1/b) * (np.sqrt(k1/np.pi)) x0 = 10 * b myArray = np.arange(0, 24, …

Total answers: 1