Hello,
I'm trying to plot this function with using this values:

Rh = 9.8    
H0 = 0.063 

def Thickness_H(H0, r, Rh): 
      return float(H0)*np.exp(float(r)/float(Rh))

r = np.linspace(0,1, 10)    
x =Thickness_H(H0, r, Rh)
plt.plot(r, x)
plt.show()

I'm trying to defind r like what i know but this dose not work, I'm getting this error:
only length-1 arrays can be converted to Python scalars.

may you please help me in this point?
Thank you

I don't understand your question. If you write return H0*np.exp(r/Rh), the code works and draws a curve, which is almost a straight line (I suppose it is because 1/Rh is small).

I want to plot this function

H0*np.exp(r/Rh)
I definded it, then I want to plot it, r is different values ? yes you are right I will get exponential curve?

Edited 7 Months Ago by ALosh99

This question has already been answered. Start a new discussion instead.