# data[].attributes.body
I've tried doing a few of the non linear programs, with both my own code and the code given in the notebook but I keep getting this error. The above is from the code given in OneNote.

# data[].attributes.body
is here
If you want Link for bookmarking
https://cf-my.sharepoint.com/:o:/g/personal/kwan_cardiff_ac_uk/EiFHbYsWSA9Cvi774FKndOkBeSs_DwdTG-xFAPBOzsyuvA

Online Matlab

# data[].attributes.body
double click on a space for a new post-it note to pop up
& click on a picture to see it better

# data[].attributes.body
I am a bit stuck at the part where we need to add the numbers to the joints and bars on the graph. Could you please give a hint on how to proceed?
It is really not necessarily for the exam!  But it is
text(coor(i,1),coor(i,2),coor(i,3), num2str(j1))

# data[].attributes.body
This is only for adding joint numbers to the plot of the structure, useful, but not essential. Even plotting is not essential to get answers.  But, it is like this.
"text (x,y,A)" where x and y are the coordinates and A is the string to show up on the plot.  Try
text(2,4,'test')
But you want to plot the joint numbers, and numbers are not strings, so you need to convert the number to a string.
Try
text(2,4,num2str(1234))

# data[].attributes.body
When calculating S and M, in order to make the result easier to read, I have divided it by one of the values of each matrix. However, sign seems to be an issue, I have to divide M by a negative value in order to change the sign cconvention in the matrix and get an answer that actually makes sense. How would we know when to change to positive or negative?

# data[].attributes.body
The sign is NOT an issue in S & M.  ie (1 -1 2 -2) is the same S or M as (-1 1 -2 2) since the former is simply -1 times the latter.  An S or M, multiplied by a scalar (eg -1) is still the same S or M.  Does this answer your Q?

# data[].attributes.body
I understand, I guess it was difficult for me to visualize a mechanism if the signs are the other way around.
In the example below, the Mech is a vertical "flutter" of the middle joint, ie the y-disp going up (+ve 1) and down (-ve 1)
Amazing, thank you.

# data[].attributes.body
From the 2DNL to 3DNL video, I copied the 2DNL program to matlab and used the fsolve function on the program but I got a message saying there is an error with the code. The code I used was copied directly from one note so I am not sure what the problem is.
nD=4, nB=5, so you need to feed in 4+5=9 numbers in your starting value for X in fsolve.  You have given a vector of only 8 numbers (three 0's and five 100's).  Try four 0's and five 1000's

# data[].attributes.body
How are the marks allocated for the correct answer and the 'comment on...'? And would it be possible to get some example answers for the points we need to consider when answering the 'comment on...' part of a question?
Roughly speaking, correct numerical answers carry 55-60% of the marks.  The non-numerical part comes pretty much from the lectures.  In the past, people (usually in groups) have worked together on a past paper and then come to see me, to cross-check with me what they would say on the non-numerical part.

# data[].attributes.body
I keep gettin the same error for this structure.
OK, I need to see the code, pref email (or post here) it to me in text form.  But, this in the nonlinear Q, so I would guess the issue, have you got P as a (2nJ, nB) matrix, rather than a vector?

# data[].attributes.body
i am getting the right values for the state of self stress but not the mechanisms and i cannot see why
There is only 1 S and 3 M - so when you say you cannot get the M to match my values, do you have only zeros in rows 1, 2, 3, 6, 8 etc like in mine?  If so, then you have the same M, despite numbers looking different.

If M=[m1 m2] then A*m1+B*m2 (where A and B are two constants) is still the same mech.  That’s why looking at rows of zeroes can show whether your mech are the same as mine or not.

# data[].attributes.body
In Exam Paper 10-11, question 1k asks to compare the behaviour of the 2D structure with and without prestress. The prestress it gives puts tension in the structure but then the tension in the bars is reduced under loading. It is predominantly a reduction of displacement that is the effect sought by introducing prestress.  I thought you put compression in to reduce the tension and vice versa? is Am I interpreting this correctly? I think what you are thinking of, is ...
"you apply pretension to a cable (eg give it +60N) so it is carrying a tensile force (+60N) even before any load is applied, so that when it later has to carry a 'compression force' (eg -40N) because of a load having been applied, that 'compression' is then effected by a reduction of the pretension force (ie it goes from +60 -40 to end up at +20), so the cable is still in tension (+20) under load - and we thus avoid cables going slack"
That is true, and but you can't quite see that in 1k or 1h, because no cable segment is actually put into compression under to the load in 1h.
1k was mainly about the reduction in displacement as the nonlinear structure gains stiffness due to prestress (like when I showed the P-delta curves in 2-bar structure, the slope (which is stiffness) in increased with t o.

# data[].attributes.body
When doing calculating the values for P'*M, t and d' I get an answer completely different from the solution. I'm not sure what is wrong with my coding in the program.

# data[].attributes.body
P=zeros(16,1);  % add this to define P overall first

P([4 10 16])=-50;  %Q1d loads

S=null(H); M=null(H');

tH=pinv(H)*P;  %remove that dot

# data[].attributes.body
When coding the 3D non-linear part an error (shown below) comes when I try to fsolve the program:
Index in position 1 exceeds array bounds (must not exceed 3).

Error in exam3DNL78 (line 61)

G(3*(i-1)+1)=G(3*(i-1)+1) - P(i,1);

Error in fsolve (line 242)

fuser = feval(funfcn{3},x,varargin{:});

Caused by:

Failure in initial objective function evaluation. FSOLVE cannot continue.
I also attached my code for the program.
You have
P=[0 0 0;  0 0 0;  0 0 0;  0 0 0;  0 0 0;  0 0 0; 0 0 0; 0 0 0; 0 0 0;]';
remove that dash at the end of P.  The dash turns it into size 3xnJ when it should be nJx3
try that, and see if it resolves the problem

# data[].attributes.body
Hi, Im doing question 1e and the solution contains 10 displacments , but there are only 4 points free to move. Not sure why.
Thanks!
You are right, something is wrong here.  d should have only 8 numbers,  But whatever the numbers should have been, they are of no use - because the load excites the mech and so the d from the linear prog cannot be trusted anyway

# data[].attributes.body
It asked for displacement and bar forces for non-linear equations. However, the default program does not define d and t. What should I do to find out d and t from non linear program
The outpu t from the nonlinear is d and t.  The output comprises nD+nB numbers where the first nD numbers are the d and the next nB numbers are the t.

# data[].attributes.body
There are questions which ask you to use the NL programme to assess a structure which is behaving linearly. Why is it that the results are very slightly different? Is it due to deflection of the members causing non-linearity?

# data[].attributes.body
What is it and why is it used as an answer for displacements in some exercises? Thanks
This is the check for whether the load P is exciting the mechanism(s).  It is not used as "answer for displacements" but used as check to see if the displacements given by the linear analysis can be trusted.  If P'*M gives only zeros (or numbers small enough to be considered zeros, eg 1e-8) then the load is not exciting any mech. If there is any non-zeros from P'*M, then the load does excite mech, and linear analysis cannot be trusted.  So must use the nonlin results.

# data[].attributes.body
An NL prog analysis a linear structure (where load does not excite mech)
can give (slightly) different t and d to those given by the linear program,
mostly because

1) the two programs have different structural eqns
(the NL prog contain higher order terms), and
the calculation techniqus are different
(NL uses a search algorithm, Lin uses matrix algebra).
This can lead to slight numerical differences.

2) BUT, IF the linear structure is very flexible
(imagine a normal statically determinate
truss structure, but bars made of rubber),
then the displacements are big
(compared to the coord of the structure),
and the normal assumption of "small deflection theory"
(which states the analysis can be carried out
with the original undisplaced unloaded geometry, because
the displaced geometry is very very similar to the original geometry)
no longer applies, then even this (supposedly linear) structure
behaves in the nonlinear way,
and the linear prog will give wrong answers.

