本文整理汇总了C#中MathNet.Numerics.LinearAlgebra.Double.DenseVector.Norm方法的典型用法代码示例。如果您正苦于以下问题:C# DenseVector.Norm方法的具体用法?C# DenseVector.Norm怎么用?C# DenseVector.Norm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MathNet.Numerics.LinearAlgebra.Double.DenseVector
的用法示例。
在下文中一共展示了DenseVector.Norm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: bar3gfBarnes
public static double[] bar3gfBarnes(double[][] ec,double[] ep, double[] ed, double ten)
{
// Compute the internal force vector for a cable element according to:
// FORM-FINDING AND ANALYSIS OF PRESTRESSED NETS AND MEMBRANES
// by M. R. BARNES (1988)
//ed = [a_1 a_2 ... a_6]; Element nodal displacements
//ep = [E A]; element properties
//ten = [ten]; Specified initial element tension
//OUTPUT:
//ef = F_int = [f_1 f_2 ... f_6]';
//ec format: [x,y,z][node1,node2...]
//ed format: [node1x, node1y, node1z, node2x...]
double l0 = getElementLength(ec);
double[][] ecUpdated = updateEcWithDisp(ec, ed);
double l = getElementLength(ecUpdated); //Current length
//Current element force
double tm = ten + (ep[0] * ep[1] / l0) * (l - l0);
//Direction vector
Vector v = new DenseVector(3);
for (int i = 0; i < 3; i++)
{
v[i] = ecUpdated[i][0] - ecUpdated[i][1];
}
double vl = v.Norm(2);
Vector x = new DenseVector(6);
for (int i = 0; i < 3; i++)
{
x[i] = v[i] / vl;
}
//Reverse direction vector
for (int i = 0; i < 3; i++)
{
x[i+3] = -v[i] / vl;
}
return x.Multiply(tm).ToArray();
}