Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Reading op.2 files in Matlab works, but I got new troubles

Status
Not open for further replies.

caryman2801

New member
Mar 12, 2010
4
0
0
ES
Hi everyone,

I finally wrote a matlab code to read [M] and [K] matrix and it works pretty well. However, I don't know what (i,j) component represent in terms of ID node...

Could anyone give me any clue?? I heard FEM codes reorder d.o.f in order to get band sparse matrix

Thank you in advance.
 
Replies continue below

Recommended for you

a) fairly impenetrable question.

b) yes indeed. The wavefront size is optimised in most FEA codes. This is done by examining the connectivity of each node, and is essentially the number of elements or nodes (I can't remember which) that are unsolved at each step. A google search on FEA wavefront reduction has many hits. My first real job was to write a wavefront counter and optimiser.



Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376
 
I have it on some good advice (ex-MSC coder) that the dof manipulation is done in the solver, e.g. FRDD1 (or whatever it is called). The wavefront solving is internal, so the input to the solver is not already optimised.

What goes in is in order and so too what comes out. BUT this is not necessarily true of all versions. I can say, n2005r3 MSC this seems to be true.

BUT my advisor still admits it is best to be sure. So here's a smarter way to approach you problem.

STEP 0 - check to see if your output is in order. My guess is, yes. i.e. row 1 = u1 etc. make a simple example and compare them.

ELSE

1) define a USET (eg 'U1') with the dofs you want in your K-matrix

2) write an alter to grab the K-matrix as it goes into the solver

3) UPARTN (dmap function) the matrix using the USET; this will partition it for you

4) either punch it in DMIG or OUTPUT2 or 4 binary and read in in matlab.

*If maybe you aren't sure what I'm talking about... this could be a tricky solution. Start with SOL103 and search in the f04 for when Nastran executes the READ function. They called it read just to confuse everyone.

On the UPARTN use the 'G' size to 'U1' size, the second matches with the name of the USET.

put in your deck
diag,8,14,15,56
follow the control sequence and locate the matrices you need. Get them at the very last point you can. The 56 should throw up where the EQUIVX is used to show you where the matrices are being equivilenced to a standard output name - which is a helpful pointer to where the solver is.

PS: I have done this, stripped the matrices, partitioned the dofs and it works fine.

Hope this helps. If not, perhaps I can help a bit more.

Regs,

S.
 
Thanks for the answers!
I really need to analyse it. I'm sure I will probably need to post again once I've work on it.

Thank you very much again.
 
You don't have to worry about resequencing if you are working with a modern input file. There were SEQGP entries used decades ago that caused resequencing, but if you find any of these in an input file someone give you throw them away. They just make for trouble now. The only automatic resequencing at the node level now occurs for part Superelements. If you aren't using them you don't have to consider possible resequencing.

The problem with correlating node DOF ids with matrix row IDs is that the latter is a closed set, while the node ids are an open set. For example, the first ten rows of the KGG matrix would have the indices 1,2,3....10, while the corresponding node ids could be (100,1),(100,2),(100,3). .
(100,6),(110,1),. . (110,4). This is for a model where the first node id is 100 and the node id's grow by factor of 10. If you are working with matrices that may have rows and columns removed with SPCs each node could have less than six DOF.

The first question to ask is what will you do with the nodeid-ci pairs in Matlab? If it is just to label output it might be easier to bring it back to NASTRAN, which has lots of tools like MATGPR to solve this labeling problem for you. If you are willing to do some work, there are tables named SIL and EQEXIN that correlate the internal sequence and the external sequence used for (nodeid-cid) pairs. They aren't documented very well in the DMAP Programmers Manual, but you may be able to decode them if you table print them in NASTRAN. If you bring these tables to Matlab you could make a paired list of internal and external sequence numbers for your use in Matlab.
 
Ok, I neither work with old inputs nor Superelements, so I deduce from your post that I should forget about resequencing...

What I intend to do is to build a Space-State model of the structure, in order to implement an optimal control. For that reason I need to know the correlation (Node Id DOF) - (Row).

I'll work with the tools proposed (MATGPR,EQEXIN...)

Thanks for the answers!
 
I'm going to some NASTRAN terminology here. If you don't know the definition of some of these terms start asking questions. I don't know what tools Matlab has for converting mass and stiffness matrices to state space form, so I'll do it all in NASTRAN. You can decide if it is easier to do some of the matrix merging in Matlab.

If you use the conventional definition of the state space equation,

xdot = A*x,

this equation can be related to the quadratic equation used in NASTRAN

M*udotdot + B*udot + K*u = P

Pre-multiplying by the inverse of M and discarding P,

Udotdot = -Bbar*udot - Kbar*u

By defining
u udot
x = [ ] , xdot = [ ]
udot udotdot

Then
0 I
xdot = [ ]*x, where [A] is made up as shown here.
-Kbar -Bbar
[The email program reformats my cut-and-paste and moves things out of the brackets. Use your imagination to put them back in. I'll try to make this an attachment too, in the hopes that it is not re-formatted. Looks like I'll have to learn how to upload here.]

For this method to work M must be invertible. This is usually accomplished by putting in ASETi entries in a manner so the mass-less DOFs such as rotations go to the o-set.

The *bar matrices can be computed with the SOLVE module,

M*Kbar=K, M*Bbar=B, where the bar quantities are the output matrices. They can be merged into A, along with the identity matrix I.

In order to find out the row number in internal sequence that corresponds to the external sequence numbers of the form (node-id, c-id) you can use param, usetprt, 2 a table will be printed out that correlates these two sequences. The first half of the x vector contains displacements, and the second half contains velocities. The table above applies to both halves. You won't need to take the external sequence to Matlab.

Thuse




 
Status
Not open for further replies.
Back
Top