Octave Analysis of Logistic Growth Model for Pig Pen: Its Economic Viability


Pig pen is fast becoming a very lucrative system of farming in Nigeria, most especially in the South-Eastern region of the country. This form of animal farming is very cost effective and does not need much training before someone ventures into it, as pigs are a very special breed of animals that can eat almost any kind of food, and they do not fall sick easily when compared with chicken poultry or fish poultry business. This paper also discussed how swine breeding could help in addressing environmental waste pollution, because most of the waste generated from the food we eat which would have form polluted the environment could be converted to feeds for the pigs, which indirectly help to tackle waste generation problem. This study uses logistics growth model to analyze the breeding process of pigs in a given location. Octave 4.2.1 was used to graph the pig’s population against time in years. We then analyzed the growth pattern of the pigs in the pen during some proposed period. From this analysis, we came up with some policies that maintain the pig population in the pen without having to over shoot the carrying capacity of the pen.

Share and Cite:

Abang, I. , Nze, O. , Oriola, O. and Amasiatu, I. (2020) Octave Analysis of Logistic Growth Model for Pig Pen: Its Economic Viability. Open Access Library Journal, 7, 1-10. doi: 10.4236/oalib.1106215.

1. Introduction

In recent times, pig farming has experienced many changes with respect to its production management using ICT for information accessibility and dissemination. Globally, the majority of pig farming constitutes the livelihood of rural poor belonging to the lowest socio-economic strata and they have no means to undertake scientific pig farming with improved foundation stock, proper housing, feeding and other management. In Nigeria, pig poultry is very popular amongst the local backward and weaker section of the society, especially in the South Eastern (SE) region of Nigeria. In the SE part of Nigeria, pig farming fits perfectly well with the integrated farming and also can be complementary to intensive crop production programme. In Enugu, a state in the South-Eastern part of Nigeria, pig farming is seen to have a tremendous potentiality on the improvement of swine production through scientific management, in the SE region, swine production deficit is aggravated due to traditional ways of pig rearing like feeding of locally available feed stuff and scavenging, improper breeding, sizeable population of non-descript pigs and non-availability of good quality pig germ plasm always remains matter of concern. A conceptual model can be used to assist scientists in their attempts to understand pig growth and its underlying biological principles. However, a good conceptual model is not necessarily useful as an advisory tool in commercial animal production (De-Lange et al., 2001) [1].

The reduction of environmental challenges due to the impact of pig production is of prime importance for its durability, as well as the decrease of production cost or the improvement of meat quality (Dourmad et al., 2003) [2].

Beyond gainsay, it has been established by the evidences around that some pig farmers have been credited for using their pigs to reduce environmental waste generated in within their community. This thus set us thinking about the future of this industry and some research questions were raised, which this work will attempt to answer. It is expedient to raise an issue of sustainability in an arena of looming uncertainty. These questions are: 1) will the population of pigs change with change in time? 2) Can the population be regulated? 3) Can pig rearing help us tackle some environmental challenges?

Some of these questions have been carefully attended to by the formulation of a logistics growth model for the pig pen and using policy suggestions as a veritable instrument of control to safe the situation. This study is a theoretical approach in solving an industry related problem in Nigeria. The study set up the following objectives to achieve its main goal of using pig to tackle some environmental challenges in our community. These are: 1) Design a mathematical model to address population growth; 2) Set carrying capacity for the pig pen; (3) Propose policies that would assist pig farmers to support environmental waste management body.

2. Literature Review

Saying that the growth and development of any nation depends largely to an extent on the development of the primary industry, of which agriculture is a key player. Unlike traditional development economists such as Arthur Lewis who believed that agriculture plays a passive and supportive role, modern development economists have come to realize that the agricultural sector in particular and the rural economy in general must play an indispensable part in any overall strategy of economic progress, especially in developing countries. More significantly, majority of the world’s poor live in the rural areas and depends upon agriculture for their livelihood. Agriculture is therefore critical for poverty reduction, economic development and environmental management. The agricultural sector continues to play a crucial role for development, especially in low-income countries where the sector is large both in terms of aggregate income and total labour force (Ehigiamusoe and Uyi, 2012 [3]; Agbugba and Binaebi, 2018 [4]).

What is Growth?

