cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

"Encountered floating point error"

RandyA.EI
4-Participant

"Encountered floating point error"

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. 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

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

 

View solution in original post

11 REPLIES 11

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.

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 ...

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.EI
4-Participant
(To:Werner_E)

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? 

 

 

RandyA.EI
4-Participant
(To:Werner_E)

This is what the code attempts to follow after being modified for the inputs from the data file: 

RandyAEI_0-1699561518198.png

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.

Werner_E_0-1699571488122.png

Werner_E_1-1699571627903.png

No idea if this makes any sense

 

Prime 9 file attached

 

RandyA.EI
4-Participant
(To:Werner_E)

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 🙂

Top Tags