Python Forum
Using np.linspace, creating a recursive graph
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using np.linspace, creating a recursive graph
#1

Okay so I know I post on this project a lot, but I'm very new to python coding, and this has been very helpful. Basically I have a new run time issue wherein I have my function subtracting from the total population as found in the last timestep. I know my problem is in the fact that I am multiplying each variable by the total, growing population, rather than the last population. Does anyone know how to call the last calculated y value using np.linspace?
x= np.linspace(0, 400, num=400000)
ax.set_title('cumulative decrease in consumption')
ax.set_xlabel('$Quarter$')
ax.set_ylabel('$Percent of the Population$')
ax.plot(x, ((initialPop * np.exp(popGrowth * (x/4)))-(newsDiscussion(1, 20, x, 0.0015, 0.003, 0.55)*(initialPop * np.exp(x/4)))-(Tax2(156, 160, x, 0.05775, 0.1155, 0.55)-(initialPop * np.exp(x/4)))-(Tax1(80, 84, x, 0.77, 0.154, 0.55)*(initialPop * np.exp(x/4)))-(runVeganuaryMain(x))*(initialPop * np.exp(x/4))), 'p-', lw=1, alpha=0.6, label='Major Graph')
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Combine Two Recursive Functions To Create One Recursive Selection Sort Function Jeremy7 12 7,338 Jan-17-2021, 03:02 AM
Last Post: Jeremy7

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020