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

Need help with plotting column matrix for bode plot

AS_9824434
11-Garnet

Need help with plotting column matrix for bode plot

Hi all,

I hope everyone is having a great day!

I am trying to plot a bode plot(i.e gain in dB w.r.t w in rads-1) at specific frequencies inputted in a vector/matrix. 

How then do I plot the column matrix('gaindB') with w(rad s-1) on the horizontal axis? 

The transfer function is given by f(s) where s represents laplace constant of j*w

I have attached my workings below. 

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:AS_9824434)

You have to vectorize your expressions (put an arrow above it, look that up in the 'Operators' section on the Math ribbon. It's in the lower-right corner:

LucMeekes_0-1615991044038.png

I'll leave the phase to you..

The table is easy to reproduce except for the argument at w=0.8. Note that the phase runs on negative continuously, but the argument of a complex number is generally limited to between -pi and pi, or -180 deg and 180 deg.

 

Success!
Luc

View solution in original post

16 REPLIES 16

Because gaindB is a vector taking the magnitude results in a scalar.  Vectorize:

Fred_Kohlhepp_0-1615815570943.png

 

The numeric value on the right-hand side of each equation is substituted for the name on the left-hand side in the expressions that define the model. No checking is done during the substitution to determine whether the substituted value is valid.

Look up vectorize

Fred_Kohlhepp_0-1615894016056.png

 

@Fred_Kohlhepp 

You are replying to a SPAM posting 😉

The text was copied from here: https://de.maplesoft.com/support/help/maple/view.aspx?path=DynamicSystems%2FResponsePlot

The text should look innocent and appropriate for the forum at first glance and when after a while the posting has passed moderation, a SPAM-Link is added. Unfortunately a quite common method which can be seen on other forums as well.

@Werner_E 

 

Thanks for the tip!

I rarely chase links in these posts; if there isn't a file attached, or at least a picture, they aren't serious.  (And Malwarebytes has been very good at issuing warnings!)

what sorry?

LucMeekes
23-Emerald III
(To:AS_9824434)

That's not about your post, but the one from LS_9861888.

 

Luc

LucMeekes
23-Emerald III
(To:AS_9824434)

Maybe this helps

LucMeekes_0-1615919355608.png

 

Success!
Luc

 

Cornel
17-Peridot
(To:LucMeekes)

How to put grid in the graph in Mathcad Prime for Bode Plot (Magnitude & Phase Plot's)?

Or is it only possible if we use a chart component or something like that?

 

 

LucMeekes
23-Emerald III
(To:Cornel)

The standard plot of Prime does not come with grids, but there are several methods to put in a grid.

The 3rd party add-on chart-component does provide grids, but it doesn't deal properly with units (as far as I know).

Here's the result of my grid routine

LucMeekes_0-1615928682317.png

Success!

Luc

Hi Lucmeekes,

Thanks for that! I am looking at the file you attached.

 

 

Can you help me calculate the complex numbers for the specific frequencies in the 'w' vector? The file attached below has wrong values. However, in the bode plot you have plotted does do it correctly, I just need the complex numbers(Re and Im parts) and the gain(screenshot 227). How can I do this, I used vector 'w' but it does not work?

Of course this can be done by pen and paper but that will take too long.

LucMeekes
23-Emerald III
(To:AS_9824434)

You have to vectorize your expressions (put an arrow above it, look that up in the 'Operators' section on the Math ribbon. It's in the lower-right corner:

LucMeekes_0-1615991044038.png

I'll leave the phase to you..

The table is easy to reproduce except for the argument at w=0.8. Note that the phase runs on negative continuously, but the argument of a complex number is generally limited to between -pi and pi, or -180 deg and 180 deg.

 

Success!
Luc

Cornel
17-Peridot
(To:LucMeekes)

Why do we need to vectorize the h transfer function?

CornelBejan_0-1616098838357.png

 

Cornel
17-Peridot
(To:Cornel)

Is it possible to increase the thickness of the numbers on the two axes (values ​​on the x and y axis) in the XY plot? Or this thing is possible just in the Chart Component?

CornelBejan_0-1616100055110.png

 

LucMeekes
23-Emerald III
(To:Cornel)

So far I have not found any settings to control the axis colour.

 

Luc

LucMeekes
23-Emerald III
(To:Cornel)

We need to vectorize because f is a vector. You're plotting the same transfer function with respect to the variable freq. Now freq is undefined (you didn't define it before the plot) so Prime uses it as an automatic variable, and defines it as a range (that is something different from a vector ! ). While it is handy sometimes for plotting, this automatic variable is not well under your control.

 

Success!
Luc

Top Tags