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!
Population biology models
Moderators: kgudger, bfinio, Moderators
-
- 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
Hello. I assume you are talking about this project:
https://www.sciencebuddies.org/science- ... ml#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!
https://www.sciencebuddies.org/science- ... ml#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
-
- 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
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!
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!
-
- 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
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.