Skip to main content
4-Participant
November 9, 2023
Solved

"Encountered floating point error"

  • November 9, 2023
  • 3 replies
  • 5694 views

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 :

 

RandyAEI_0-1699501965170.png

 

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. 

 

 

 

 

Best answer by Werner_E

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.

Werner_E_0-1699571488122.png

Werner_E_1-1699571627903.png

No idea if this makes any sense

 

Prime 9 file attached

 

3 replies

21-Topaz II
November 9, 2023

Hi,

Can you provide the data file?

It may need to be zipped to include it.

Cheers

Terry

RandyA.EI4-ParticipantAuthor
4-Participant
November 9, 2023

Hello!

 

I believe I added it correctly by editing the posted message but attached to this reply just in case.

 

Thanks!

Randy 

25-Diamond I
November 9, 2023

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.

Werner_E_0-1699508586225.png

Werner_E_1-1699508737249.png

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)

Werner_E_2-1699508852887.png

 

So I am not sure what you would like to plot ...

25-Diamond I
November 9, 2023

At least the last value in your vector Accn is a NaN. You may filter for them:

Werner_E_0-1699517021466.png

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

Werner_E_1-1699517191700.png

Not sure if this would make any sense, though.

 

 

RandyA.EI4-ParticipantAuthor
4-Participant
November 9, 2023

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?