using limit in differentiation

조회 수: 5 (최근 30일)
mukesh bisht
mukesh bisht 2021년 12월 5일
댓글: Dyuman Joshi 2024년 2월 15일
Hi,
I am calculating differentiation of a function v(t) wrt y which is also function of t i.e y(t) as follows:
syms t
x = 0.7071*t;
y = 0.7071*t - 4.9050*t^2;
v = 0.7071 - 9.81*t;
dv_dy = diff(v,t)/diff(y,t);
t = 0:0.001:1;
res = double(vpa(subs(dv_dy,{t}))); % result
The problem here is the differentiation approaches infinity when the denominator (diff(y,t)) of the term dv_dy approaches zero and it makes my result discontinuos (see fig). But it should be continous. How to correct it?
  댓글 수: 1
Dyuman Joshi
Dyuman Joshi 2024년 2월 15일
"But it should be continous."
Why? Could you show the mathematics to back your claim?
syms t
y = 0.7071*t - 4.9050*t^2;
v = 0.7071 - 9.81*t;
dv_dy = diff(v,t)/diff(y,t)
dv_dy = 
limit(dv_dy, t, 7071/98100, 'left')
ans = 
limit(dv_dy, t, 7071/98100, 'right')
ans = 
fplot(dv_dy, [0 1])
ylim([-14e3 2e3])

댓글을 달려면 로그인하십시오.

답변 (1개)

Saurabh
Saurabh 2024년 2월 15일
편집: Saurabh 2024년 2월 15일
Hi Mukesh,
I tried to reproduce the steps at my end and found out that the expression given by dv_dy will be discontinous at some point of time t, which is very close to 0.0721.
So, the possible work around solution which i can suggest is that you can exclude values of t which are very close to value 0.0721.
For reference I am attaching a code snippet:
syms t
x = 0.7071*t;
y = 0.7071*t - 4.9050*t^2;
v = 0.7071 - 9.81*t;
dv_dy = diff(v,t)/diff(y,t);
t = 0:0.001:1;
lower_bound = 0;
upper_bound = 0.1;
% Create a logical index that is true for values outside the range
index = ~(t >= lower_bound & t <= upper_bound);
% disp(size(t_values))
t = t(index);
% disp(size(t_values))
res = double(vpa(subs(dv_dy,{t}))); % result
plot(t, res);
This is the resultant graph I am getting after executing the code.
I hope this was helpful!!

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by