1

I have been trying to find a method to optimize a function that gives me a 2D-array for a temperature field such that the value at a specific position within that array corresponds to a target value.

Pc=Fc*D*n*m.pi/1000
Bwp=0.1
V=1
Qwp=Pc*Bwp
betamax=0.20033
Acontact=20
qwp=Qwp/Acontact

def kappa(z):
    k=m.asin((z-R1)/R)
    return k

qmax=qwp*(kappa())*m.sin(betamax)/(1-m.cos(betamax))

def Tfieldcalc(X,Z,V):    

    def f1(z):#inner bessel
        return (vf/2/alpha)*m.sqrt((Z+z)**2+(X-r(z))**2)

    def f2(z):#bessel
        return sci.special.kn(0,f1(z))

    def f3(z):#whole temperature calculation
        return (V*qmax*m.sin(kappa(z))/m.sin(kappa(ap)))*m.exp((-vf*(X-r(z)))/(2*alpha))*f2(z) 

    return (1/(m.pi*lmbda))*sci.integrate.quad(lambda z:f3(z),0,ap)[0]

sammlung = np.zeros([dd,dd])#int(np.floor((m1/n1)*dd))])    

f=0
for X in np.linspace (-n1*D/2, n1*D/2, dd):
    g=0
    for Z in np.linspace(-m1*ap,m1*ap,dd):#int(np.floor((m1/n1)*dd))):
        if (X < r(abs(Z)) and Z < 0 ) or Z<-ap:
            TM=0
        else:
            TM= Tfieldcalc(X,Z,V)
            sammlung[g,f]=TM
        g=g+1
    f=f+1
sammlung=sammlung+40
 

This part of code creates the array, and now I need for g[37,100] the target value to be reached and the rest of the temperature field calculated accordingly with the same coefficients, whereby the coefficients I want to vary are Bwp and V.

Thanks in advance, I really appreciate someone to help me find a solution. And if any further information is needed, or I did not explain the problem sufficiently feel free to ask

mango091
  • 11
  • 3

0 Answers0