How to take laplace transform of square(t) function

11 ビュー (過去 30 日間)
Michael Mulumba
Michael Mulumba 2015 年 4 月 13 日
コメント済み: laisha 2016 年 9 月 13 日
I am currently on part b. I believe the problem is asking me to generate the square wave, which I do through square(t) from 0 to 30. But when I take the laplace transform I get an error.
syms s j Y;
f=square(j);
F=laplace(f,j,s)
-----------------------------------
Input arguments must be 'double'.
I can generate the wave but then I can't use the laplace transform. I've tried generating the square wave by using sin(t)/abs(sin(t)) but I don't know how to use the output of that function either.
Using this video and this pdf I believe the laplace transform is (exp(-s*pi) - 1)/(s*(exp(-s*pi) + 1) but I cannot replicate this in matlab.
What is the best way to generate this wave and obtain its laplace transform, should I just try to do the steps the same as in the video and ignore the laplace function or am I missing something?
  1 件のコメント
RahulTandon
RahulTandon 2015 年 7 月 7 日
編集済み: Image Analyst 2015 年 7 月 15 日

do you mind asimulink solution to the problem?

サインインしてコメントする。

回答 (1 件)

Philip Caplan
Philip Caplan 2015 年 4 月 15 日
編集済み: Philip Caplan 2015 年 4 月 15 日
Since this is a homework problem, I'll only give some hints. The reason you are getting the error message "Input arguments must be 'double'" is because "square" is not defined for symbolic inputs. However, from your homework question, note that "h(t) is defined on [0,10*pi]" which can be described by:
syms t
n = 10;
h = heaviside(t);
for i=1:n
h = h +2*((-1)^i)*heaviside(t -i*pi);
end
You can then call "laplace(h)" but note this is only a part of the full square wave, defined on [0,10*pi]. Hope this helps.
  1 件のコメント
laisha
laisha 2016 年 9 月 13 日
If i want n equals to infinity, what changes should i make? The function gives an error

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by