Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
Hey guys,
I'm Laura and im currently working on a worksheet in mathcad Prime 3. The first time programming and having a hard time trying to compute a rather simple loop for an explicit time-stepping (numerical evaluation) problem. For those who are familiar, it's the book of Chopra-Dynamics of structures ->chapter 5, p. 207, Central Difference Method
If someone could help me out, tips making the program work, that would be greatly appreciated!
Laura
Solved! Go to Solution.
Your file is in Prime 3.1 format which I (as may others here who also did not bother upgrading) unfortunately can't read. PTC provides no way to convert so all you could do is to additionally provide a screenshot or a pdf-Print of your file.
Regards
WE
I'd like to thank you VladimirN for uploading the pdf. Much appreciated.
Hi Laura,
there are a couple of issues with the worksheet,
The first, in the program is that you try to reference u[-1; the origin is either 0 or 1 - so this variable does not exist.
Too fix this I have added 1 to all the references - it seems to work but will need to be checked & tidied up
The second issue is with the plot.
the index variable needs to be written as a subscript & the function needs all the parameters.
Attached is Prime 2 version.
Hope this helps
Andy
"the origin is either 0 or 1". No, it is whatever you define it, by default it's 0, but if you like you can set it to -1. See:
Luc
Thanks for the comments. It made the program run smoothly. However, I don't obtain the correct results. The response looks like an exponential function that goes to positive infinite, which is not true.
Hello Laura, since there are enough other files offered by the community, I'll show only a photo of your problem solved by me, from which you can take whatever you need.
Cheers
FM
Dear FM,
It is very kind of you responding that fast. Thanks a lot. However, unfortunately, when I compare the results of the example presented in the book of Chopra and those that are derived from the program I don't get the same answers. I highlighted the differences in green. I hope you are willing to take a look at it.
Hi Laura,
I haven't managed to reproduce the results here (yet), but I think that you need to compare the program against the book you are following.
So far I have noted that:
the x (p) input appears to have an additional 0 at the start.
c is defined as 0 in the program but 0.1592 in the book example.
the definition for a in the program is
but the book says
None of the above significantly affect the calculation, but it does suggest that there are further corrections to be made.
regards
Andy
Hi Andy,
Thanks for taking a look at my problem. I summed my thoughts on your comments below.
1. The additional zero at the start is done to avoid an error. See the picture.
2. C is defined between the brackets. It doesn't affect the program since it is kept variable.
3. 'a' was incorrect. It's a typo, my bad.
I took a screen shot of the worksheet.
Laura
Hi Laura, now it seems that everything is fine.
Greetings
FM