# data[].attributes.body
I followed the questions and set up the program in the following. However, it said error in
tH=pinv(H)*P; What should I adjust
email me (or attach here) the code in text form, I can't easily decipher it when it is just a picture

# data[].attributes.body
Is it accurate that a small amount of (2) would occur with any bar stiffness, not necessarily just limit to a very flexible bar? Or does a bar with a normal stiffness follow the assumption of small deflection theory?
A VERY small amount of (2) would occur with any stiffness, yes, but very small.  Which is why we almost always just use linear analysis in ordinary situations, because it is very much good enough

# data[].attributes.body
The displacements that I get are approximately 2x the results on the One Note for the Linear part of Question 2e - please could you see if I've done something wrong? Thanks.
There is not a problem. While your d is a bit bigger than mine, both yours and mine are small. Note that the load given is very specific, very precise, to specifically not excite any of the 6 widespread mech. It is actually very difficult to have a load that does not excite any of the mech, so slight variation of the P will bring in some mech. So such small variations between our d is fine - the key is that the two t agree

# data[].attributes.body
In the assessment questions it asks "how many states of self-stress and mechanisms are there" how would you answer this question?
You look to see how many columns there are in S or M, number of columns in S = number of states of selfstress
For the mechanism questions that ask to sketch it out how would we use the answers that we get from matlab to sketch out the structure?
I think you need to go to lecture recording, explained in class, and not easy to explain via padlet.  But example below, the numbers in M relate to displacements in the mech, so you can interpret/visualise how the mech would go and then you can describe it.  (note, M and -M are the same mech)

# data[].attributes.body
I just want to clarify that for self stress it can only be either one column or 0 correct? and for mechanism each row represents a degree of freedom and the number of mechanisms is equal to the number columns?

# data[].attributes.body
There can be any number of states of selfstress and mechanism. Zero, one, or more.  You type S or M in Matlab, and you see how many columns there are in S or M.  The number of columns in S tell you how many states of selfstress there are (which could be 0, 1 or >1), and similarly with M.
Each row in M shows the "displacement" for that mech - see the related post on the right.
In S, each row would show the "tension force" for that state of selfstress.

# data[].attributes.body
Where exactly in the code does fopt=optimset(optimset('fsolve'),'MaxFunEvals',30000,'MaxIter',30000);
go? in the non-linear program? and in the actual code or in the command window before executing fsolve(X)??
In the command window, before you say fsolve,  But you might not actually need to use fopt command.

# data[].attributes.body
My fsolve part is not working, and I don't know why.
I would need  to see your code in text form, plus which Q are you doing

# data[].attributes.body
This keeps showing up. I checked many times of the code. I dont know what does this mean
Without seeing what you are doing, I am have to guess, but I guess ...
... you are talking about the nonlinear program.  You should be running the nonlinear program with the fsolve command, not by typing the filename

# data[].attributes.body
There are 15 bars, so you should have nB=15
Therefore, as well,    t=X(17:31);
And, at the end, F(16:31)=G([5:20]);
And your EA was too big
EA=[100e3*10*ones(1,3) 50e3*1*ones(1,12)];

# data[].attributes.body
Further to this - I'm confused that the prestress (tension) in question 2e, reduces the amount of tension in Q2g compared to 2d (no prestress but same loading). So there's the same loading which produces tension in all cables, but when we pretension the cables the tension in the bar is reduced when the same load is applied. Am I confusing myself?
OK. 1) the main thing about pretensioning is reduction of displacements, ie it is increasing stiffness that we are after, because mechanisms mean low (or zero) stiffness and hence large displacements.  So when out tension structures have mechanisms, we need to reduce their displacements, by increasing stiffness, and this comes from introducing pretension (recall the cubic P-delta curve for the 2-bar structure and what happened when t0 was introduced. 2) the axial force in the bar is made up of two parts, the t and the pretension in third column of conn, which is constantly there.  When we calculate with fsolve and get a t, that t is only part of the axial force carried by that bar.

Also in the same paper, Q2f, we find the prestress force in the linear programme, and then put that in and run the non-linear programme without any load. The bar forces reduce from order of 10 to order of 10e-4. Why does this happen?
You might expect it to be zero, since the pretension force is self-equilibrating (no need for external load) and there is no load applied to cause any disp.  But there is some small disp, because, as the pretension force comes into the bars/cables, they will cause some shortening/elongation, and thus the structure will adjust a little, and that is what we are seeing.  If the "pretension force" had some error in it, and it was thus not self-equilibrating, we would find much bigger disp as the structure then displaces quite a bit (ie disp would not be so small) to try to find the equilibrating position.

This makes a lot more sense now, thanks!

# data[].attributes.body
There was a Q about why lin & NL ans for load in 4y were diff.  Please see OneNote additional note under 20March.

# data[].attributes.body
I was just testing out my 3D linear program on one of the questions, and I came across Q2d.
It asks to specify the other 2 mechanics when only joint 7 to 9 are restrained in all directions.
One of the mechanisms as shown in 2c is that Joint 3 is moving in the x direction.
Would I be right by saying that the other two mechanisms are where joint 2 and joint 4 are moving in the x and y direction?
Just wanted to clarify my visualization and interpretation of the M results. Thanks
yes. I was expecting you to think, this structure has 3-fold symmetry, there are 3 mech, one is joint 3 moving out its plane (in x-direction) so other 2 mech most likely the equiv to joint 3 (ie 2 and 4) moving out of their planes. Note, you CAN verify this by calc. Try this. Temporarily suppress x-movement for joint 3 (so a support in x-direction for jt3), and see now you have 2 Mech. See if you can see the movements of the 2 mech (which will be jts 2 & 4 moving out of their planes).

# data[].attributes.body
I can't seem to tell if the answer for joint displacements is in m or mm, [your disp and forces will be in whatever units you use in the prog, so keep units consistent]

Also another side question, as I was going through question 2c and 2d on the same paper, I got the right tension values, but my displacement values varying slightly (I can say within the range of 0.01 - 0.02 mm [yes, this is just small diff],

I assume that you multiplied your d by 10^3 just to get more significant figures?)  [yes, I showed 1000d because some of the values in d are relatively small here]
I would think these are okay considering the fact that we are using fsolve (iterative process)? Yes

