Created
June 30, 2014 09:41
-
-
Save plumbum/5ecf099e8ab7987b6cd7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$resistor = array( | |
1.0, | |
1.1, | |
1.2, | |
1.3, | |
1.5, | |
1.6, | |
1.8, | |
2.0, | |
2.2, | |
2.4, | |
2.7, | |
3.0, | |
3.3, | |
3.6, | |
3.9, | |
4.3, | |
4.7, | |
5.1, | |
5.6, | |
6.2, | |
6.8, | |
7.5, | |
8.2, | |
9.1, | |
); | |
function Vovp($r1, $r2) { | |
$Vfb = 1.235; | |
return (($r1+$r2)/$r2)*$Vfb; | |
} | |
foreach($resistor as $r2) { | |
foreach($resistor as $r1) { | |
$v = Vovp($r1, $r2); | |
if(round($v) == 5) { | |
echo "Vovp=$v; R1=".($r1).", R2=$r2\r\n"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment