If I am plotting a square wave s.t.:
$Assumptions = {k, p} ∈ Reals && {k, p} > 0
f[x_] := Piecewise[{{2 k, 2 p < x < 4 p}, {0, 0 < x < 2 p}, {0, 4 p < x}}]
Is there a way that I can plot this without setting k and p equal to something (for example 1)?
An additional question, is there a way to evaluate f[x] without giving k and p values? E.g.:
In[65]:= f[3 p]
Out[66]= Piecewise[{{2 k, 2 p < 3 p < 4 p}, {0, True}}]
would instead evaluate as
In[65]:= f[3 p]
Out[66]= 2 k
Thank you all for you time,
Edited to add that I am trying to make a plot similar to 
but with a square wave. Notice that the units for the range are multiples of E.

fwithout assigning values for $p$ and $k$; if the latter are not specified, thenfis really a function of 3 variables; your best bet would then be some kind ofContourPlot3D. 2) Most functions don't take assumptions into consideration automatically; try perhapsSimplify[f[3 p]], or more directlyRefine[f[3 p]](which should be invoked automatically bySimplifyanyway). $\endgroup$