# data[].attributes.body
Nothing wrong with your code. I can see the issue. The Q said load = 5kN. I am fairly sure I intended it to be 5N and told people in the exam. The results given match load = 5N. I have updated OneNote with a note. Thanks for highlighting this.

# data[].attributes.body
A simple question regarding 2-bar direct 4eqn
I was trying the following code, listed in the program tab.
...

solver:
fsolve('TwoBdir',[0 0 100 100])
I keep getting an answer of
1.0e+04 *    [0.0000   -0.0016    1.1199    1.1199]
instead of
1.0e+04 *    [0.0000   -0.0009    2.000    2.000]  the right answer!

Why is that? I changed the initial guess to [0 0 5000 5000] but still get a wired answer:
1.0e+04 *

[   -0.0000   -0.0014    1.2907    1.2907]

OK, note that with everytime you got the wrong answer, Matlab also said
Solver stopped prematurely.

meaning "you can't trust the answer shown here" and "Matlab got stuck"
One thing to do, "make  Matlab work harder".  So try this instead.

fopt=optimset(optimset('fsolve'),'MaxFunEvals',10000,'MaxIter',10000);

fsolve('TwoBdir',[0 0 100 100],fopt)

This time, you get

Equation solved.

ans =

1.0e+04 *

-0.0000   -0.0009    2.0000    2.0000

It is useful to just use the fsolve command with fopt all the time. Note, you have to copy that fopt line into the command window once, every time open Matlab (ie it is not saved in its memory when yo close Matlab). So handy to have that fopt text someone - it is in OneNote under 20March too.

# data[].attributes.body
Working on 3D linear program,
in 2d) I managed to get the same tension forces and displacement values close to yours. But my dot product P.*M was no where near 0 (one of the values was 0.0307).  It is P-dash star M, not P dot star M,  Try P'*M and you'll get 4.5103e-17 with your code, ie effectively zero.  I might have made a mistake in my code, but can't seem to detect it. Code as attached.

Also in 2a), for some reason, your tidied up version of S had 0s, when the original S had no 0s to begin with. Could it be possibly an error?  No, error I've "tidied" it up - but not in a way I can explain how I did it.  But the tidied up version and the original are both correct.  See OneNote>>Admin, 4th link down for some explanation

in 2c), how do I know if the pretension values are reasonable?  1. check size.  2. asking cables to  carry compression?  3. Are values fairly even, ie no very small and very big numbers?  really, looking for a human engineer view of those forces  Does it have something to do with the magnitude of the forces? (3 bars had values more than 750N)

--> in response to 2., would I be right by saying some pretension values (+ve) are asking the cables to carry compression, but in this case we want the opposite? (i.e. the cables are suppose to carry tension?)  In Q2c, you calculate pretension values,  +ve = tension, -ve = compression.  There are -ve values for cables, and this cannot be done.  So this pretension cannot be achieved, unless those cable segments are replaced by struts

Thanks

# data[].attributes.body
I have a small query regarding choosing units.

I tackled the question all the way till 1g part (i) (non linear program - all loads equal at 0.050kN) using units kN and mm consistently (this includes coordinates and EA), and all my answers were OK. However, as I came to try the non linear bit with the asymmetrical loading (0.049kN on joint 6), I didn't get the answer. However, changing my units to N and mm instead gave me the right answer. Any reason for this?
Not sure, without going through the code and runs in detail.  But, I do generally use N and mm, so the numbers are bigger (better for Matlab precision), and I don't use kN + mm combination because then there is bigger difference in the size of numbers between forces and displacements.  Generally, I find fsolve works better when the numbers in the soln are more uniform in size.

My speculation is that using kN and mm led me to a number of local hills due to my starting iteration values (I trialled for 1s for the displacements, and 0.01kN for my bar forces). Is there a way to avoid this?  try as starting values numbers that are realistic (ie about the sort of shape and size as the correct answer) and use N and mm as units.

# data[].attributes.body
When comparing between 2f and 2g to see the effect of pretension, adding pretension resulted in a mix of increase and decrease in joint displacements. Any reason why this is the case?   Note that most of the disp are quite small,  so very small inc or decrease is not really anything, but ...

I would think that the pretension forces are actually stiffening some  of the mechanisms due to the guaranteed minimum stiffness, but I can't tell why the other joints are not stiffened.
pretension should stiffen the struc, you  get less disp, yes.  So to do the comparison, using NL prog, you need A) no pretension, just load; B) just pretension no load; and C) pretension and load.  And you should see that displacements for
(C-B) < A
But note that  in 2g, the 5 loads (large amount) has relatively small disp when the load does not excite the mech, compared to a smaller sized load that does (because mech when excited is a big displacement)

---------------------
I calculated C-B-A (making sure i took the non linear displacement values, and it led me to this)
dC-dB-dA
ans =
-0.2388    0.0235   -0.0500   -0.2839   -0.0417  -0.0629    0.1018   -0.1696    0.3389    0.1067   0.1807    0.3787    0.0214   -0.0080    0.2804 0.0484    0.0192    0.3987

I expected to get all negative values, but only 1/3 of the displacement values are negative.
Sorry, it is that the size of (C-B) should be less than the size of (A).  When the disps are small, when you tighten the struc to prestress it, it deforms a little (which is B) in a certain direction (typically, inwards).  if you then add load on top of that, then the joints will move again, some in the same direction as for pretension, some in other directions.  So it is the size of these changes that you need to see.

I'm guessing that for this case, the  small load change from 50N to 49N could be the reason that the pretension doesn't look like its benefitting? Because these displacements were small  in the first place, so if there was a larger difference in asymmetrical force, then maybe the pretension would actually benefit?

What should happen in this Q (from memory) is that the 5x50 (though big) is not exciting the mech, so disp are quite small, compared to the single 49 (which is a much smaller load) but because this load excites mech, the resultant disp are much bigger.  But we can still reduce the disp from the single 49 somewhat, by introducing pretension into the struct.

Do we normally have to do this when checking whether the pretension has stiffen the structure? I usually just assume that there is no error in the prestress values I obtain In the way I  have shown you the coding, you have to calc B to see the stiffening effect of the pretension, yes.  If B is small (it usually is), but C and A are big, then you can get away without calculating B - but you do not know beforehand that B will be small in this specific case.

# data[].attributes.body
In 2012/13 Q1h, the new cables' EA seems small and the units are making it even more confusing. Is there an error here?
EA=100Nmm2
Actually, it should have been EA=100N and yes, the EA for the two new bracing cables are intentionally much smaller than the original cables

If i used EA as 100N, it would lead me to the same results as the original structure as the EA is so weak (low stiffness) that it isn't really contributing to the structure.   Good thinking, yes, along the right line ...

And for 1i), if i also use the same EA as 100, the linear and non linear analysis don't match, so it does seem like the mechanism is excited, but because of the two new cables, M = 0, so I can't tell where this mechanism is coming from, or why the linear and non linear analysis is different. COuld it be due to the weak 2 cables, that is causing this mechanism?
The  key is, the presence of the two new cables remove the mech, so linear runs and gives results.  BUT, their stiffnesses are so low that large disp results, and so eqm in the original undisplaced configuration (basis of linear theory) is not valid (remember my "cantilever with multiple load steps" explanation?) so you still need nonlinear to give right answer - because disp is so big. See also OneNote >> Admin >> 20March >> "about low EA"

