SHARE
TWEET

Untitled

a guest Feb 11th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pyeq3, warnings
  2. warnings.filterwarnings("ignore") # we can ignore covariance warning
  3.  
  4. functionString = '4 * log(X/n)/log(n/m) + 5'
  5.  
  6. # note that the constructor is passed the function string here
  7. equation = pyeq3.Models_2D.UserDefinedFunction.UserDefinedFunction(inUserFunctionString = functionString)
  8.  
  9. textData = '''
  10. X     Y
  11. 1  -1.2131790227
  12. 2   1
  13. 3   2.2946267356
  14. 4   3.2131790227
  15. 5   3.9256635291
  16. '''
  17.  
  18. pyeq3.dataConvertorService().ConvertAndSortColumnarASCII(textData, equation, False)
  19.  
  20. equation.Solve()
  21.  
  22. for i in range(len(equation.solvedCoefficients)):
  23.     print("    %s = %-.16E" % (equation.GetCoefficientDesignators()[i], equation.solvedCoefficients[i]))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top