Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
How can I use bode function in prime?
Your function would return all non-real results which can't be plotted, like
You type a square bracket and this creates a matrix - guess this was not your intention.
Maybe you meant it to be the absolute value? Then of course you also would get real results.
But because f is a vector, you will also use vectorization as otherwise only the absolute value of the vector would be the only single scalar value.
Vectorization is also what you need in your second plot
P10 file attached
It took me a couple of seconds to work out why Tetsuro's phase plot looks different to yours - it's the linear vs logarithmic x-axis.
To add my minor tuppence worth, I've modified your phase plot, removed the symbols, and added gridlines (I believe they're normally shown in Bode Plots?). I didn't necessarily like the auto-scale's choice of min/max values and steps, either.
.
Stuart
.
@StuartBruff wrote:
It took me a couple of seconds to work out why Tetsuro's phase plot looks different to yours - it's the linear vs logarithmic x-axis.
Correct. All I edited was the vectorization and I left the original of @FC_10037391 otherwise unchanged. Actually I avoid opening the chart component because its so slow and awkward to use.
@Werner_E wrote:
@StuartBruff wrote:
It took me a couple of seconds to work out why Tetsuro's phase plot looks different to yours - it's the linear vs logarithmic x-axis.
Correct. All I edited was the vectorization and I left the original of @FC_10037391 otherwise unchanged.
OK. That explains that.
@Werner_E wrote:
Actually I avoid opening the chart component because its so slow and awkward to use.
I don't recall using the chart component before, but never has a truer word been spoken, Werner. Even the Aesop's hare got past the finishing post first and he'd had a very long sleep in the gentle warmth of the CPU.
I don't know why PTC didn't/don't give these "area" defined tools the ability to pass/return settings as part of a function. Or even, as I suggested a very long time ago, treat them as user-accessible objects. That way, the user could directly set properties and even define appropriate methods (functions).
Not that I mind user-interfaces for property setting (far from it), it's just that I prefer to have them as an overlay on top of a user-accessible model.
Stuart
Indeed, as I noted 12 years ago, "Well, I was a bit of a late-comer to the Collaboratory, but I have heard rumours that Apollonius made a similar request when he was beta-testing Mαθκαδ α ... and I'm pretty sure he wanted built-in geometric drawing tools as well."
https://community.ptc.com/t5/Mathcad/Mathcad-worksheet-as-a-function/m-p/338734#M132404
Well, I sure second yours and Apollonius' feature request.
But I would have preferred PTC to improve the native plots (2D and sure also 3D) rather than amateurishly integrating a third party software that can't even handle units. An absolute no-go for software like Mathcad - but unfortunately it's no longer Mathcad, it's just Prime...