Growth is an important attribute of organisms and hardly seems to justify any particular formal definition. The simple concept of growth as an increase in size, which goes back to Aristotle, is preferred to the many more complicated descriptions often proposed (Wellock et al., 2004) [5].

According to Wellock et al. in 2004, growth should be seen as a continuous process. It is assumed that potential growth is a continuous process that results in a single, smooth growth curve and a similarly smooth growth rate curve when plotted against size.

Growth Model

A Growth Model is a representation of the growth mechanics and growth plan for living thing or product. The following are the two approaches which growth model uses to address issues:

1) Population dynamics and 2) Economic growth

-Population Dynamics: This is a form of life sciences that study the size and age composition of population as dynamical systems, and the biological and environmental processes driving them (such as birth and death rates, and by immigration and emigration) (Castellano, 2013) [6]. Population dynamics have the following types of examples: 1) aging population, 2) population growth, 3) population decline. But in this study we would dwell more with the population growth aspect of the dynamics.

The most famous extension of the exponential growth model is the Verhulst model, also known as the logistic growth model, where the per capita rate of change decreases linearly with the population size. In this study we would focus on this particular form of growth model for our discussion.

Other models, such as the Gompertz growth d n d t = α n ln k n , exhibit many of the same properties, but the logistic equation is arguably the best-known and most widely applied rate equation for population growth and population invasion(Mendez et al., 2015) [7].

Population Growth: in the study of life and living organisms, population growth could be seen as an increase in the number of individuals in a population.

Logistic growth Model: Pierre Verhulst proposed a model, called the logistic model, for population growth around 1838. The model, did not assume unlimited resources. Instead, it assumes there is a carrying capacity k for the population. This k is the steady population level. But if the population is above k, it will decrease, but if it is below, then it will increase (Joyce, 2013) [8]. The Logistic growth model is where the analysis of our study would be based on.

The following are some of the conditions to know that a logistics growth is occurring:

・ Logistic population growth will occur once the population numbers begin to approach a predetermined carrying capacity.

・ This carrying capacity is the maximum number of species that can be sustainably supported by the environment/container.

・ As a population approaches the carrying capacity, opposition environmental occurs, slowing the rate of growth.

・ This results in an “S-shaped” growth curve that plateaus as it creeps toward the carrying capacity (denoted by k).

・ Logistic growth will eventually be seen in any stable population occupying a fixed geographic space.

3. Methodology

The concept of logistic model was adopted in this study to determine the rate of change of pig population in the pen.

Viability of products obtained from pigs.

Every pig can provide us with a wide range of products. The main commodity of pig production is pork. Pork represents high value animal protein and is the most consumed meat in the world. Commonly, some other pig by-products are used for many and various purposes, which are: bone collagen is used in the food processing and cosmetic industry; hairs are used for brushes (Dietze, 2011) [9].

Benefits of pig/boar hair for hair brush

1) Pig bristles spread your scalp’s natural oils.

2) Does not let your hair get dirty, greasy or look wet.

3) It gives hair strength, suppleness, and a healthy sheen.

4)Prevents hair from falling out (most common issue with new moms).

5) Pig bristle brushes are 100% natural & chemical free.

In general boar or pig bristles keeps your hair healthier than they ever have been & makes your hair look amazing and natural.

Benefits of pig/boar bones

Pig bones are very much useful long after its flesh have been consumed. However, bones were much more useful historically. Before the creation of plastics, bones were a common material for tools and objects, the following were some of its uses:

・ flutes.

・ fertilizer.

・ food: the bone marrow is used as food in many Asian countries (Iran, Indian etc).

・ Divination tool:

・ Shovels: These shovels were most often shoulder blades, or scapulae. The shoulder and pelvic bones of large animals were used by the Cherokee to make shovels. Pre-historically, shovels were made from the complete shoulder blades of a pig, ox or deer, in addition to its antler handle. In China, bone shovels could be made from pig scapulae or ox scapulae.

Difference between Grass-Fed and Grain-Fed Pig

Globally most pigs start out living similar lives. Pigs give birth twice in a year, they start by drinking milk from their mother’s and many are then allowed to roam free and eat grass or other edible plants or food stuffs they find in their environment. This continues for about six to nine months.

Collections of pigs are called litter or drift; they are kept in confined stalls known as pen, often within limited space.

