ํ•„ํ„ฐ ์ง€์šฐ๊ธฐ
ํ•„ํ„ฐ ์ง€์šฐ๊ธฐ

Work done by vectors

์กฐํšŒ ์ˆ˜: 5 (์ตœ๊ทผ 30์ผ)
Srikar Kalivarapu
Srikar Kalivarapu 2016๋…„ 11์›” 16์ผ
๋Œ“๊ธ€: Jack Nguyen 2022๋…„ 5์›” 18์ผ
clc
clear all
close all
syms x y z t
F=input('Enter the force components in cartesian co ordinates: ');
C=input('Enter the parametric form of curve C(t): ');
L=input('Enter the limits of parameter L: ');
T=linspace(L(1),L(2),101);
X=(subs(C(1),t,T));%x-coponent of c(t)
Y=(subs(C(2),t,T));%y-component of c(t)
xL=[min(X)-0.2,max(X)+0.2];%setting up x-limits for plotting purrpose
yL=[min(Y)-0.2,max(Y)+0.2];%setting up y-limits for plotting purrpose
if numel(F) ==2
FF=subs(F,{x,y},C);%calculating F(C(t)) for use in line integral
vect2D(F,xL,yL);hold on;%calling vect2D function to draw vector field
plot(X,Y,'-r','LineWidth',2)%plotting the curve C
elseif numel(F)==3
FF=subs(F,{x,y,z},C);
Z=(subs(C(2),t,T));
zL=[min(Z)-0.2,max(Z)+0.2];%setting up z-limits for plotting purrpose
vect3D(F,xL,yL,zL);hold on;%calling vect3D function to draw vector field
plot3(X,Y,Z,'-r','LineWidth',2);%plotting the curve C
else
disp('Function entered is not 2D or 3D vwctor field');
return
end
axis on;
xlabel('x')
ylabel('y')
zlabel('z')
intgrnd=inline(vectorize(dot(FF,diff(C,t))),'t');
WD=quad(intgrnd,L(1),L(2));
disp(['the work done by the force field is: ',num2str(WD)]);
%please find me appropriate inputs and modify code if necessary

๋‹ต๋ณ€ (2๊ฐœ)

Rudransh Dewan
Rudransh Dewan 2022๋…„ 1์›” 7์ผ
clc
clear all
close all
syms x y z t
F=input('Enter the force components in cartesian co ordinates: ');
C=input('Enter the parametric form of curve C(t): ');
L=input('Enter the limits of parameter L: ');
T=linspace(L(1),L(2),101);
X=(subs(C(1),t,T));%x-coponent of c(t)
Y=(subs(C(2),t,T));%y-component of c(t)
xL=[min(X)-0.2,max(X)+0.2];%setting up x-limits for plotting purrpose
yL=[min(Y)-0.2,max(Y)+0.2];%setting up y-limits for plotting purrpose
if numel(F) ==2
FF=subs(F,{x,y},C);%calculating F(C(t)) for use in line integral
vect2D(F,xL,yL);hold on;%calling vect2D function to draw vector field
plot(X,Y,'-r','LineWidth',2)%plotting the curve C
elseif numel(F)==3
FF=subs(F,{x,y,z},C);
Z=(subs(C(2),t,T));
zL=[min(Z)-0.2,max(Z)+0.2];%setting up z-limits for plotting purrpose
vect3D(F,xL,yL,zL);hold on;%calling vect3D function to draw vector field
plot3(X,Y,Z,'-r','LineWidth',2);%plotting the curve C
else
disp('Function entered is not 2D or 3D vwctor field');
return
end
axis on;
xlabel('x')
ylabel('y')
zlabel('z')
intgrnd=inline(vectorize(dot(FF,diff(C,t))),'t');
WD=quad(intgrnd,L(1),L(2));
disp(['the work done by the force field is: ',num2str(WD)]);
  ๋Œ“๊ธ€ ์ˆ˜: 1
Jack Nguyen
Jack Nguyen 2022๋…„ 5์›” 18์ผ
please tell me. How to enter the force field in cartisean form?

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.


Sanjana Chhabra
Sanjana Chhabra 2022๋…„ 1์›” 9์ผ
Find the work done for the force ๐นโƒ—(x,y,z)= yz๐‘–โƒ—+ xz ๐‘—โƒ—+ (xy+2z) ๐‘˜โƒ—โƒ—along the line segment from (1,0,-2) to (4,6,3).
  ๋Œ“๊ธ€ ์ˆ˜: 1
PREM DIYU
PREM DIYU 2022๋…„ 1์›” 9์ผ
How to enter the force field in cartisean form? please tell me

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

์นดํ…Œ๊ณ ๋ฆฌ

Help Center ๋ฐ File Exchange์—์„œ Surface and Mesh Plots์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

ํƒœ๊ทธ

Community Treasure Hunt

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

Start Hunting!

Translated by