-2

It return error

'TypeError: can't convert expression to float'

import numpy as np
import matplotlib.pyplot as mp
import scipy
import math
import sympy

def DoQuestion4():
    delta = 0.05
    d_vc = 50
    N = 10000

    # Parrondo and Van den Broek
    elpsilon3 = sympy.Symbol("elpsilon3")
    lnFactor =  round(math.log((6 * ((2 * N)**d_vc))/ delta),2)
    elpsilon3 = sympy.solve(math.sqrt((2 * elpsilon3 + lnFactor)/ N) - elpsilon3,elpsilon3)
  • Take a look at this: https://stackoverflow.com/questions/22555056/typeerror-cant-convert-expression-to-float – Fusseldieb Jul 02 '18 at 17:12
  • Possible duplicate of [TypeError: can't convert expression to float](https://stackoverflow.com/questions/22555056/typeerror-cant-convert-expression-to-float) –  Jul 03 '18 at 15:38

1 Answers1

0

I replace the math.sqrt() to sympy.sqrt(), and it is correct, amazon, so I will replace all the non sympy function.