Programming Mathcad prime- time steps, numerical evaluation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Programming Mathcad prime- time steps, numerical evaluation
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.
- Labels:
-
Physics
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Werner,
PDF copy of this Prime worksheet can be found in attachment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'd like to thank you VladimirN for uploading the pdf. Much appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
"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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Laura, now it seems that everything is fine.
Greetings
FM
