예제 #1
0
        for ($x = $i1; $x <= $i2; $x++) {
            for ($y = $i1; $y <= $i2; $y++) {
                $K[$x][$y] += $ke[$x - $i1][$y - $i1];
            }
        }
    }
}
echo "\nK = \n\n";
showArray($K, count($K), count($K[0]));
echo "\nF = \n\n";
showArray($F, count($F));
$xv = array(0, $ndof - 2);
//xv=[1 ndof-1];
$K = removeRow($K, $xv);
//K(xv,:)=[];
$K = removeCol($K, $xv);
//K(:,xv)=[];
$F = removeRow($F, $xv);
//F(xv)=[];% apply the homogeneous GBCs
echo "\nF 2 = \n\n";
showArray($F, count($F));
$w0 = LUPsolve($K, $F);
//w0=K\F; % nodal displacements
$w1 = array_fill(0, $ndof, 0);
//w1=zeros(ndof,1);
$xv1 = array_fill(0, $ndof, 0);
//xv1=[1:ndof];
for ($i = 0; $i < $ndof; $i++) {
    $xv1[$i] = $i;
}
$xv1 = removeRow($xv1, $xv);
예제 #2
0
파일: tune.php 프로젝트: bjurban/Autotune
function removeCol($currCol, &$array)
{
    //replaces the current col with the next col until all cols are moved (recursive)
    if ($currCol == count($array) - 1) {
        //delete if last col
        $array[$currCol] = null;
    } else {
        $nextCol = $currCol + 1;
        $array[$currCol] = $array[$nextCol];
        removeCol($nextCol, $array);
    }
}