Contact:
sales@biotechnologyforums.com to feature here

• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
PERL Program - BINC 2015 question
#1
Question :
i) An autocatalytic reaction is described by the expression
x/P = [exp(at) -1]/ [1 + b exp(at)], with a= ( A +P)k and b = P/A.
Write a program in C or JAVA or Perl or PYTHON to calculate x/P for three values of t (t =1,2 and 3)
using a & b as given in the input file autocat.dat.
Report if the saturation is reached by printing a string, “The saturation is reached. The values
are” and then print the value of ( x/P, a, b and t) for the saturation point.
Otherwise, print the message “ The Saturation is not reached” . All your output, including
these messages is to be saved in a file called autocat.out.

Solution :

#!/usr/bin/perl -w
# BINC 2015 sample question paper 3 solution
use strict;
my (\$line,@arraya,@arrayb,\$xp,\$t,\$j);
my \$i=0;
open (FILE, "autocat.dat.txt") or
die "Cannot open file \n\n" ;

while (\$line = <FILE>)
{
if (\$line =~ /^a/ )
{ next; }
else

\$arraya[\$i] = (split (/\s+/, \$line));
\$arrayb[\$i] = (split (/\s+/, \$line));
\$i++;
}
}
close FILE;

\$j=\$i;
print "The value of J=\$j \n";
open (OUTPUT, ">autocat.out");
for (\$t=1;\$t<4;\$t++)
{
for(\$i=0;\$i<\$j;\$i++)
{
\$xp = (exp(\$arraya[\$i]*\$t) -1) / (1 + (\$arrayb[\$i]*exp(\$arraya[\$i]*\$t)));
print "When T=\$t the value of XP=\$xp \n";
if (\$xp==100)

print "The saturation is reached. The values are : \nXP=\$xp \na=\$arraya[\$i] \nb=\$arrayb[\$i] \nt=\$t\n\n";
print OUTPUT "The saturation is reached. The values are : \nXP=\$xp \na=\$arraya[\$i] \nb=\$arrayb[\$i] \nt=\$t\n\n";
}
else

print "The Saturation is not reached \n\n";
print OUTPUT "The Saturation is not reached \n\n";
}

}
close OUTPUT;

Author
/
Last Post
Replies: 0
Views: 3,792
10-24-2018, 04:30 AM
Last Postsj26
Replies: 0
Views: 3,277
07-01-2018, 05:08 PM
Last Postbinu
Replies: 2
Views: 7,626
06-19-2018, 06:21 PM
Last Postrakeshojha
Replies: 0
Views: 4,087
04-25-2017, 03:18 PM
Last Postbinu
Replies: 0
Views: 4,421
04-25-2017, 03:05 PM
Last Postbinu

 Users browsing this thread: 1 Guest(s) 