Thanks

# data[].attributes.body
Should the numerical value of P'*M match exactly as the answer, or will it change depending on the values of each column of S and M? I understand when there are more than 1 mech or 1 S, the value in each column can differ. Will this affect the exact value of P'*M? Thank you!
The precise value of P'*M is not that important, and will change with the precise values in M.  Remember 2*M is still the same M?  So with 2M, P'*M will be twice as big, but
still giving the same message.  So it is the size of the number(s) from P'*M that matter, and numbers as small as 1e-14 should be treated as zero.

So P’*M = 2.341e-15 means there is one mech, and the load P does not excite that mech.

P’*M = 0.0143 then is it one mech, and the load P does excite that mech (because the number is not zero).

P’*M = [1e-15  3e-16] then there are two mechs, and the load P does not excite either mech.

P’*M = [1e-15  0.012] then there are two mechs, and the load P excites only the second mech.

Thank you. Does the sign matter then? i.e. does
P'*M = -P'*M, M = -1*M, and S = -1*S?  No.  Sign has no special meaning, since -S is the same  selfstress as S, -2M is the same mech as M.  It is size that has the message, not sign.  (By the way, you cannot mathematically say S=-1*S, which is only true for S=0.)

I got the idea, but if -S is the same self stress as S, how do we tell if a member is under compression or tension from that state of self stress?  The state of self stress S is like a vector being used to describe an orientation.  So S could be [ 2 4 1 ] and in x-y-z coordinate system, that is a vector, and it describes a particular orientation or direction.  So we use S to show orientation, and whether we are taking one step forward in that orientation (ie +S),  or 3.24 steps backward in that orientation (-3.24S), it is all the same orientation.  So that is all S gives, the orientation.

Now, for actual pretension t0 (which is a bit like getting to a specific defined location in the x-y-z coordinate system) then we need specific amounts  of S1, S2, S3 etc., there are specific amounts like α1S1+α2S2+α3S3 that will get us to that specific t0 .  A slightly different α1 will get to a different destination, ie no good.  And  in our calcs, [α1 α2 α3] = α, it is that alpha vector that we calculate in the linear program.

So it is in t or to that we then talk about tension  or compression values, +2.4 or -3.63.  In S, you would say bar 2 has opposite  force to bar 6, but you cannot say bar 2 has tension just because the number for bar 2 is +ve.  You can say that when it is t, but not when it is S.  S just gives the pattern of the prestressing force.

# data[].attributes.body
Hi, for tensile structure, would the loading rate affect how the structure response? If I load the structure slowly or very fast, how does that interact with the bar force, mech and S?  In all of our structural analysis  (other than when we do structural dynamics, ie topics of vibration, impact, blast loading, cyclic loading), we do not consider any time-effect of loads, ie we say the load is there, but we do not say how quickly or slowly the load got there. This approach is called "quasi static" - basically, we assume the load is applied slow enough to not cause a shock or an impact to the structure. That is true of work in this module too.

# data[].attributes.body
For pre-tension of 2mm what changes do you make to the code? I changed the third values of the connectivity matrix to include the pretension of the struts and resultant elongation of the other bars (from trig). Yet this doesn't produce the right answers, is there something missing or incorrect. Thanks.

You introduce pretension by lengthening 2mm in the struts in the LINEAR program, ie in e0.  See notes in OneNote

# data[].attributes.body
But in this questions, I think it is asking how the structure response if the loading is slow and gradual, as opposed to a sudden and quick load, right?  Actually, what I what you to describe is how the 3 top cables (eg 1-2) will lose tension, and then slacken, and then bar 1-5 flops to one side, and one of the 3 cables will the re-tension to hold it up, etc.

# data[].attributes.body
Apologies if this has already been asked before:
I am not getting the same values as those given as the answer for self-stress. Whilst I know that mechanisms can have different values, I wanted to confirm if this was also the case for self-stress? Thank you :)

EDIT: Nevermind! Just saw your answer to a recent question. From my understanding, if we divide a value from your S (say S_kwan) with a value from my S (say S_student) then we should have a coefficient with which, if we multiply values from S_student, we should get S_kwan? Yes, but it only works if ther is only one S (ie one column in S).  When S>1, often, you cannot work out those coefficients
(hopefully that makes sense, I might have understood it wrong) Is that always applicable? - Meaning that there will always be a value k for which we should have S_kwan = k*S_student (or S_student1 = k2*S_student2 = k3*S_student3)?
If that is the case, then it is likely that my code is not working properly as I am not even getting the same signs for self-stress!  Let me see your S

EDIT2: that makes sense! It might be because there are two states that I am unable to get the same values as your answer by simply multiplying. I've included my values below!

0.4440    0.1871

0.3530    0.1488

0.1740    0.2821

-0.1112    0.6704

0.6281   -0.1686

0.2578    0.1399

0.1159    0.2916

0.1416    0.3562

-0.0823    0.1785

0.0287    0.0722

0.1925   -0.1041

0.0942    0.0397

0.2179   -0.2379

-0.2002    0.2186

OK,   My guess is, your ans are fine.  Can't 100% tell by looking, I would need to run a certain algorithm to be sure, but if I was just looking (see OnetNote >> Admin >> 17Apr >>"comparing s & m") I would be looking at rows of zeros.  There are no rows of zeros in your S and my S (so agreement) but  third row from bottom has two near-zeros (in both your S and my S),  and no other rows is like that (in both yours and mine), so that leads me to think your S is the same 2 states of self stress as mine.

Got it! Thank you :)

# data[].attributes.body
A lot of questions ask to describe the mech, bar force and displacement, but when the structure is complex, especially for 3D ones, I find it's very difficult to visualize things , image dx dy dz of each nodes by looking at a list of numbers...is there a easier way to do this?
Well,  you could use Matlab to plot the structure, and then the deflected structure (where the joint coordinates have a multiple of d addded to it). Not sure if having that 3D plot (which allows you to rotate the structure) would help?

# data[].attributes.body
I didn't get 55.6N in all bars at first, but when I changed E to 200kN/mm^2 instead of 40kN/mm^2, I got 55.6N. The strange thing is E=40kN/mm^2 could produce the correct answers for the rest of Q1. Is it a typo in the solution?  Sorry, which Q?  04/05 Q1b??

# data[].attributes.body
This might be a futile question but... How are you able to take those neat Matlab screenshots with coloured backgrounds? Or is it just copied to another text editor...?
???  Give me an example of what you mean!

Like the screenshot below. My Matlab's background is white as opposed to your yellow. I've also seen some of your screenshots with a blue background :)
I copy (CTRL+C) the numbers into Word, I use  Courier font (or come other mono-spaced font), I format the spacings and alignment, and for colour, I put the numbers into a 1x1 table (ie a single cell) and then apply "shading" in Table Design.

# data[].attributes.body
What does it mean when there is no state of self-stress? On a structural level?  The structure is not statically indeterminate, it cannot be pretensioned (by shortening of cables)

