Help with Laplace ODE
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
Help solving this laplace ode with
intial condition, my a and b values are
respectively. I have tried solving this Laplace ode without using my a and b values. below is my code.
Any help is massively appreciated! Thank you
syms t y(t) Y(s) Dy0 a b y0
Dy1 = diff(y,t,1);
eqn = laplace(Dy1== a*sinh(a*t));
eqn = subs(eqn, {laplace(y(t), t, s), subs(diff(y(t), t), t, 0), y(0)},{Y(s), 0,0})
cond= y(0)==22;
Ys(s)= simplify(eqn/Y);
yt = ilaplace(Ys,s,t)
채택된 답변
Star Strider
2021년 5월 4일
1 개 추천
Try this —
syms t y(t) Y(s) Dy0 a b y0
Dy1 = diff(y,t,1);
eqn = laplace(Dy1== a*sinh(a*t))
eqn =

eqn = subs(eqn, {laplace(y(t), t, s), subs(diff(y(t), t), t, 0), y(0)},{Y(s), 0, 22}) % Substitute 'y(0)' Here
eqn =

% cond= y(0)==22;
eqn = isolate(eqn, Y)
eqn =

y(t,a) = ilaplace(rhs(eqn))
y(t, a) =

figure
fplot(y(t,34), [-0.1 0.1]) % Substitute 'a' Here
grid

.
댓글 수: 10
gurjeevan singh
2021년 5월 4일
THANK YOU SO MUCH !
Perfect!
Star Strider
2021년 5월 4일
As always, my pleasure!
gurjeevan singh
2021년 5월 4일
How would I adapt the eqn formula to add another variable, for example:
where;
is the added term.
I tried changing the symbolic functions, but I am missing a term in the second eqn formula (subs). What do I need to do to solve this different ODE laplace ?, using the above solution?
Once again, any help massively appreciated. Thank you for answering my previous question
I would do something like this (the code is essentially the same) —
syms t y(t) Y(s) Dy0 a b y0 beta
Dy1 = diff(y,t,1);
eqn = laplace(Dy1 + beta*y == a*sinh(a*t))
eqn =

eqn = subs(eqn, {laplace(y(t), t, s), subs(diff(y(t), t), t, 0), y(0)},{Y(s), 0, 22}) % Substitute 'y(0)' Here
eqn =

eqn = isolate(eqn, Y)
eqn =

y(t,a,beta) = ilaplace(rhs(eqn))
y(t, a, beta) =

You may be able to simplify that further if you wish, and perhaps using partfrac before ilaplace.
To plot it with fplot, proivide values for both scalar parameters.
gurjeevan singh
2021년 5월 4일
Once again, Thank you so much!
This is helping massively ! Made my day !
Star Strider
2021년 5월 4일
As always, my pleasure!
Sorry to bother again, now, I am trying to solve a laplace 2nd order equation:
To solve this I have slighlty adapted the code, however Im not sure where to put my new limit of Dy(0) (shown in code)
syms t y(t) Y(s) Dy0 a b y0
Dy1 = diff(y,t,1);
Dy2 = diff(y,t,2);
eqn = laplace(Dy2-10*Dy1 +9*y==5*t)
%%%
eqn = subs(eqn, {laplace(y(t), t, s), subs(diff(y(t), t), t, 0)},{Y(s), Dy0});
cond = [y(0)==-1, Dy1(0)==2];
%%%
eqn=isolate(eqn, Y)
y(t) = ilaplace(rhs(eqn))
I need to relate my condition back into the code, how would I do this ?
This code actually solves the 2nd order ODE, but at the end I have to plug in the values
for
and
. Below shows an attempt at finding solving the 2nd order by introducing another subs term. However, this does not work, because I need to define a condition for Dy(0) and theres a paranthesis error in the t,t,),t.
eqn= subs(eqn, {laplace(y(t), t, s), subs (diff(y(t),t,t),t ,0), subs(diff(y(t), t), t, 0), y(0), Dy1(0)},{Y(s), 0, -1});
Also, before I ask again, to solve a 3rd order laplace ODE, I would have to repeat the same added procedural steps for solving a 2nd order ODE?
Any help massively appreciated!
I believe this does what you want —
syms t y(t) Y(s) Dy0 a b y0
Dy1 = diff(y,t,1);
Dy2 = diff(y,t,2);
eqn = laplace(Dy2-10*Dy1 +9*y==5*t)
eqn =

eqn = subs(eqn, {laplace(y(t), t, s), subs(diff(y(t), t), t, 0), y(0)},{Y(s), 2, -1})
eqn =

%%%
eqn=isolate(eqn, Y)
eqn =

y(t) = ilaplace(rhs(eqn))
y(t) =

figure
fplot(y, [0 1])
grid
xlabel('t')
ylabel('y(t)')

Check to be sure the substitutions are correct.
gurjeevan singh
2021년 5월 5일
Thank you so much x10. Made my day again !
massively appreciated, words cant express it !
Star Strider
2021년 5월 5일
As always, my pleasure!
(A Vote would be appreciated!)
추가 답변 (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)