They are rapidly fattened up with grain-based feeds, usually made from a base of soy or corn. Typically, their diet is also supplemented with small amounts of dried grass. Pigs virtually eat every food items available. To maximize growth, pigs are often given drugs, such as antibiotics, and growth hormones.

4. Discussion

In this section, we would discus on what population regulation is, we would also discuss slightly on population density, and then we would derive the logistic growth model which is our focus on this paper.

What is population regulation?

Population regulation could be seen as a density-dependent process, in other words, it means that population growth rates are regulated by the density of a population. Regulation arises as a result of potentially stabilizing density, which could be seen as some dependent processes, even when brought about by “non-equilibrium” mechanisms (Murdoch, 1994) [10].

Population Density: This is a measurement of population per unit area or unit volume. In the case of this study, the unit area is the pen.

There are two different categories of population regulation, these are: 1) Population density dependent; 2) Population density independent

Model Assumptions

1) Let the pen be stocked with 5 pigs.

2) Out of the 5 pigs, we have 2 males and 3 females.

3) The population grows by 40%.

4) Let the carrying capacity be 100, here we represent it as k.

5) We have a growth rate constant, or decay rate when it becomes negative.

6) We use logistics growth model.

7) We do the analysis for a 20 year period.

The Model

If we use logic to start the representation of our model, we could then say that:

Rate of change of the population under investigation α the current population, that is the rate of change of the population is directly proportional to the current population growth.

This could be represented mathematically as:

d N d t = r N (3.1)

where N represents population of pigs at time t and it is a function of t; r is a constant, it represents the rate constant of the growth.

Considering Equation (3.1), we discovered that the population growth of the pig will continue to infinity, but we know that this would never happen in reality, because of some of the following reasons: 1) Environment cannot have unlimited resources, 2) there must be a carrying capacity for the system, in other words, there must be a maximum size of the population, 3) there are constraints imposed on growth. If all these conditions are not checked and the population continues to grow to infinity, there will come to a time when there would be no place for the species under investigation to stay, there will be no food etc, so population would by default become stationary.

So we need to make the model of Equation (3.1) to be more realistic, to inculcate the idea that population cannot keep on growing to infinity.

Logistic growth Model for Pig growth

d N d t = r N ( 1 N k ) , k > 0 (3.2)

N ( 1 N k ) is a function of population N.

k is a function of time, t.

N is a function of time, t.

Analysis of equation (3.2)

・ If N(t) is strictly greater than zero, but N(t) is very much smaller than k, then 1 N k is almost equal to 1, this represented mathematically as:

N ( t ) > 0 , N ( t ) k , ∴ 1 N k 1 and we have an exponential growth.

・ If zero is less than N(t), where N(t) is also less than k, then 1 N k is greater than zero, then change of population with time is also greater than zero. Here we can call N(t) an increasing function. Represented as:

0 < N ( t ) < k , 1 N k > 0 , also d N d t > 0 , when N(t) is increasing.

・ If N(t) is strictly greater than k, then 1 N k is strictly less than zero, so change in the pig population with respect to time is strictly less than zero, then N(t) is a decreasing function:

N ( t ) > k , 1 N k < 0 , so d N d t < 0 , N(t) is decreasing.

・ If N(t) is equal to k, then 1 N k is equal to zero, so change of the pig population equals zero and N(t) is constant:

N ( t ) = k , 1 N k = 0 , so d N d t = 0 , N(t) is constant.

Next we rearrange Equation (3.2), to give the following:

Multiply through Equation (3.2) by k;

k d N d t = r N ( k N ) (3.3)

k d N ( k N ) N = r d t (3.4)

Since the above equation is a separable differential equation, we then rearrange the equation before performing the integration on Equation (3.4) to get the following equation:

d N ( k N ) N = r d t (3.5)

Next we solve the right hand side (RHS)

r d t = r t + c (3.6)

Now we solve for the left hand side (LHS)

d N ( k N ) N = d N N + d N k N

ln | N | ln | k N | = ln | N k N | (3.7)

Combining the results from Equation (3.6) and Equation (3.7)

ln | N k N | = r t + c (3.8)

By inversion, Equation (3.8) becomes

ln | k N N | = r t c (3.9)

By solving (3.9), we arrive at a solution for the logistic growth model

N ( t ) = k B e r t + 1 , B (4.0)

