ilaplace confusing - result from command window and from m file gui is not the same
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
Hi,
I write in command window:
ilaplace((0.99984898859777815438576453743735*s^2 + 1414.0*s - 414151.01140222184561423546256265)/((s + 1000.0)*(s^2 + 1000000.0)))
And I got : ans =
(199002808534433793169*cos(1000*t))/140737488355328000000 - 58286573144567511919/(140737488355328000000*exp(1000*t)) - (1169*sin(1000*t))/140737488355328000000
I write the same in m file from GUI and I got:
0.707*exp(1000.0*t*i) - 0.41415101140222184561423546256265/exp(1000.0*t) + 0.707*(1/exp(1000.0*t*i))
WHY I GOT COMPLEX NUMBER? "i"?
댓글 수: 1
No idea?
채택된 답변
Mischa Kim
2014년 1월 21일
편집: Mischa Kim
2014년 1월 21일
Hello John, it is actually the same. Try plotting the two results.
The reason you get complex numbers is because of Euler's formula:
exp^(ix) = cos(x) + i*sin(x)
댓글 수: 12
I was thinking, that from inverse Laplace transformation I get only time domain, not imaginary...
and why result is not the same in command window and in m file gui?- I mean only time domain?
Mischa Kim
2014년 1월 21일
편집: Mischa Kim
2014년 1월 21일
Have a look at the first and last term of the GUI result:
0.707*exp(1000.0*t*i) + 0.707*(1/exp(1000.0*t*i))
According to Euler this should equal to
2*0.707*cos(1000.0*t)
Evaluate both terms at, e.g., t=3:
0.707*exp(1000.0*3*i) + 0.707*(1/exp(1000.0*3*i))
ans =
-1.379614630638451 - 0.000000000000000i
versus
2*0.707*cos(1000.0*3)
ans =
-1.379614630638451
In other words, the method (inverse Laplace) is just fine. It's the computer that does not quite get it right.
Should I change computer :-) ?
If I use command "abs" for result from ilaplace, I should get what I need. But I got this:
abs(0.707*exp(1000.0*t*i) - 0.41415101140222184561423546256265/exp (1000.0*t) + 0.707*(1/exp(1000.0*t*i)))
What happend? Maybe ilaplace is not problem....problem is somewhere else.
But where?
syms t
res = 0.707*exp(1000.0*t*i) - 0.41415101140222184561423546256265/exp(1000.0*t) + 0.707*(1/exp(1000.0*t*i));
simp_res = simplify(res, 'Criterion', 'preferReal', 'Steps', 100)
simp_res =
(707*cos(1000*t))/500 - (7460681362504641*exp(-1000*t))/18014398509481984
Hi, I got error:
??? Error using ==> sym.simplify
Too many input arguments.
I use matlab R2011a
In command window for:
a=simplify(70.7*exp(1000.0*t*i)*i + 41.415101140222184561423546256265/exp(1000.0*t) - 70.7*(1/exp(1000.0*t*i))*i)
b=simplify(exp(1000.0*t*i)*(70.7*i + 70.7) + (1/exp(1000.0*t*i))*(70.7 - 70.7*i))
I got result quickly, but in m file gui program stop by "a" command and program does not nothing for 2 minutes, no error...like bussy...after 2 minutes I got result...why so long in gui?
Thank you , it works
Excellent. What was/is the issue with the GUI performance? How did you get it resolved?
I used simplify.....but I can not set number of steps or 'Criterion', 'preferReal'...I have matlab R2011a ....this is maybe problem.
I wrote, that calculation takes long time......but only first time....next time calculation is much faster...I do not know why? Some of result of calculation are storem in RAM memory or whay?
Thank you
I use Matlab version 2011a. If I set steps of simplify, than I get error:
syms t
res = 0.707*exp(1000.0*t*i) - 0.41415101140222184561423546256265/exp(1000.0*t) + 0.707*(1/exp(1000.0*t*i));
simp_res = simplify(res, 'Criterion', 'preferReal', 'Steps', 100)
??? Error using ==> sym.simplify
Too many input arguments.
Do I need change version of Matlab, or what?
Thank you
Sorry, but for relative little number simplify doesn't help.
In command window I it is OK, I get:
>> r=simplify(ilaplace(-((4280819729186186979044460847261*s^2)/51422017416287688817342786954917203280710495801049370729644032 + (994733177774077628149071673933*s)/50216813883093446110686315385661331328818843555712276103168 - 949357667952072971550917252451/1569275433846670190958947355801916604025588861116008628224)/((3*s + 200)*(s^2 + 98596))))
r =
19981467697883435869/(3970734387895709337413208929317684822969348320657408*exp((200*t)/3)) - (694227838351497933185*cos(314*t))/21177250068777116466203780956360985722503191043506176 - (11693735405742169632973*sin(314*t))/831207065199501821298498402537168689608250248457617408
But in guide I get:
r=simplify(ilaplace(-((4280819729186186979044460847261*s^2)/51422017416287688817342786954917203280710495801049370729644032 + (994733177774077628149071673933*s)/50216813883093446110686315385661331328818843555712276103168 - 949357667952072971550917252451/1569275433846670190958947355801916604025588861116008628224)/((3*s + 200)*(s^2 + 98596))))
r =
3.0679013785265445477520983725365*10^(-35)*dirac(t)
Why? It is sooo bad!
No idea?
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Calculus에 대해 자세히 알아보기
태그
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
