Skip to main content
1-Visitor
October 4, 2015
Solved

Periodic Function Plotting

  • October 4, 2015
  • 3 replies
  • 2530 views

Hi

I have been through many posts but i am not able to plot the attached expression. Can you please tell where i am doing mistake?I am expecting a periodic square waveform toggling between +/-24V with on and off period 5us.

Here I used Ton,Toff as a cons; x as a variable and Vlp(x) as a function.

<Unfortunately when instead of Variables I used to substitute assigned Numerical value it works>

Conditional+function.pngdsafsd.png

Best answer by StuartBruff

SAMEER GARG wrote:

Hi

I have been through many posts but i am not able to plot the attached expression. Can you please tell where i am doing mistake?I am expecting a periodic square waveform toggling between +/-24V with on and off period 5us.

Here I used Ton,Toff as a cons; x as a variable and Vlp(x) as a function.

<Unfortunately when instead of Variables I used to substitute assigned Numerical value it works>

? I thought we'd looked at this before?  You need units in your conditional terms and you need to multiply x by microseconds in the Vlp function in the plot.

Stuart

3 replies

19-Tanzanite
October 5, 2015

Assign x as a range variable over the desired range of the plot.

23-Emerald I
October 5, 2015

By default, when you don't specify a range, Mathcad will plot x from -10 to 10 (IIRC).  Evaluation of your function for a negative number fails, causing your error.  Richard's fix is the correct answer.

23-Emerald V
October 5, 2015

SAMEER GARG wrote:

Hi

I have been through many posts but i am not able to plot the attached expression. Can you please tell where i am doing mistake?I am expecting a periodic square waveform toggling between +/-24V with on and off period 5us.

Here I used Ton,Toff as a cons; x as a variable and Vlp(x) as a function.

<Unfortunately when instead of Variables I used to substitute assigned Numerical value it works>

? I thought we'd looked at this before?  You need units in your conditional terms and you need to multiply x by microseconds in the Vlp function in the plot.

Stuart

sgarg1-VisitorAuthor
1-Visitor
October 5, 2015

Hi StuartBruff

Thanks a ton.

This really works. Sorry i was not getting reply so that is why i posted in other threads as well.  Next time i will make patience.