## Population biology models

Ask questions about projects relating to: computer science or pure mathematics (such as probability, statistics, geometry, etc...).

Moderators: MelissaB, kgudger, Ray Trent, Moderators

### Population biology models

Hey guys!
I'm having trouble with my population biology module project. The demonstration only shows how to estimate a population using the modules in the program Matlab. I was hoping to program It in C programming language. If someone could just covert the given equation to C program capable that'd be great! Thanks!
puppy1397

Posts: 2
Joined: Mon Apr 21, 2014 6:12 am
Occupation: Student
Project Question: http://www.sciencebuddies.org/science-f ... #procedure

It is only given in two options. Matlab or paper. I was hoping to program it in C. Here is what I got:
Pop1 = startPop + growthRate * (1 - startPop/CarryCap) * startPop
and heres yours:
Population[time+1] = Population[time] + GrowthRate × ( 1 - Population[time]/
CarryingCapacity) × Population[time]
Project Due Date: 5/3
Project Status: I am finished with my experiment and analyzing the data

### Re: Population biology models

http://www.sciencebuddies.org/science-fair-projects/project_ideas/EnvSci_p049.shtml#summary

Is there a reason you want to do it in C and not MATLAB? I'm not familiar with C, but I am familiar with MATLAB. If there are experts knowledgeable in C, we won't write the program for you. We would want you to make an attempt and then ask questions when you are stuck. That's the fun of a science project...to learn something new!

If you are not already familiar with the C programming language, I recommend you stick with MATLAB, so that you have a clear example of the code. If you still want to do it in C, first try to write the program yourself. It looks like all you need to do in the program is define a few variables and write a couple of equations. If you're not familiar enough with either C or MATLAB, the basic help files should steer you in the right direction. Programming is not easy, but I bet you can get there with a little effort. Write back with your code if you are having problems.

Good luck!
Deana
dcnick96
Moderator

Posts: 287
Joined: Wed Jul 25, 2007 7:59 pm

### Re: Population biology models

Actually, I know C very well I messed around for a few more hours and think I figured it out! Here it is:

Pop5 = startPop + growthRate * (5 - startPop/CarryCap) * startPop;
Pop10 = startPop + growthRate * (10 - startPop/CarryCap) * startPop;
Pop15 = startPop + growthRate * (15 - startPop/CarryCap) * startPop;
Pop20 = startPop + growthRate * (20 - startPop/CarryCap) * startPop;
Pop25 = startPop + growthRate * (25 - startPop/CarryCap) * startPop;
just
printf("%d", pop5);
and so on.
Thanks anyways Dcnick96!
puppy1397

Posts: 2
Joined: Mon Apr 21, 2014 6:12 am
Occupation: Student
Project Question: http://www.sciencebuddies.org/science-f ... #procedure

It is only given in two options. Matlab or paper. I was hoping to program it in C. Here is what I got:
Pop1 = startPop + growthRate * (1 - startPop/CarryCap) * startPop
and heres yours:
Population[time+1] = Population[time] + GrowthRate × ( 1 - Population[time]/
CarryingCapacity) × Population[time]
Project Due Date: 5/3
Project Status: I am finished with my experiment and analyzing the data

### Re: Population biology models

Good luck!
Deana
dcnick96
Moderator

Posts: 287
Joined: Wed Jul 25, 2007 7:59 pm

### Re: Population biology models

C has absolutely no numerical processing library and I would never suggest that you use it. You will be better off using mathematica (trial/purchase). If you want a cost-free option you should look into octave and sage.
seijimax

Posts: 1
Joined: Fri Jul 18, 2014 2:56 am
Occupation: Programming/Statistics
Project Question: Discuss about scientific ideas
Project Due Date: 10/8/2014
Project Status: I am conducting my research