Skip to main content
10-Marble
January 23, 2025
Solved

How to use a symbolically evaluated equation for a plot?

  • January 23, 2025
  • 3 replies
  • 2193 views

I am trying to get a bode plot of a transfer function which I symbolically evaluated first. After that I want to insert some constants and then use it for a bode plot. Is there a way to do that?

 

I am using PTC Mathcad Prime 10,0.1.0.

 

RK_12705188_0-1737641829367.png

 

Best answer by LucMeekes

There's no problem, in fact it is advisable, to do what you want. You just have to carry the unknowns as parameters in your functions. See here:

LucMeekes_0-1737656833368.png

Success!

Luc

3 replies

12-Amethyst
January 23, 2025

To start, move the definitions for "a" and "b" before your equations where you use those variables.  Mathcad doesn't know what they are when the equations are executed.  Once you do that, you might find that things are easier to troubleshoot. 

10-Marble
January 23, 2025

The thing is I want to see the symbolic evaluation at first, since this version I've showed in my file is just a simple example. The evaluation I do a is much more unclear than in the example, which is why I need to see it first. Or is it not possible to do it this way in Mathcad?

12-Amethyst
January 23, 2025

You can't do it that way, because Mathcad evaluates your equations line by line from top to bottom and left to right.  So, you're trying to evaluate a function that has variables which are undefined.  The other issue is that your functions don't evaluate to a result.  See the WS3 attached.  N(s) and Z(s) don't mean anything because "s" is not defined.  It could be a function or a variable.  Mathcad doesn't know how to interpret that.

 

I created new functions N(t) and Z(t), where "t" is defined as mathematic operations of "a" and "b".  Those functions evaluate to a result, and so does "g", So you have to define or evaluate every term in your equation.  You also used the solve function to evaluate the result of G.  You can do that, but you have to define it differently, i.e. you have to state what variable you're solving for.  Since "s" is unknown in both equations, G(s) can't be evaluated.

 

Remember, your inputs, i.e. variables, can also be arrays or vectors.  They don't have to be constants like I have used here.  But that requires a different way of handling the arithmetic operations in your functions.

 

Hope that helps.

LucMeekes23-Emerald IVAnswer
23-Emerald IV
January 23, 2025

There's no problem, in fact it is advisable, to do what you want. You just have to carry the unknowns as parameters in your functions. See here:

LucMeekes_0-1737656833368.png

Success!

Luc

12-Amethyst
January 23, 2025

Good to know.  Thanks Luc.  This helps me as well.

23-Emerald IV
January 23, 2025

And if you think you have to carry too many parameters into a function, you can put them in an array:

LucMeekes_0-1737657967443.png

Success!
Luc

ttokoro
21-Topaz I
21-Topaz I
January 26, 2025

Prime 10.0.1  If useing logspace function, plot needs vectorization, however, linear range doesn't need. 

image.png

image.pngimage.png

image.png

image.png

t.t.