# data[].attributes.body
Hi, the question asks for 'What minimum value (approximately) of length change will cause all the cables to be in tension'. I got the struts need to be lengthened, but how do you work out the exact length it needs to be? Thanks!
Try 1mm, see if it is enough.  If not, try a bit more, etc.

# data[].attributes.body
I have the following error message when I try to solve Q1 of the example page for the nonlinear analysis. The error code "Index exceeds the number of array elements" has come up for other problems too, is there a specific are I should be looking at when this comes up?
I can only see part of your code, but I can see that while the structure has 10 joints, but you set up dx with 6 zeros.  Need a dx and a dy for every joint, not just the non-foundation joints. That is certainly a problem, but it might not be the only problem

# data[].attributes.body
A slightly different error came up after changing dx to 10 zeros, i have attached the rest of the code below.  Email me your code in text form, your input, your output,

# data[].attributes.body
If you have a system with a load being applied and the mechanisms is not excited, does that mean the resulting tension and the displacement will be correct.   Yes  Except - note that if EA is v small, there would then be v large disp (eg >10% of the coordinares), and linear prog is not accurate with large disp

# data[].attributes.body
In this two questions the same load is applied to the structure but one is analysed with the linear and the other with the non-linear program. In the linear program P'*M=[0 0 0] and therefore the mechanisms are not excited. Then, why the results obtained with the 2 programs appear quite different (at nodes 2 and 4)?
The deflected shape is also different, why? I though this would happen just when P'*M is not 0 and then a non-linear analysis would be required?
Thank you  I answered this in the Zoom Q&A  on 20May, did you pick the ans up there?
For what i understood, the linear program is not capable of coping large displacements, also the compressed bar result in an unstable displayed configuration. Is this correct? Yes Can this assumption be made for any structure? No, because most structures do not have that "two bar in straight line" instability that allows this "buckling" action

# data[].attributes.body
Does the fact that there is no mechanism mean the same thing?  When struc has no mech, it is what we typically want, ie it is capable of, and stable in, taking all loads

# data[].attributes.headline
Describing S for structures with cables and struts

# data[].attributes.subject
Describing S for structures with cables and struts

# data[].attributes.body
For a structure with 1 state of self stress, with cables and struts, if the struts are all +ve/-ve values and the cables are all -ve/+ve values respectively in the S, is it okay to describe the force distribution to say that the cables are taking tension, whereas the struts are taking compression?  Yes.  remember -S is still the same S.  So you can reverse all the signs to see if all cables are +ve and all struts are -ve, and if so, then you have a good S for a tension structure, ie  only struts take compression and all tension are cables.

I know that you can’t really do that with S, and is only applicable with t,  yes but is this still possible knowing that the structure has 1 state of self stress?  Yes.  With only 1 S, when you have any lack of fit, the resultant pretension will be a multiple of that S (since there is only one). so you can talk about the one S like it is pretension

# data[].attributes.body
A similar problem for the same question although I don't have a dash after the P matrix. I am inputting 18 small values and 16 larger values in X.
The error showing is as follows:
Index in position 2 exceeds array bounds (must not exceed 2).

Error in Q2200720083DNL (line 44)
G(3*(j1-1)+1)=G(3*(j1-1)+1) - (t(i)+conn(i,3))*(x21+dx21)/newL;

Error in fsolve (line 248)
fuser = feval(funfcn{3},x,varargin{:});

Error in NonLinearSolver (line 3)
X=fsolve('Q2200720083DNL',[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1  100 100 100 100  100 100 100 100  100 100 100 100  100 100
100 100]);

# data[].attributes.headline
Looking at prestress with no loads applied

# data[].attributes.subject
Looking at prestress with no loads applied

# data[].attributes.body
When comparing Case A: prestress (no load) and  Case B: prestress (load),
How do we know that the prestress is not distorting the structure? By checking the d when you have e0 and no P.  There WILL be some d, but it will be small (compared to d due to P). What should we looking at to indicate that the prestress applied is not good for the structure?  Maybe, like it needs cables to be in compression, or v v high tension in some cables but low values in others ...
I would think that joint displacements in Case A should be much smaller than Case B, for the case where prestress itself is not distorting the structure. Yes

# data[].attributes.body
When looking at the effect of pretension ( i did account for the displacements with pretension with no load since the calculated displacements with loads were not very big), I can see that only some joints have reduced in displacements with pretension in effect. Does that mean that pretension has somewhat stiffened the structure?  Pretension does have the effect of stiffening up the structure (when the mech is excited) - remember the 2 bar structure and the cubic curve and slope at the origin?
---
Ah I see. I guess it's cause I expected all joints to experience a reduction in displacements. From this question, I would assume that this would not be the case all the time?  You cannot expect a pretension to reduce displacements everywhere, eg especially not in parts where the pretension is low/zero

-- i see, that makes sense. THanks!

# data[].attributes.body
While I understand that we'd expect cables to take tension and struts to take compression, S only tells us if all signs for cables are opposite to those for struts, but it doesn't actually tell us if it's tension or compression correct?  Yes.  S is like an orientation (eg North-South), it does not tell you if you are heading North or South. The e0 and pretension will set which direction, but not S
Couldn't it very much be that the struts are actually in tension and cables in compression (i.e. no good) ?  It does not work like that ...

# data[].attributes.body
When the question asks to show the resulting mechanism, would a quick annotation such as this picture be suitable?  Yes, OK Or would a hand drawn sketch be clearer/ more approprite?  Whichever is quick but conveys the information.  Usually, hand drawn is quick and  does the job nicely.
Also does there need to be words annotating the sketch? This is taken from 2016/17 1b).   Only if you need  say something, but do not merely describe the movtion like "joint 2 moves left and down, joint 3 moves to left only ..."

