getting error while plotting graph

i want to plot graph between F and x
F=c*(|v|^n)*sgn(v)
and v is derivative of x w.r.t time
|v| is magnitude of v
here v is velocity, x is displacement
c is a constant and can be assumed 1
n ranges [0,2]
when i am plotting the graph is coming out wrong

1 件のコメント

Sam Chak
Sam Chak 2023 年 8 月 27 日
Please click on this icon and insert the code that is used to plot the graph. Also describe the expected trajectory to be observed on the graph.

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

回答 (1 件)

Sam Chak
Sam Chak 2023 年 8 月 27 日
編集済み: Sam Chak 2023 年 8 月 27 日

0 投票

Update: I have established the relationship between displacement and velocity using trigonometric functions, specifically sine and cosine, since .
t = linspace(0, 1, 10001);
x = sin(2*pi*t); % displacement
v = cos(2*pi*t); % rate of displacement
c = 1;
n = 0:0.25:2;
for j = 1:length(n)
F = c*(abs(v).^n(j)).*sign(v);
plot(x, F), hold on, grid on, xlabel('x'), ylabel('F');
end
hold off
Previously: No information about the displacement, x, has been provided. If you provide x, I will revise the answer. Alternatively, I can also provide a simple motion system example if you wish. The absolute surd function (a.k.a. Absurd fcn) is plotted below:
vv = linspace(-1, 1, 20001);
cc = 1;
nn = 0.25;
FF = cc*(abs(vv).^nn).*sign(vv);
plot(vv, FF), grid on
xlabel('v'), ylabel('F')

3 件のコメント

Puneet
Puneet 2023 年 8 月 27 日

This is expected graph

Sam Chak
Sam Chak 2023 年 8 月 27 日
Please show the equation(s) of these plots.
Sam Chak
Sam Chak 2023 年 8 月 27 日
Hi @Puneet, I have updated my Answer above to show the expected plots. Take your time to learn and tune the sinusoidal parameters.

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

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

2023 年 8 月 27 日

コメント済み:

2023 年 8 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by