Error in analysis of beam

Apr 19, 2015 at 4:39 PM
Edited Apr 19, 2015 at 4:41 PM
Hi Ehsan,
why this error and how to fix ?

Image
private static void beam()
        {
            Model model = new Model();
            Node node1 = new Node(0, 0, 0) { Label = "node1" };
            Node node2 = new Node(0, 30, 0) { Label = "node2" };
            Node node3 = new Node(0, 36, 0) { Label = "node3" };
            Node node4 = new Node(0, 60, 0) { Label = "node4" };

            FrameElement2Node beam1 = new FrameElement2Node(node1, node2)
            {
                Label = "beam1",
                A = 0.145,
                E = 1.7e6,
                G = 68e4,
                J = 0.00174,
                Iz = 0.00174,
                Iy = 0.00174
            };
            FrameElement2Node beam2 = new FrameElement2Node(node2, node3)
            {
                Label = "beam2",
                A = 0.145,
                E = 1.7e6,
                G = 68e4,
                J = 0.00174,
                Iz = 0.00174,
                Iy = 0.00174
            };

            FrameElement2Node beam3 = new FrameElement2Node(node3, node4)
            {
                Label = "beam3",
                A = 0.145,
                E = 1.7e6,
                G = 68e4,
                J = 0.00174,
                Iz = 0.00174,
                Iy = 0.00174
            };

            model.Nodes.Add(node1, node2, node3, node4);
            model.Elements.Add(beam1, beam2, beam3);

            node1.Constraints = BriefFiniteElementNet.Constraint.FixedRX &
                                BriefFiniteElementNet.Constraint.FixedRY;
            node2.Constraints = node4.Constraints = BriefFiniteElementNet.Constraint.FixedRY;
            node3.Constraints = BriefFiniteElementNet.Constraint.Released;

            UniformLoad1D load = new UniformLoad1D(2,
                                               LoadDirection.Y,
                                               CoordinationSystem.Global,
                                               new LoadCase("Case1",
                                                   LoadType.Dead));
            beam1.Loads.Add(load);
            beam2.Loads.Add(load);
            beam3.Loads.Add(load);

            model.Solve();

            var r1 = node1.GetSupportReaction();
            var r2 = node2.GetSupportReaction();
            var r3 = node3.GetSupportReaction();
            var r4 = node4.GetSupportReaction();

            using (System.IO.StreamWriter writer = new System.IO.StreamWriter("txt.txt"))
            {
                writer.WriteLine(r1.Fx);
                writer.WriteLine(r1.Fy);
                writer.WriteLine(r1.Fz);
                writer.WriteLine(r2.Fx);
                writer.WriteLine(r2.Fy);
                writer.WriteLine(r2.Fz);
                writer.WriteLine(r3.Fx);
                writer.WriteLine(r3.Fy);
                writer.WriteLine(r3.Fz);
                writer.WriteLine(r4.Fx);
                writer.WriteLine(r4.Fy);
                writer.WriteLine(r4.Fz);
            }
        }
Coordinator
Apr 21, 2015 at 9:47 AM
Hi,
When you get exception with 'not pos def' message, the reason is that the free stiffness matrix is not positive definite. Invalid boundary conditions will result in such a situation. in your code boundary conditions are invalid. this is valid code:
var node1 = new Node(0, 0, 0) { Label = "node1" };
var node2 = new Node(1, 0, 0) { Label = "node2" };
var node3 = new Node(2, 0, 0) { Label = "node3" };
var node4 = new Node(3, 0, 0) { Label = "node4" };

node1.Constraints = Constraint.MovementFixed & Constraint.FixedRX;//Constraint.FixedRX to make model stable.
node2.Constraints = node4.Constraints = Constraint.FixedDY;
node3.Constraints = Constraint.Released;//hovewer Constraint.Released is setted by deafult
Also please note that you should fix a rotation about X axis fixed on any node to make model statically stable.
Apr 21, 2015 at 6:02 PM
why to fix rotation in x direction, supports at node1,node2 and node3 are supposed to have rotation angle,
and if I fix rotation the message is solved, but GetSupportReaction method return Zeros, Can you investigate that.

full code attached.
            try
            {
                Model model = new Model();

                Node n1 = new Node(0, 0, 0) { Label = "node1" };
                Node n2 = new Node(30, 0, 0) { Label = "node2" };
                Node n3 = new Node(36, 0, 0) { Label = "node3" };
                Node n4 = new Node(60, 0, 0) { Label = "node4" };

                FrameElement2Node e1 = new FrameElement2Node(n1, n2) { Label = "beam1" };
                FrameElement2Node e2 = new FrameElement2Node(n2, n3) { Label = "beam2" };
                FrameElement2Node e3 = new FrameElement2Node(n3, n4) { Label = "beam3" };

                var secAA = SectionGenerator.GetISetion(0.24, 0.67, 0.01, 0.006);
                var secBB = SectionGenerator.GetISetion(0.24, 0.52, 0.01, 0.006);
                e1.Geometry = e2.Geometry = e3.Geometry = secAA;

                e1.E = e2.E = e3.E = 210e9;
                e1.G = e2.G = e3.G = 210e9 / (2 * (1.3));

                e1.UseOverridedProperties =
                    e2.UseOverridedProperties = e3.UseOverridedProperties = false;


                model.Nodes.Add(n1, n2, n3, n4);
                model.Elements.Add(e1, e2, e3);

                n1.Constraints = Constraint.MovementFixed & Constraint.FixedRX;
                n2.Constraints = n4.Constraints = Constraint.FixedDY;
                n3.Constraints = Constraint.Released;

                UniformLoad1D load = new UniformLoad1D(2,
                                                   LoadDirection.Y,
                                                   CoordinationSystem.Global,
                                                   new LoadCase("Case1",
                                                       LoadType.Dead));
                e1.Loads.Add(load);
                e2.Loads.Add(load);
                e3.Loads.Add(load);

                model.Solve();

                var r1 = n1.GetSupportReaction();
                var r2 = n2.GetSupportReaction();
                var r3 = n3.GetSupportReaction();
                var r4 = n4.GetSupportReaction();
                var load1 = e1.GetInternalForceAt(3);
                model.Show();
                model.ShowInternalForce();
            }
            catch (Exception exp)
            {
                System.Windows.MessageBox.Show(exp.Message);
            }
Coordinator
Apr 22, 2015 at 4:25 AM
Hi,
You should fix rotation to make model statically stable.
About reactions, when you call Node.GetSupportReaction() you should pass a LoadCombination into it, if you don't it will return support reactions only for a LoadCase.DeaulfLoadCase which is not what you need. Here is the modified code:
var cse = new LoadCase("Case1", LoadType.Dead);
var cmb = new LoadCombination();
cmb[cse] = 1.0;// our load combination is 1.0 X Case1
//cmb[new LoadCase("Case2", LoadType.Dead)] = 1.0;//uncomment this line if for example want to set the load combination into "1.0 X Case1 + 1.0 X Case2"

var r1 = node1.GetSupportReaction(cmb);
var r2 = node2.GetSupportReaction(cmb);
var r3 = node3.GetSupportReaction(cmb);
var r4 = node4.GetSupportReaction(cmb);