Sorry, not very close. You have neglected some features.
1) Initial balance. A(0) probably isn't zero. Note Part B.
2) Earnings and Expenses occur each year, not just once. You do have the expenses doing that, but not the income.
If you change just two things, it might be close, but perhaps only by luck. change your 4500 to A(0) and change 5000 to 500.
Give it some thought.