Equation (4.0) is the generalize form for the logistic growth model, the algebraic equation in (4.0) gives the general form of the logistic growth model, this form considers all possible solutions that is likely to be gotten when the differential equation is solved.

N ( t ) = k 19 e r t + 1 , B (4.1)

In Equation (4.1), we have the particular solution for the logistic growth model. Here we replace B in Equation (4.0) with 19, which we use to analyze our solution geometrically.

We then use Equation (4.1) to get an analysis for the population growth trend for this study.

N ( 0 ) = 5 , N ( 1 ) = 7 , N ( 2 ) = 10 , N ( 3 ) = 15 , N ( 4 ) = 26 , N ( 5 ) = 28 , N ( 6 ) = 37 , which we further analyzed using Octave 4.2.1.

In Figure 1, we plotted a graph of pig population against time, where we noticed from the graph that at the initial stage the population grew exponential after some period it formed a plateau, where the growth then was not really noticeable.

5. Conclusion

This study identified a major opportunity in the agricultural industry in Nigeria, which has to do with rearing of pigs, and how this practice could help tackle some environmental challenges such as waste generated from food stuff and also contribute positively to the nation’s economy. Pork meat if properly invested in and supported by the government, is a very suitable alternative to cow meat, chicken.

Policy Recommendation

It is expedient that the government come up with policies that would guide farmers of pig, on the number of pigs that would/should be in a particular size of pen. Since pig farming has the potentials to contribute positively to the GDP of Nigeria, if the government would genuinely focus its energy on promoting it.

Figure 1. Logistic growth population of pig against time.

The farmers also should be advised to act responsibly and keep their pigs within the pen, to avoid them causing damages to properties within the communities.

Further study can be done with stiffer constraints, to make the work a bit more complex, so as to bring more improvement to existing study.


It is of our utmost interest to acknowledge God Almighty who is our all-in-all. Father, your services of protection, guidance and provision during the study of this research work has been very extraordinary. In order to open up a forum for acknowledging human beings, it will be very partial and dissatisfying if our DG/CEO, mentor and my academic brain box Professor Okechukwu Ukwuoma is not mentioned first. Sir, your words of advice, mentoring, endurance and patience are incomparable. You left no stone unturned to make sure the research is policy based. Our colleagues and staff of National Centre for Technology Management (NACETEM), we thank you for your perseverance during this study.


function logi_growth ()

%computes and plot the logistic growth of a population


%number of days for the study, for 20years

K =100;

% K is the carrying capacity of the pen


%growth rate that is 3/100

%initialize the arrays



% recurrence

for n = 1:N

P(n) = K/(19*(1 + exp(-r*n)));




xlabel('time [s]');


Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.


[1] De-Lange, C.F.M., Marty, B.J., Birkett, S., Morel, P. and Szkotnicki, B. (2001) Application of Pig Growth Models in Commercial Pork Production. The Canadian Veterinary Journal, 81, 1-8.
[2] Dourmad, J., Pomar, C. and Massé, D. (2003) Mathematical Modelling of Manure Production by Pig Farms. Effect of Feeding and Housing Conditions.
[3] Ehigiamusoe, U.K. (2012) A Comparative Analysis of Agricultural Performance between the Military and Civilian Regimes in Nigeria. International Journal of Humanities and Social Science Invention, 1, 13-23. http://ijhssi.org/papers/v1(1)/Version-1/C111323.pdf
[4] Agbugba, I.K. and Binaebi, E. (2018) A Comparative Study of the Agriculture Sector Contribution to the Economic Growth of Nigeria and Malaysia.
[5] Wellock, I.J., Emmans, G.C. and Kyriazakis, I. (2004) Describing and Predicting Potential Growth in the Pig. Animal Science, 78, 379-388.
[6] Castellano, K.E. (2013) A Practitioner’s Guide to Growth Models.
[7] Mendez, V., Assaf, M., Campos, D. and Horsthemke, W. (2015) Stochastic Dynamics and Logistic Population Growth. Physical Review E, 91, Article ID: 062133.
[8] Joyce, D. (2013) The Logistic Population Model Math 121 Calculus II.
[9] Dietze, K. (2011) Pigs for Prosperity. http://www.fao.org/3/i2471e/i2471e00.pdf
[10] Murdoch, W.W. (1994) Population Regulation in Theory and Practice. Ecology, 75, 271-287.

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.