# data[].attributes.body
In this question you are asking to compare {pre-tension alone}, {pre-tension + load}, and {load alone}. What I noticed was that {pre-tension alone} gave much larger displacements than {load alone}, maybe I noticed the wrong thing, but I would think that pre-tension would allow the structure to stiffen (by reducing displacement) but it seems like it just added the additional displacement from pre-tension leading to higher overall displacements (again maybe I'm wrong).  Pretension alone (Q2c) gives rather small disp., some 0.2 or 0.4, nearly 1.0 in joints 7 & 8 (as you would expect, since you are lengthening that bar) but the rest are ~0.03
It did however allow for all cables to be in tension (when some were previously in compression with {load alone}), which is good.
But since the results from linear prog are supposed to be untrustworthy when the load excites the mechanism, I'm not sure if this would even be accurate? Hang on ...  the way I have taught you, you get pretension from the linear prog (without applying load), so the mech is not excited.  So you apply e0 with P=0, and you get the t.  To have the NL prog with pretension, you then take the t from the linear prog and put it into conn(:,3) of the NL prog.
Would pre-tension even be required if the non-linear prog shows that there's only tension in the cables and no compression (or if displacements are acceptable)?  Not necessarily, but you might still apply pretension because you want to reduce the size of d down a bit.

I guess my question is: I'm not sure if, when the load excites the mechanism, the decision of whether to add pre-tension should be based on linear outcome or non-linear?  Like above.  Use linear to get the pretension values (no P), and put them into the NL prog (with P).   And if non-linear, then what is it that we are trying to see when comparing the linear results (with and without pre-tension) when it is actually not reliable?  Well, linear prog gives wrong/wild/illogical d when load excites mech while NL should give logical looking d.

# data[].attributes.body
Can struts take tension? Yes, they can - but if an element is only ever loaded axially in tension, it is more efficient to put a cable there.
And if they can't and the structure has struts experiencing tension, is there anything we can we do about it (e.g. replace with cable?)  Yep, you have the right thinking, more efficient with a cable.

# data[].attributes.body
I think this is referring to Q1b of 2010-2011 as I am having the same issue!  OK, possibly 55.6 was with wrong E, I can't tell now I have lost the orig prog!.

# data[].attributes.body
For linear program if we find P.M is 0, does it mean that displacements AND tension forces can't be trusted, or is it only displacements?  both,, the whole of the linear anaylsis

# data[].attributes.body
I was trying to get the configuration which gives the values with 70N in bars 1-3 & 3-6 and 0 everywhere else (NL), and managed to get it by changing my first guesses but I am not getting the same displacements. This is what I get:
d=

-0.1211   -0.2100
-4.0261    6.7667
-0.0606   -0.1050
-0.0606   -0.1050
And this is what you get:
d=
0.0000   -0.2100

2.8043   -4.9656

0.0000   -0.1050

-2.8043   -4.9656
Yet we get the same tension forces. Is there a reason for this? I'm not sure if the difference is acceptable (I don't think it is).
Interesting ...  just looking at the values in your d, I would not have thought it would also give bar forces = [70 70 0 0 0 0], not at first glance (without code) anyway ...

# data[].attributes.body
I tried to solve one nonlinear problems. I used fopt but it still came out as

Solver stopped prematurely.fsolve stopped because it exceeded the function evaluation limit,options.MaxFunctionEvaluations = 1.000000e+04.

Any solution?  Does this mean that my original function file is problematic?

Do you mean, even with fopt, fsolve still comes out with "solver stopped"?  That can happen, but it can also be your function file has problems.  You can email me the file (in text), plus what you run it with. + Q number

# data[].attributes.body
Does the sign of self-stress matter？ No, remember that constant times S is still the same S, so -1 * S is still the same S

I run the code and get a set of selfstress which has the same magnitude as the given answer, but the signs of each value are completed opposite. Does it matter? If so, is there any potentail reason for this?

Thanks

# data[].attributes.body
In terms of  trying to describe what the 7 mechanisms are, would I be right by saying that due to the symmetry of the structure, the mechanisms should also be located symmetrically?
I can only think of the structure having 3 mechanisms on each side about the line of symmetry (potentially rotation of bars 1-7, 6-12 etc.)  - so 6 in total but I can't seem to see where the other 1 more mechanism is located at (if i had to guess, maybe it could involve the rotation of the hexagonal planes?)
You are thinking along the right lines.  (1) many mech, mixed up, not easy to tell at all about specific ones.  (2) 7 columns involve movements in all joints/directions, so probably at least 1 mech that is a global movement mech, like a rotational.  (3)  Since it is a hexagon, maybe 6 mechs are to do with each of the 6 "spines" having a radial movement, so maybe 6 spinals +  1 rotational = the 7 mech ...  that's about as much as can be said ...

----Thanks!

# data[].attributes.body
For Clarity, does this mean that when checking mechanism results against the provided results we should focus more so on the location of zeros rather than the actual numbers if we get the same values for S?  If S>1, then check for locations of rows that have only zeros, yes.

# data[].attributes.body
Is there a way to determine whether a mech is infinitesimal or finite by looking at the M matrix? Thx
Yes, but not straightforward and I have not shown it to you - it is not just a Matlab function

I'm thinking to check the bar length with the mech. If the mech causes elongation of the bars, then it's infinitesimal. If the bars stay the same length, then it's finite. Is this the right thinking?  OK. try it and see.  .Most of the mech in Onenote assessments are infinitesimal, but 16/17 Qa, and  07/08 Q1 are finite mech

# data[].attributes.body
When you are asking” Check equilibrium by hand, and thus comment on whether the calculated bar forces look reasonable.

” what do you expect for the answer?
My understanding is extract the bar forces for a specific point and check the equilibrium of two axis. If they are not under equilibrium, then the calculated bar force is not reasonable.

Please correct me if I am wrong.

Thanks a lot.

Yes.  You have computer giving you bar forces at a  joint.  In Year 1, you learnt how to check for eqm at a joint, so do that here to show whether the computer's bar forces satisfy eqm or not (in two directions)

# data[].attributes.body
Just want to double check this, but when applying  pretension to any structure into the NL program, the t that it computes, is not the final t, correct?  Correct. that t (inside X) is only that due to load, the cable would also be carrying what is in conn(:,3)
Would I be right no by saying that to see the final effect of prestress on the structure, I would have to add the effects of t and d
for e.g. t+X(19:37) for the bar forces
and X(1:18) - d
where t and d are the values obtained in the linear analysis for prestress (no load)
the NL d (in X) is the total, no need to bring and disp across from linear prog.  Only the pretension does not show up in the NL tension (in X)

# data[].attributes.body
Wait so does this mean that the t obtained in NL does not include pre-tension? I'm not sure what 'it is not the final t' means?  In NL prog, the d & t results are in X.  The bits of X relating to tension, are tension values due only to load.  A bar would be carrying an axial load = pretension (as given in 🤬(:3,)) and tension to do load (as given in X)

So from your answer, d (in X) is the total yes but for total bar force we need to add the pretension from linear prog to the NL t (in X) to get the total bar force

# data[].attributes.body
When asked to sketch mechanisms for a 3D structure, should we do it on the 3D (isometric) view?  Whatever you think gets across what you are trying to say.  (Rough) isometric OK, mixed with plan & elevs, OK

# data[].attributes.body
1. I thought that we had to  do the following calculation
(C-B) < A
where  A) no pretension, just load; B) just pretension no load; and C) pretension and load, to see the effect of pretension

2. For B, do we take the displacements from the non linear program or the linear program
I have added OneNote >> Admin >> 11 May >> "working out stiffening effect"
but for B, you can use either linear or NL prog. If EA is reasonably big, there should be little difference

# data[].attributes.body
Structurally speaking, is there a reason we'd go for pre-stressing instead of increasing EA and vice versa? Especially if we have displacement due to a load that is exciting a given mechanism, as well as displacement due to potentially low EA. I'm assuming we can do both, but is there a reason we'd lean towards one in particular?
EA stiffens only  non-mech disp. If the disp is due to the mech, EA does not really help. And EA can't bring a slack cable back into tension, only pretension can do that. But pretension does not stiffen non-mech disp.

# data[].attributes.headline
I was reading this comments.. So which results should we include in our answer? 

# data[].attributes.subject
I was reading this comments.. So which results should we include in our answer? 

