Doubt in solving ODE45

1 回表示 (過去 30 日間)
Susmita Panda
Susmita Panda 2021 年 9 月 20 日
編集済み: Star Strider 2021 年 9 月 20 日
I am trying to solve a differential equation for parameter 'dis' for infinite length of beam which is function of time and space in ode45.I am doubtful about how to consider infinite 'L' in the analysis, as my time is dependent upon v (velocity) and L (length).
I tried solving ode45 as usual taking arbitary L=20 but want to plot 'dis' wrt to space.I need help in plotting.My code has been attached herein.
  2 件のコメント
Jan
Jan 2021 年 9 月 20 日
The code is not visible yet.
Susmita Panda
Susmita Panda 2021 年 9 月 20 日
Sir,please check my code.

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

採用された回答

Star Strider
Star Strider 2021 年 9 月 20 日
編集済み: Star Strider 2021 年 9 月 20 日
It seems that ‘dis’ does not appear anywhere.
L=20;
v=20;%v (m/sec)
T=L/v;
tspan_1=[0:0.001:T];%time range
y0_1=[0;0];%initial conditions
[t1,y1]=ode45(@diffeqn11,tspan_1,y0_1);
figure()
plot(t1, y1(:,1), 'r', 'LineWidth',2)
grid
xlabel('t_1')
ylabel('y_1')
function f= diffeqn11(t,y)
A=250;B=20;C=10;j=1;L=20;v=20;a=0.5;%a=x/L
f=zeros(2,1);
f(1)=y(2);
f(2)=(A*sin(j*pi*v*t/L)-B*y(2)-C*y(1))*sin(j*pi*a);%Dimensional
end
EDIT — (20 Sep 2021 at 19:24)
If you have ‘y’ as a function of space and time, this is a partial differential equation.
Express appropriately as a function of both space and time, and then solve it with the pdepe function, or the partial Differential Equation Toolbox functions.
.

その他の回答 (1 件)

Susmita Panda
Susmita Panda 2021 年 9 月 20 日
Y1 is my "dis" parameter which i need to plot wrt to space

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by