Help with Laplace ODE
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
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 日
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
Star Strider
2021 年 5 月 4 日
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!
gurjeevan singh
2021 年 5 月 4 日
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!
Star Strider
2021 年 5 月 4 日
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!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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)