# data[].attributes.body
For example, Exam  08/09 question 2f, i got the same results as those available in OneDrive,  Should I add the pre-tension from the  Linear program to the tension from the NL program?
Q2f says apply pretension found in 2c into the NL prog.  You only know how to find pretension using the linear prog (with e0) - so that is how you should do it.

# data[].attributes.body
The question is asking:

Pretension are now to be introduced into the structure with the loading in Q1d through equal length change in bars 2 and 3.  What minimum value (approximately) of length change will cause all the cables to be in tension?

Are we supposed to try different e0 until we find all bar are in tension Yes all there are some more clever ways to do this? But it is not blind trial and error, because it is linear prog  So you try 1mm, and you get the effect 1.  You try 2mm and you get effect 2.  Because it is linear, you know that every mm shortening gives you "effect 2-effect 1" and so you can quite quickly work out how much shortening you need.

# data[].attributes.body
When you say 'do not merely dsecrbe the motion like...', could you please give a hint on what else shall we say?  The mech is an anti-symmetric "swinging" motion, around sideways oscillation of the middle joint, and downward movement on the side the middle joint moves towards.

# data[].attributes.body
Questions like:
" Calculate the cable forces that result from a shortening of 1mm in the first cable"
Does the sign of the answer matters.  Normally the results I get from the programe is different with the one in the given solution. Does it matter?
Yes.  negative in e0 is shortening,
I know when change e0 to negative value can give the same sign so does the negative e0 mean shortening Yes the cable while postive e0 means lengthening the cable? yes

# data[].attributes.body
In Q2d, you ask the following: "Comment on the shape of the deflected structure, and the distribution of the cable forces.  Are they (and how are they) as you might/might not expect?"  I'm not sure what to answer and was hoping you could give me a hint? I don't see a particular pattern, except perhaps the fact that the forces are larger near where the load is applied... I might be missing something?
For that one, I was really just expecting something simple.  You are pressing down on the front able 13-1-7-19, you expect it to go into tension.  So the other cables on the front (eg 18-6-12-24)) could also go into tension abit bit less.  An the effect should get less as you move further away from joint 1.  The ring 1-2-3-4-5-6-1 helps dissipate effect from joint 1

Also in Q2f you ask to comment on the displacements resulting from prestress obtained using the non-linear program. The values are very small (10^-8) but is it due to the structure re-adjusting or is it just numerical error from the program? I would assume the displacement due to the structure re-adjusting would actually come from linear (although I could be wrong), as the values I got from linear are much larger...
But then again I believe you said that the displacement given by the NL program is total, meaning it includes both displacement due to prestress and that due to load, so from this definition, if no load is applied, it would mean that the displacement obtained in this question is actually that due to prestress, but then why is it so different than the values I get from linear? There's no load applied so I don't think it's due to mechanisms.. And for EA well we have 2000kN so I would think it would be enough but perhaps it isn't?
ok, if you are getting 1e-8, then it is prob just computational.  I AM expecting small numbers for that Q, more like 1e-3 to 1e-5 (depending on size of EA actually).  The reason why the NL t and d are small when you apply a set of pretension (with no load) is because you are asking for what t & d should the structure have, in order to adjust for the presence of the pretension. But pretension is self-equilibrating, it is in eqm, so there should not be much adjustment at all. If EA is very low, then the pretension will stretch/shorten the bars a bit more, and there will be a bit more adjusting of the structure to account for that.

# data[].attributes.body
I found in several cases that when given different initial guesses for fsolve, it will return different answers and all of them indicated as equation solved.
If I feed these answers into the function, both of them can return very small values (<1e-6), indicating that the answers are quite good.
But the answers themself vary a lot. May I ask how you will identify this type of problem in the exam. For example, my solution is not the same as yours but It does come out from the right functions.  OK, I suggest you include your fsolve command when you give your NL answer. I generally do fidn the "stray" solutions as well when marking (because they tend to be repeatedly found too).

# data[].attributes.body
Do you agree with me for the following statement?
‘When evaluating the results for force, either linear program or non-linear results, if the cable force ends up with a negative value, i.e. compression, the results are not trustworthy’.   The computer prog might be wrong, yes, but also, it could be what you ask.  eg, you put twho loads at the end of a cable, pointing inwards, both linear and NL will give a compression value.  Both are right, that is the correct result.  What is wrong is loading a cable that way,

If that is the case, most of the results of cable structure are not trustworthy, but we are still asking to compare the results linear program and that of non-linear program, (sometimes with pre-tension).

Shall I just ignore the fact that negative values in cable is an issue when doing the further comparison, became comparing untrustworthy results seems pointless.  "Untrustworthy" is when the results, distribution of forces, or the way the structure displaces, is just illogical compared to what you would expect from the way it is loaded.

For example, Question 2 of 2010/2011

# data[].attributes.body
What does the magnitude of P'*M indicate?  nothing

I understand that zero/or near zero P’*M value indicates that mechanism were not excited by P good, but what about the magnitude of P'*M indicate.  nothing  What is the difference between P'*M=0.2 and P'*M=20? honestly, nothing  If P'*M=0.2 , can I say the results is roughly trustworthy?  No. only zero dot product means perpendicular, only load perpendicular to mech means load will not excite mech.  Slightly exciting mech is exciting. Exciting mech a lot is exciting.

Also, if P'*M=[ 52.1722   60.9589  -30.2006] Does that mean three mechanism are all excited at different extents.   Yes, all three are excited, to slightly diff amounts, but the key point is they are all excited

# data[].attributes.body
I lost my question behind another post when moving it.... facepalm
Is there a threshold for maximum displacement allowed?
I  know this would depend on the context but roughly speaking, a certain magnitude above which displacement becomes unacceptable?  Do you mean threshold for discrepancy or the size of the disp itself?  But really, the answer is, depends on context ...

--
I was talking about displacement itself but discrepancy is a good one to know about too! In the exam, you will not have the answer to compare to, you would not know the discrepancy! Ah I thought by discrepancy you meant between linear and non-linear, but fair enough! If I remember I had read somewhere you said if more than 10% the coordinate it's unacceptable? That is the limit for linear being reliable, disp a few % of coord is OK, but getting to 10% is bit big  Maybe I read it wrong...

# data[].attributes.body
Does the fact that EA is low can lead to large displacements but low internal force in given elements? (Example: Q1i 2012/2013)  That Q is a finite mech, ie a large disp mech (it is a hanging cable).  ie not even an infinitesimal mech.  That load excites the mech, the large disp mech, which is why the disp is so big.

# data[].attributes.body
Hello Professor,
I managed to solve the last exercise of week1 but how can I present the result in matrix form?

for i=1:6, for j=1:4, A3(i,j)=sin(sin(B(i,j)*pi/280).^2); end; end; A3

(Do you see what the issue was?)

# data[].attributes.body
Hi Dr Kwan,
Do you have any values for t for the final part of the exercise set where e0 = -2mm?

For e0 = -2mm in bar 4, with load = 0;

t'=[-23688   -23688    33501    33501   -23688   0   -23688    0]

(so note how big the lack of fit bar forces are, due to one bar being slightly longer)

