# Thread: Laplace transform and axis drawing

1. ## Laplace transform and axis drawing

Hi everybody ,
I need do draw 3 axis of x,y,z of the attached function ,
where the 'z' axe iz |H(s)| , meaning the {L} transform of h(t) ,
the 'x' axe is σ , and the 'y' axe is : (σ+jω)ω ......
but I don't know what function to use . Is it 'Graphics3D' ?

p.s. T0=5 (a const)

thanks (:

2. Suppose the transform was f(s)=1/s where s is a complex variable s=x+iy. Then to draw the absolute value of f(s) in Mathematica you can use either Plot3D or ParametricPlot3D. I'll use Plot3D:

Plot3D[Abs[f[x+iy]],{x,-3,3},{y,-3,3}]

Remember imaginary i in Mathematica is either a double-strike i (esc i i esc) or capital I.

3. Originally Posted by shawsend
Suppose the transform was f(s)=1/s where s is a complex variable s=x+iy. Then to draw the absolute value of f(s) in Mathematica you can use either Plot3D or ParametricPlot3D. I'll use Plot3D:

Plot3D[Abs[f[x+iy]],{x,-3,3},{y,-3,3}]

Remember imaginary i in Mathematica is either a double-strike i (esc i i esc) or capital I.
But how can I define in Mathematica that z-H(s) , x- sigma and y- (σ+jω)ω ?

4. Originally Posted by new guy
But how can I define in Mathematica that z-H(s) , x- sigma and y- (σ+jω)ω ?
That's confusing. f(s), the transform, is a function of a complex variable s=x+iy and is itself complex. The command:

Plot3D[Abs[f(x+iy)],{x,-3,3},{y,-3,3}] is implicitly taking z=Abs(H(s)), x is set equal to the real component of the complex variable x+iy, and y is set equal to the imaginary component.

What does $y-(\sigma-j\omega)\omega$ mean? Are you asking to set $y=(\sigma-j\omega)\omega$ with $j=\sqrt{-1}$? In that case y would itself be complex and you can't plot a complex variable directly. Need to take it's real part, imaginary part or absolute part.

5. Originally Posted by shawsend
That's confusing. f(s), the transform, is a function of a complex variable s=x+iy and is itself complex. The command:

Plot3D[Abs[f(x+iy)],{x,-3,3},{y,-3,3}] is implicitly taking z=Abs(H(s)), x is set equal to the real component of the complex variable x+iy, and y is set equal to the imaginary component.

What does $y-(\sigma-j\omega)\omega$ mean? Are you asking to set $y=(\sigma-j\omega)\omega$ with $j=\sqrt{-1}$? In that case y would itself be complex and you can't plot a complex variable directly. Need to take it's real part, imaginary part or absolute part.
First of all , thanks for help.
I mean that I'm required to plot 3 different axis of 'x' 'y' 'z' .
I tried something like this :Plot3D[ Abs[H[\[Sigma] + \[ImaginaryJ]\[Omega]]], {\[Sigma], -60,
60}, {\[Omega], -100, 100}]

but I do not think that that's what the task asks.
I'll try to be more specific : I need to draw a Laplace transform's graph of |H(s)| , the graph needs to be a three dimensional graph , where:
1. H(s) is the Z axe
2. σ is the X axe
3. (σ+jω)ω is the Y axe .

6. Originally Posted by new guy
First of all , thanks for help.
I mean that I'm required to plot 3 different axis of 'x' 'y' 'z' .
I tried something like this :Plot3D[ Abs[H[\[Sigma] + \[ImaginaryJ]\[Omega]]], {\[Sigma], -60,
60}, {\[Omega], -100, 100}]

but I do not think that that's what the task asks.
I'll try to be more specific : I need to draw a Laplace transform's graph of |H(s)| , the graph needs to be a three dimensional graph , where:
1. H(s) is the Z axe
2. σ is the X axe
3. (σ+jω)ω is the Y axe .
The $(\sigma+j \omega) \omega$ part is complex and you can't use a complex number for an axis directly. How about this and maybe you can figure out what you need from it: I'll let $s=(\sigma+j \omega) \omega$. Now, I can plot a 3-D plot if I take the real or imaginary part of $(\sigma+j \omega) \omega$ as the y-axis, $\sigma$ as the x-axis, and Abs[H(s)] as the z-axis using ParametricPlot3D:

f[s_] := 1/s;
ParametricPlot3D[{\[Sigma], Im[s], Abs[f[s]]} /.
s -> (\[Sigma] + I*\[Omega])*\[Omega], {\[Sigma], -5, 5}, {\[Omega], -5, 5}]

7. Originally Posted by shawsend
The $(\sigma+j \omega) \omega$ part is complex and you can't use a complex number for an axis directly. How about this and maybe you can figure out what you need from it: I'll let $s=(\sigma+j \omega) \omega$. Now, I can plot a 3-D plot if I take the real or imaginary part of $(\sigma+j \omega) \omega$ as the y-axis, $\sigma$ as the x-axis, and Abs[H(s)] as the z-axis using ParametricPlot3D:

f[s_] := 1/s;
ParametricPlot3D[{\[Sigma], Im[s], Abs[f[s]]} /.
s -> (\[Sigma] + I*\[Omega])*\[Omega], {\[Sigma], -5, 5}, {\[Omega], -5, 5}]

edited: I think I fixed it , but I have another problem . Now I want to have 2D garph , where:
1. σ=0
2. X - ω
3. Y - |H(s)|

can you please see the attached file and explain to me where is my mistake ?

8. You need to put the assignments in brackets and use the double black-slash to indicate sequential substitution, that is, first substitute sigma, then substitute s->sigma+i omega if that's indeed what you want.
ParametricPlot[
{Im[s*\[Omega]], Abs[(Exp[-9*s]*(1 - Exp[9*s] + 9*Exp[9*s]))/
(9*s^2)]} //. {\[Sigma] -> 0, s -> \[Sigma] + I*\[Omega]},
{\[Omega], -1, 1}]

9. Originally Posted by shawsend
You need to put the assignments in brackets and use the double black-slash to indicate sequential substitution, that is, first substitute sigma, then substitute s->sigma+i omega if that's indeed what you want.
ParametricPlot[
{Im[s*\[Omega]], Abs[(Exp[-9*s]*(1 - Exp[9*s] + 9*Exp[9*s]))/
(9*s^2)]} //. {\[Sigma] -> 0, s -> \[Sigma] + I*\[Omega]},
{\[Omega], -1, 1}]
Isn't there a defined function for working with 2D (something like Plot3D for three , just in this case , for two ) ?

nonetheless , I got to separate graphs after [ALT+SHIFT]ing . can you please explain to me why ?

10. You're getting two graphs because you're plotting two functions when you specify Plot[{f1,f2}] and apparently Plot is attempting to plot the first one as a 3D plot. I think you're mixing up my syntax for ParametricPlot3D with Plot and you're using non-standard syntax.