Texas Investment Network


Recent Blog


Pitching Help Desk


Testimonials

"For those of you that are asking yourself whether this site is real, the answer is yes. My first thought was that I would put my proposal on the site and it would be sent for review, and at this point someone from within the Dealflow Investment Network office would contact me as an investor so I would be more likely to pay the $249 fee. I received 8 responses from investors overnight and 2 more since then. Thanks Dealflow Investment Network."
David Kriedeman - Chris Christopherson Inc

 BLOG >> Recent

Implementing a business model in PHP [Business Models
Posted on February 11, 2013 @ 05:07:00 AM by Paul Meagher

In my previous article, I critized the idea that you could claim to have a business model if it was not sufficiently well defined that you could run it as a computer program that would estimate costs, revenue, and profit over time. I concluded by saying that I would reveal a runnable business model in my next article. Well, here it is.

I developed a script called monthly_growth.php which implements a business model that assumes you will grow your business by a certain number of new customers each month and those customers will each pay a monthly fee for your service. The revenues from new and existing customers each month is offset by two types of costs - a fixed monthly cost for "rents" and a variable costs associated with the cost of servicing each client. As the number of clients grows this servicing cost grows.

I run the script by pointing my browser at the url where it resides on my web server. If you host a site you probably have access to a PHP interpreter so could potentially run this script by saving it in a web folder on your site and then typing in the url to that file in your web browser. If you have the php module running in your webserver then you will see the table output below when you do so. I will also be making a web-based front end to this script in it's next iteration so that you can just run the model from this site by entering values in the input form. I did, however, want you to see the "guts" of what an implemented business model looks like so wanted to keep this version as simple as possible to make it easier to follow and modify for your own purposes.

Before running the script you need to review a few settings and change them to values that might be more appropriate to your situation. In this example, I'm assuming that we are starting from 0 customers, will add 10 new customers each month, and each of those customers will pay a monthly fee of $30. The monthly fixed fee, the "rents", is assumed to be $1000 a month and the cost of servicing each customer is assumed to be $10 a month. I'm interested in projecting out to 3 years into the future. This set of configurations generates this business model output:

YearMonth# CustomersRevenuesCostsProfits
2013 2 10 $300.00 $1,100.00 -$800.00
2013 3 20 $600.00 $1,200.00 -$600.00
2013 4 30 $900.00 $1,300.00 -$400.00
2013 5 40 $1,200.00 $1,400.00 -$200.00
2013 6 50 $1,500.00 $1,500.00 $0.00
2013 7 60 $1,800.00 $1,600.00 $200.00
2013 8 70 $2,100.00 $1,700.00 $400.00
2013 9 80 $2,400.00 $1,800.00 $600.00
2013 10 90 $2,700.00 $1,900.00 $800.00
2013 11 100 $3,000.00 $2,000.00 $1,000.00
2013 12 110 $3,300.00 $2,100.00 $1,200.00
2014 1 120 $3,600.00 $2,200.00 $1,400.00
2014 2 130 $3,900.00 $2,300.00 $1,600.00
2014 3 140 $4,200.00 $2,400.00 $1,800.00
2014 4 150 $4,500.00 $2,500.00 $2,000.00
2014 5 160 $4,800.00 $2,600.00 $2,200.00
2014 6 170 $5,100.00 $2,700.00 $2,400.00
2014 7 180 $5,400.00 $2,800.00 $2,600.00
2014 8 190 $5,700.00 $2,900.00 $2,800.00
2014 9 200 $6,000.00 $3,000.00 $3,000.00
2014 10 210 $6,300.00 $3,100.00 $3,200.00
2014 11 220 $6,600.00 $3,200.00 $3,400.00
2014 12 230 $6,900.00 $3,300.00 $3,600.00
2015 1 240 $7,200.00 $3,400.00 $3,800.00
2015 2 250 $7,500.00 $3,500.00 $4,000.00
2015 3 260 $7,800.00 $3,600.00 $4,200.00
2015 4 270 $8,100.00 $3,700.00 $4,400.00
2015 5 280 $8,400.00 $3,800.00 $4,600.00
2015 6 290 $8,700.00 $3,900.00 $4,800.00
2015 7 300 $9,000.00 $4,000.00 $5,000.00
2015 8 310 $9,300.00 $4,100.00 $5,200.00
2015 9 320 $9,600.00 $4,200.00 $5,400.00
2015 10 330 $9,900.00 $4,300.00 $5,600.00
2015 11 340 $10,200.00 $4,400.00 $5,800.00
2015 12 350 $10,500.00 $4,500.00 $6,000.00
2016 1 360 $10,800.00 $4,600.00 $6,200.00
2016 2 370 $11,100.00 $4,700.00 $6,400.00

So what we have here are monthly estimates of cost, revenue, and profit over a three year period. We can see how our revenues grow faster than our costs and eventually starts producing a profit situation which increases over time. You might be saying "but the assumptions are too simple". You might argue that customers won't come in as regular blocks of 10 new customers a month but rather as a smaller number per month at the beginning and a larger number per month as your business gains momentum. The beauty of providing you with the source code is that you are now empowered to change the business model so that customer growth follows, say, an exponential function or piecewise-linear function rather than a simple linear one. You can do that if you have access to the source code which is provided below (with lots of comments in the code that preclude the need for me to explain it much more):

<?php 
/**
* Prototypical business model involving the generation of monthly 
* revenue based upon the number of existing customers plus new 
* customers per month with each customer paying a monthly fixed fee.  
* Costs based upon monthly fee for servicing "rents" and a cost per 
* customer (variable cost) for providing the service to the customer.
*
* Assumes simple linear growth. 
*
* @script: monthly_growth.php
* @author: Paul Meagher
* @version: 0.1
* @modified: Feb 11, 2012
*/

// PART 1: CHANGE THESE SETTINGS

// Set number of years for your projections.
$num_years 3;

$num_new_customers_per_month 10;
$monthly_fee_per_customer 30;
$monthly_cost_per_customer  10;

// Cost of "rents" per month.
$fixed_cost_per_month 1000;

// Starting number of customers customers - default 0.  
$num_customers 0;  

// Set money formatting according to a locale setting.
setlocale(LC_MONETARY'en_CA');

// Starting month - defaults to current month.
$start_month date("n");

// PART 2: DO NOT CHANGE THESE INITIALIZATION SETTINGS

// setup year number to year date mapping for reporting purposes
$year_num_to_year_date[1] = $next_year date("Y");
for(
$n 2$n <= $num_years+1$n++) {
    
$next_year $next_year 1
    
$year_num_to_year_date[$n] = $next_year;
}

// Zero the parameters we will be estimating
$costs    = array();
$revenues = array();
$profits  = array();

// PART C: GENERATE REPORT PROVIDING ESTIMATES OF COST, 
// REVENUES, & PROFITS
?>

<table border='1' cellpadding='5' cellspacing='0'>
  <thead>
    <tr>
      <th>Year</th><th>Month</th><th># Customers</th>
      <th>Revenues</th><th>Costs</th><th>Profits</th>
    </tr>
  </thead>
  <?php
  
if ($start_month == 1
    
$y_end $num_years;
  else
    
$y_end $num_years 1
  
  for(
$y=1$y<=$y_end$y++) {
      
      if (
$y == 1
        
$m $start_month;
      else
        
$m 1;
    
    for (
$m$m<=12$m++) {
      
$num_customers $num_customers $num_new_customers_per_month;
      
$year_date     $year_num_to_year_date[$y];
      
// the data structures don't have to be this complicated
      // but they can be used in downstream calculatios more  
      // easily in this format
      
$costs[$year_date][$m]    = ($num_customers $monthly_cost_per_customer
                                  + 
$fixed_cost_per_month;
      
$revenues[$year_date][$m] = $num_customers $monthly_fee_per_customer;
      
$profits[$year_date][$m]  = $revenues[$year_date][$m] - $costs[$year_date][$m];
      if ((
$y == $y_end) AND ($m == ($start_month+1)))
        break; 
      
?>
      <tr>
       <td><?php echo $year_date ?></td>    
       <td align='center'><?php echo $m ?></td>    
       <td align='center'><?php echo $num_customers ?></td>           
       <td align='right'><?php echo money_format('%n'$revenues[$year_date][$m]) ?></td>    
       <td align='right'><?php echo money_format('%n'$costs[$year_date][$m]) ?></td>    
       <td align='right'><?php echo money_format('%n'$profits[$year_date][$m]) ?></td>    
      </tr>
      <?php
    
}
  }
  
?>
</table>

There is more to be said and done on the topic of business models so I may continue posting on this topic this week.

Permalink 

 Archive 
 

Archive


 November 2019 [1]
 October 2019 [2]
 September 2019 [1]
 July 2019 [1]
 June 2019 [2]
 May 2019 [2]
 April 2019 [5]
 March 2019 [4]
 February 2019 [3]
 January 2019 [3]
 December 2018 [4]
 November 2018 [2]
 September 2018 [2]
 August 2018 [1]
 July 2018 [1]
 June 2018 [1]
 May 2018 [5]
 April 2018 [4]
 March 2018 [2]
 February 2018 [4]
 January 2018 [4]
 December 2017 [2]
 November 2017 [6]
 October 2017 [6]
 September 2017 [6]
 August 2017 [2]
 July 2017 [2]
 June 2017 [5]
 May 2017 [7]
 April 2017 [6]
 March 2017 [8]
 February 2017 [7]
 January 2017 [9]
 December 2016 [7]
 November 2016 [7]
 October 2016 [5]
 September 2016 [5]
 August 2016 [4]
 July 2016 [6]
 June 2016 [5]
 May 2016 [10]
 April 2016 [12]
 March 2016 [10]
 February 2016 [11]
 January 2016 [12]
 December 2015 [6]
 November 2015 [8]
 October 2015 [12]
 September 2015 [10]
 August 2015 [14]
 July 2015 [9]
 June 2015 [9]
 May 2015 [10]
 April 2015 [10]
 March 2015 [9]
 February 2015 [8]
 January 2015 [5]
 December 2014 [11]
 November 2014 [10]
 October 2014 [10]
 September 2014 [8]
 August 2014 [7]
 July 2014 [6]
 June 2014 [7]
 May 2014 [6]
 April 2014 [3]
 March 2014 [8]
 February 2014 [6]
 January 2014 [5]
 December 2013 [5]
 November 2013 [3]
 October 2013 [4]
 September 2013 [11]
 August 2013 [4]
 July 2013 [8]
 June 2013 [10]
 May 2013 [14]
 April 2013 [12]
 March 2013 [11]
 February 2013 [19]
 January 2013 [20]
 December 2012 [5]
 November 2012 [1]
 October 2012 [3]
 September 2012 [1]
 August 2012 [1]
 July 2012 [1]
 June 2012 [2]


Categories


 Agriculture [71]
 Bayesian Inference [14]
 Books [15]
 Business Models [24]
 Causal Inference [2]
 Creativity [7]
 Decision Making [15]
 Decision Trees [8]
 Design [36]
 Eco-Green [4]
 Economics [12]
 Education [10]
 Energy [0]
 Entrepreneurship [61]
 Events [2]
 Farming [20]
 Finance [25]
 Future [15]
 Growth [18]
 Investing [24]
 Lean Startup [10]
 Leisure [5]
 Lens Model [9]
 Making [1]
 Management [9]
 Motivation [3]
 Nature [22]
 Patents & Trademarks [1]
 Permaculture [34]
 Psychology [1]
 Real Estate [2]
 Robots [1]
 Selling [11]
 Site News [15]
 Startups [12]
 Statistics [3]
 Systems Thinking [3]
 Trends [7]
 Useful Links [3]
 Valuation [1]
 Venture Capital [5]
 Video [2]
 Writing [2]