Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
I am attempting to evaluate a ground motion data set using Newmark's method. The programing routine augments displacement, velocity, and acceleration. I then need to plot the displacements vs. the time period as it varies from 0.02 to 4 in steps of 0.02. When I define T I get the following error :
I don't think a local definition with in the routine will yield accurate results. The routine needs to run as a function of T.
Solved! Go to Solution.
Sorry, don't know anything about Newmark method and what its all about.
But I don't think that your function (first version) needs a vector T at all.
T seems to be the time period you should known, isn't it?
For every value of T you get a full set of displacement, velocity and acc vectors.
If you just want to use the max value of them so that every value of T returns just one value u,v, and a, that should be no problem.
No idea if this makes any sense
Prime 9 file attached
Hi,
Can you provide the data file?
It may need to be zipped to include it.
Cheers
Terry
Hello!
I believe I added it correctly by editing the posted message but attached to this reply just in case.
Thanks!
Randy
Hi,
So far without the data
in function NNONR() T is a vector so wn, k, c are also vectors. Then a0, expect is a single value is also a vector.
Is this right.
You need to apply vectorization (arrow over the expression) when you call NNONR with T as a vector.
But the result will be a vector with 200 elements corresponding to the 200 values in T and each of these elements would be a 3000 x 3 matrix (the augmented vectors u, v and a corresponding to the specific value in T.
You would get the very same nested matrix by looping through T and calling NNONR for every value of T (which actually is what vectorization does)
So I am not sure what you would like to plot ...
At least the last value in your vector Accn is a NaN. You may filter for them:
I still don't know what you are trying to plot as with the function you wrote you would get 3000 displacement values for every single time T. So which one would you like to plot over time?
If its the last one of all this values you could do it that way
Not sure if this would make any sense, though.
Thanks for all the insights! I guess what I'm trying to do is run the "NNOR" code for each value of T (200 times) then I want to take the maximum value of displacement, velocity, and acceleration of each iteration and store that in a matrix to plt vs. the T matrix.
I'm not sure i that is possible with the amount of data stored in the text file. Would it work if I deleted the back half of the file to where it only stored 200 points of data?
This is what the code attempts to follow after being modified for the inputs from the data file:
I wrote this in routine format but ran into issues with for loops so reverted back to the recently uploaded version.
Sorry, don't know anything about Newmark method and what its all about.
But I don't think that your function (first version) needs a vector T at all.
T seems to be the time period you should known, isn't it?
For every value of T you get a full set of displacement, velocity and acc vectors.
If you just want to use the max value of them so that every value of T returns just one value u,v, and a, that should be no problem.
No idea if this makes any sense
Prime 9 file attached
This works! Thanks!
@Werner_E wrote:
Sorry, don't know anything about Newmark method and what its all about.
"Newmark’s Family of Methods": https://web.stanford.edu/group/frg/course_work/AA242B/CA-AA242B-Ch7.pdf
@VladimirN wrote:
@Werner_E wrote:
Sorry, don't know anything about Newmark method and what its all about.
"Newmark’s Family of Methods": https://web.stanford.edu/group/frg/course_work/AA242B/CA-AA242B-Ch7.pdf
Thanks, but ultimately I just wanted to express that Randy himself needs to at least get clear about what exactly he actually wants to program 🙂