Integration when some of the values change over time
1 回表示 (過去 30 日間)
古いコメントを表示
I have a function of the form
where
is the position of the k-th object and
is the corresponding force. The force has a functional that is also dependent on
. I want to integrate this with respect to time and output the value for each time point. I think the values
and
would therefore change as a function of time. How do I do this which I imagine would need to be done recursively?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1380599/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1380604/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1380609/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1380604/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1380604/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1380609/image.png)
1 件のコメント
Torsten
2023 年 5 月 11 日
How do you determine xk ? x can be considered as a constant during time integration ?
回答 (1 件)
Sulaymon Eshkabilov
2023 年 5 月 11 日
Simply write a code, e.g.:
t=linspace(0, 5, 200);
F = 5*cos(2*pi*t);
xk = 2*sin(2*pi*5*t);
x = linspace(0,25);
for ii = 1:numel(x)
y(ii) = sum((F.*(x(ii)-xk))/norm(x(ii)-xk));
end
subplot(211)
plot(xk, F)
xlabel('x_k')
ylabel('F_k')
grid on
subplot(212)
plot(x, y)
xlabel('x')
ylabel('y')
grid on
3 件のコメント
参考
カテゴリ
Help Center および File Exchange で Function Creation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!