1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
| // peak1
$u_peak_time1 = array();
$peak_time1 = array();
$peak_time2 = array();
$peak_time3 = array();
$peak_time4 = array();
$peak_time5 = array();
$peak_time6 = array();
$peak_time7 = array();
$peak_time8 = array();
$peak_time9 = array();
$peak_time10 = array();
$peak_time11= array();
$peak_time12= array();
$peak_time13= array();
$peak_time14= array();
$peak_time15= array();
$peak_time16= array();
$peak_time17= array();
$peak_time18= array();
$peak_time19= array();
$total= array();
$j_peak_time1=-1;
$i_peak_time1;
for ($i_peak_time1=0; $i_peak_time1<=26; $i_peak_time1+=1/($frequence*60))
//958 enregistrements
{ $j_peak_time1++;
$u_peak_time1[$j_peak_time1]= array();
$u_peak_time1[$j_peak_time1][0]=$i_peak_time1;
$peak_time1[] = round($u_peak_time1[$j_peak_time1][0],4);
$u_peak_time1[$j_peak_time1][1]=$peak_area[0]/$st_reel[0]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[0]),2)/2/pow($st_reel[0],2));
$peak_time2[] = round($u_peak_time1[$j_peak_time1][1],4);
$u_peak_time1[$j_peak_time1][2]=$peak_area[1]/$st_reel[1]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[1]),2)/2/pow($st_reel[1],2));
$peak_time3[] = round($u_peak_time1[$j_peak_time1][2],4);
$u_peak_time1[$j_peak_time1][3]=$peak_area[2]/$st_reel[2]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[2]),2)/2/pow($st_reel[2],2));
$peak_time4[] = round($u_peak_time1[$j_peak_time1][3],4);
$u_peak_time1[$j_peak_time1][4]=$peak_area[3]/$st_reel[3]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[3]),2)/2/pow($st_reel[3],2));
$peak_time5[] = round($u_peak_time1[$j_peak_time1][4],4);
$u_peak_time1[$j_peak_time1][5]=$peak_area[4]/$st_reel[4]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[4]),2)/2/pow($st_reel[4],2));
$peak_time6[] = round($u_peak_time1[$j_peak_time1][5],4);
$u_peak_time1[$j_peak_time1][6]=$peak_area[5]/$st_reel[5]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[5]),2)/2/pow($st_reel[5],2));
$peak_time7[] = round($u_peak_time1[$j_peak_time1][6],4);
$u_peak_time1[$j_peak_time1][7]=$peak_area[6]/$st_reel[6]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[6]),2)/2/pow($st_reel[6],2));
$peak_time8[] = round($u_peak_time1[$j_peak_time1][7],4);
$u_peak_time1[$j_peak_time1][8]=$peak_area[7]/$st_reel[7]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[7]),2)/2/pow($st_reel[7],2));
$peak_time9[] = round($u_peak_time1[$j_peak_time1][8],4);
$u_peak_time1[$j_peak_time1][9]=$peak_area[8]/$st_reel[8]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[8]),2)/2/pow($st_reel[8],2));
$peak_time10[] = round($u_peak_time1[$j_peak_time1][9],4);
$u_peak_time1[$j_peak_time1][10]=$peak_area[9]/$st_reel[9]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[9]),2)/2/pow($st_reel[9],2));
$peak_time11[] = round($u_peak_time1[$j_peak_time1][10],4);
$u_peak_time1[$j_peak_time1][11]=$peak_area[10]/$st_reel[10]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[10]),2)/2/pow($st_reel[10],2));
$peak_time12[] = round($u_peak_time1[$j_peak_time1][11],4);
$u_peak_time1[$j_peak_time1][12]=$peak_area[11]/$st_reel[11]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[11]),2)/2/pow($st_reel[11],2));
$peak_time13[] =round($u_peak_time1[$j_peak_time1][12],4);
$u_peak_time1[$j_peak_time1][13]=$peak_area[12]/$st_reel[12]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[12]),2)/2/pow($st_reel[12],2));
$peak_time14[] =round($u_peak_time1[$j_peak_time1][13],4);
$u_peak_time1[$j_peak_time1][14]=$peak_area[13]/$st_reel[13]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[13]),2)/2/pow($st_reel[13],2));
$peak_time15[] =round($u_peak_time1[$j_peak_time1][14],4);
$u_peak_time1[$j_peak_time1][15]=$peak_area[14]/$st_reel[14]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[14]),2)/2/pow($st_reel[14],2));
$peak_time16[] =round($u_peak_time1[$j_peak_time1][15],4);
$u_peak_time1[$j_peak_time1][16]=$peak_area[15]/$st_reel[15]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[15]),2)/2/pow($st_reel[15],2));
$peak_time17[] =round($u_peak_time1[$j_peak_time1][16],4);
$u_peak_time1[$j_peak_time1][17]=$peak_area[16]/$st_reel[16]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[16]),2)/2/pow($st_reel[16],2));
$peak_time18[] =round($u_peak_time1[$j_peak_time1][17],4);
$u_peak_time1[$j_peak_time1][18]=$peak_area[17]/$st_reel[17]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[17]),2)/2/pow($st_reel[17],2));
$peak_time19[] =round($u_peak_time1[$j_peak_time1][18],4);
$u_peak_time1[$j_peak_time1][19]=$peak_area[18]/$st_reel[18]/sqrt(6.28)*exp(-pow(($u_peak_time1[$j_peak_time1][0]-$tg_min[18]),2)/2/pow($st_reel[18],2));
$peak_time20[] =round($u_peak_time1[$j_peak_time1][19],4);
$peak_time21[] = mt_rand(0 * pow(10, 7), 1 * pow(10, 7)) / pow(10, 7)*$noise;
$total[]=round($u_peak_time1[$j_peak_time1][19]+$u_peak_time1[$j_peak_time1][18]+$u_peak_time1[$j_peak_time1][17]+$u_peak_time1[$j_peak_time1][16]+$u_peak_time1[$j_peak_time1][15]+$u_peak_time1[$j_peak_time1][14]+$u_peak_time1[$j_peak_time1][13]+$u_peak_time1[$j_peak_time1][12]+$u_peak_time1[$j_peak_time1][11]+$u_peak_time1[$j_peak_time1][10]+$u_peak_time1[$j_peak_time1][9]+$u_peak_time1[$j_peak_time1][8]+$u_peak_time1[$j_peak_time1][7]+$u_peak_time1[$j_peak_time1][6]+$u_peak_time1[$j_peak_time1][5]+$u_peak_time1[$j_peak_time1][4]+$u_peak_time1[$j_peak_time1][3]+$u_peak_time1[$j_peak_time1][2]+$u_peak_time1[$j_peak_time1][1],3);
}
?>
<script language="Javascript">
var tab_point_java = new Array;
var tab_temp_java = new Array;
<?php
$tab_point_php= array();
$temp_php= array();
$tab_point_php=$total;
$temp_php=$peak_time1;
$a=0;
$b=0;
foreach($temp_php as $var_temp){
echo "tab_temp_java[$a] = '$var_temp';";
$a++;
}
foreach($tab_point_php as $var_point){
echo "tab_point_java[$b] = '$var_point';";
$b++;
}
?>
</script>
<?php
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
.................................................................
<div id="monGraphique" style="width:600px;height:300px;"></div>
<script language="javascript" type="text/javascript">
$( function ()
{
<?php
$js[] = "var points = [];";
$n = count($tab_temp_java);
for($i=0;$i<$n;$i++) {
$abs = $tab_temp_java[$i];
$ord = $tab_point_java[$i];
$js[] = "points.push([ $abs, $ord ]);";
}
echo implode("\n", $js);
?>
var data = [
{
label: "Ma Fonction",
data: points
}
];
var options = {
legend: {
show: true,
margin: 10,
backgroundOpacity: 0.5
}
};
var plotarea = $("#monGraphique");
$.plot( plotarea , data, options );
}
);
</script>
<a href="#" onClick="javascript: alert(tab_temp_java[144]),alert(tab_point_java[144]);">test</a>
</body>
</html> |
Partager