private double[] GetVirtualVectorB_FromVirtualForceFy(JSNode node) { var result = new double[NumberOfEquations]; result[node.EquationNo_Fy] = -1; result[EquationNo_GlobalFy] = -1; result[EquationNo_GlobalM] = -node.Position.X * 1; return(result); }
/// <summary> /// /// </summary> /// <param name="node"></param> /// <param name="virtualVectorB"></param> /// <param name="LoverAE">L/AE. A vector with a value for every bar.</param> /// <returns></returns> private double CalculateDeflection(JSNode node, double[] virtualVectorB, double[] LoverAE) { var virtualX = SolveXForGivenB(virtualVectorB); var realX = X_Array; double workDone = 0; for (int i = 0; i < LoverAE.Length; i++) { workDone += virtualX[i] * realX[i] * LoverAE[i]; } //deflection = workDone / virtual load (1) return(workDone); }
public Dictionary <string, double> GetNodeDeflection(js.JSNode node) { if (model.Nodes.Contains(node)) { return new Dictionary <string, double>() { { "dx", node.Deflection.X }, { "dy", node.Deflection.Y } } } ; return(new Dictionary <string, double>() { { "dx", double.NaN }, { "dy", double.NaN } }); }
public Dictionary <string, double> GetNodeReaction(js.JSNode node) { if (model.Nodes.Contains(node)) { return new Dictionary <string, double>() { { "Fx", node.ReactionResult.X }, { "Fy", node.ReactionResult.Y } } } ; return(new Dictionary <string, double>() { { "Fx", double.NaN }, { "Fy", double.NaN } }); }
private void FindOrCreateNodeForVertex(JSVertex vertex, HashSet <JSNode> nodesSet) { var pos = vertex.Position; foreach (var node in nodesSet) { if (PointsAreClose(node.Position, pos)) { vertex.Node = node; node.Vertices.Add(vertex); return; } } var newNode = new JSNode(vertex.Position); newNode.Vertices.Add(vertex); nodesSet.Add(newNode); return; }
private void AddNodeYEquilibrium(JSNode node, int equationRowNo) { if (equationRowNo != node.EquationNo_Fy) { throw new Exception("Check why these numbers are not equal!!"); } foreach (var vert in node.Vertices) { var otherNode = vert.GetOtherVertex().Node; var bar = vert.Bar; var constant = (otherNode.Position.Y - node.Position.Y) / bar.Length; AddToMatrixA(equationRowNo, bar.Number, constant); } if (node.YRestrained) { AddToMatrixA(equationRowNo, node.VariableNumber_Ry, 1); } AddToVectorB(equationRowNo, -node.AppliedForces.Y); }
public static JSPointLoad PointLoad(double Fx, double Fy, js.JSNode node) => new JSPointLoad(new Vector2d(Fx, Fy), node);
/// <summary> /// Create a bar between a node and a point positions (unconnected to nodes). /// The unconnected vertex position will be connected to a node when this bar is added to a JointAnalysis model. /// </summary> public static js.JSBar ByStartPtEndNode(Vector2d startPoint, js.JSNode endNode) => new js.JSBar(startPoint, endNode);
/// <summary> /// Create a bar between a node and a point positions (unconnected to nodes). /// The unconnected vertex position will be connected to a node when this bar is added to a JointAnalysis model. /// </summary> public static js.JSBar ByStartNodeEndPt(js.JSNode startNode, Vector2d endPoint) => new js.JSBar(startNode, endPoint);
/// <summary> /// Create a bar between 2 nodes. /// </summary> public static js.JSBar ByStartNodeEndNode(js.JSNode startNode, js.JSNode endNode) => new js.JSBar(startNode, endNode);
public JSNode(JSNode jSNode) { Position = jSNode.Position; XRestrained = jSNode.XRestrained; YRestrained = jSNode.YRestrained; }