The disp are around the order of magnitude to be expected, to fit in bar 4 being 2mm too long

d'=[   -1.4142   -0.2211   -0.2551   -1.6693   -0.2211   -1.6693    1.4142]

# data[].attributes.body
Hello Professor,
I have tried to solve the exercise of week 3 but I cannot figure out the position of load when writing it in matrix form.
Thanks in advance
Do you mean on the structure or in the P vector, Q says "A vertical download load of 70kN is placed at joint 5." - maybe I don't understand your Q ...

Yes I know the load is at joint 5, but the load matrix has 7 raws, I used this matrix P=[ 0 0 0 0 0 0 -1200]', but I don't know why (-1200) is positioned there.
So P and d have 7 elements following the non-foundation joints, ie the 7 are (2x 2y 3x 4x 4y 5x 5y) missing out 1x 1y and 3y,  which are foundations.  The load is applied downward (-ve direction) at 5y, hence the 7th element is -1200. This is for the first structure for Wk3. The second structure should have 17 components in P and d (missing out 7y, 10x and 10y)

# data[].attributes.body
Hello sir, I tried using the 2D NL program from the Programs tab however I am encountering 2 problems:
1) The values I am getting are different to yours, even if I copy your code as it is  (see picture attached)

2) The plotting code you showed at the end of the "

TenStruc 4.7 GeomNL- example 2D NL run" lecture  is showing an error anytime I run it (I type it after the X=fsolve line in the command window). Matlab says that it doesnt recognise "dcoor". Another error it shows if I put the plotting code in the script is "
Error in fsolve (line 260)
fuser = feval(funfcn{3},x,varargin{:}); "

Can you please either email me, or talk to me, about these?  I think it needs a (back and forth) conversation to resolve.

Update: Hi, I tried running the program on the old exams question in Onenote and it works fine, the values match the answers you provided, so I guess I was missing something the first few runs. I still cant work out the plotting program however as it keeps showing errors, so maybe we can talk about it during the Wednesday session. Thank you
- Ali

# data[].attributes.body
I am trying to use the NL code to solve q1e (2016 paper). but when I run the fsolve I get this error.

# data[].attributes.body
I am currently trying to solve q1 from 2016 paper. but I keep getting an error with the non linear program. I am not sure if the problem is with initial values I have added. Thanks.

# data[].attributes.body
Hello, When the states of self stress is printed with all negative numbers, does this imply all members are under tension? In other words, is tension negative and compression positive in our programs?
Tension is positive, comp is negative,  BUT, a multiple of a state of self stress is still the same state of self stress, and that multiple can be minus one.  ie -S is the same state of self stress as S.  So when you have all -ve numbers in S, that tells you that, in this state of self stress, the axial force in all the cables/bar have the same sign, could be all tension, or all compression. See also connected post

# data[].attributes.body
Hi, Am I right in thinking that the state of self-stress or the state of pretension gives an indication into the stiffness of the structure. So, large values mean that the structure is stiffer and therefore can take more load?
State of self-stress shows what is possible. as a pattern of prestressing or self-stressing.  It is nto saying the bars currently have those forces.  Which is why the absolute values don't matter, just the relative values do, since 2x a pattern is still the same pattern.  State of selfstress is found in S=null(H)
Actual pretension is what you get when you shorten/lengthen  one or more bars in a structure which has one or more state of self-stress (ie a stat indeterm) structure.  pretension in found in the t vector when you run the linear prog with non-zero e0 and zero P.

This is great, thank you. I have a supplementary question: are the values obtained from the state of self-stress based on the bar stiffness. No, just coor and conn, S=null(H) and there is no EA in H (EA is in F).
For example, if there are two bars of the same EA value but of different lengths, the bar with the greatest length (decreased stiffness) will take a larger value of self-stress. No, the values of S is determined by eqm at the joints, and hence by coor and conn. EA (and L) will determine size of displacements.
Or if there are two bars of the same length but different EA values, the bar with the smaller EA value will have a larger self-stress value. Is this correct?

# data[].attributes.body
Hello,
When there is a structure with an applied load at a joint with multiple attached cables, what are the deciding factors for which cables will be under compression and which will be under tension. My understanding is that each loaded joint must be under eqm as so, there must be some combination of tensile and compressive forces correct, but include in also pretension and any load in that joint in the eqm consideration in the surrounding bars. But what decides which bars take a tension force and which take a compressive force?  Actually, quite fundamental, it's joint movements.  Do the movements of the two joints a bar/cable is connected to, make that bar longer or shorter? That is what determines tens or comp due to load.  Then there is also any pretension that the bar originally had, so "final axial force = tens/comp due to load + pretension"

# data[].attributes.body
I have tried many times to solve this problem ,but i keep encountering the same error message:

Index exceeds the number of array elements (6).
Error in PP2007_q2_NL (line 40)
dx21=dx(j2)-dx(j1); dy21=dy(j2)-dy(j1); dz21=dz(j2)-dz(j1);
Error in fsolve (line 258)
fuser = feval(funfcn{3},x,varargin{:});
Error in PP2007_q2_NL_solve (line 5)
X=fsolve('PP2007_q2_NL',[0 0 0 0 0 0 0 0 0 0 0 0 0 0 -5 0 0 0  0 0 0 0 0 0 0 0 0 0 0 0 -100 -100 -100 -100]);
Caused by:
Failure in initial objective function evaluation. FSOLVE cannot continue.

I have attached below my code, what did i do wrong?
= = =
You had P of size 6 by 3.
In nonlinear, P needs to be nJ x 3,
ie all joints, not just non-foundation joints.
Add 3 more rows of "0 0 0;"
You had not defined dz.  So make it
dx=zeros(nJ,1); dy=dx; dz=dx; t=zeros(nB,1);
You had
t=X(nB+1:nB+nD);
You needed to have
t=X(nD+1:nB+nD);
= = =

# data[].attributes.body
In the 2007 Q1 paper, you ask us to comment about whether or not the displacements obtained from the linear program are reasonable. What exactly is a reasonable displacement? My understanding is that the displacements should match the deflected shape indicated by the mechanism matrix as long as the load is shown to excite the mechanism. Is this correct?
The main point is, linear program can't cope with "large displacements", which can come because 1) mechanisms are excited by load (which is shown by non-zero dot product between load and mech) and/or 2) low EA causing displacements in d to be "large" (say >5-10% of the size of the structure). Where there is large displacements, the linear prog results of d and t cannot be relied on, and you should look at the shape of the displaced structure (according to d) to see what that shape is unreasonable.

# data[].attributes.body
Does the magnitude of this dot product influence the trustworthiness of the linear program? So if this value is not zero but very small, say less than 1 - does this increase the reliability of the linear program results?

In the sense that if P'*M gives only zeroes (hence no exciting mech), yes.
But if it is not zero, then it makes no difference whether it is 0.5 or 1000, in that both 0.5 and 1000 are not zero.
Note that with Matlab calc, "zero" can be a little bit bigger than absolutely zero, so numbers like 1e-10 would be "zero".  But just "less than 1" is not small enough to be considered "zero", would need to be < 1e-8