Question: Learning Outcome: % Please enter your name inside the single quotes in the next line name = ' ' ; % Last Name, First Name

Learning Outcome: % Please enter your name inside the single quotes in the next line
name =''; % Last Name, First Name
nameInfo = isempty(name);
if (nameInfo==1)
disp('Please enter your name in Line 2.');
end;
% Define unknowns and integration variables as symbolic variables
syms c s v; % Unknowns
syms ; % integration variables
nbrSymvar = length(whos);
% Given
a = C*S;
v0=0;
s0=1.5; %[m]
s1=3; %[m]
v1=200;
% Solve
eqn = v * diff(v, s)== a; % Define the equation
v_sol = dsolve(eqn, v(s0)== v0); % Solve the equation
% Display
disp('You should get: The value of constant c is 28853.90 m2.');
fprintf('The value of constant c is %.2f m2.\mp@subsup{n}{}{\prime},c); % Keep the two digit places
fprintf('
');
disp('You should get: The value of constant c is 2.89e+04 m2.');
fprintf('The value of constant c is %.3g m2.\mp@subsup{n}{}{\prime},c); % Keep three significant digits
disp('Did you notice the difference between %f and %g?');
Be able to define symbolic variables;
Be able to represent equations; and
Be able to solve for unknowns.
This assignment is to use MATLAB Symbolic Math Toolbox to find the numerical answer of a straight-line motion using
the chain rule.
If you have trouble completing this assignment, you may check out previous MATLAB assignments as a reference.
Problem Statement: Gas guns are used to investigate the properties of materials subjected to high velocity impacts. A
projectile is accelerated through the barrel of the gun by gas at high pressure. Assume that the acceleration of the
projectile in ms2 is given by a=cs, where s is the position of the projectile in the barrel in meters and c is a constant
that depends on the initial gas pressure behind the projectile. The projectile starts from rest at s=1.5m and
accelerates until it reaches the end of the barrle at s=3m. Determine the value of the constant c necessary for the
projectile to leave the barrel with a velocity of 200ms.
Given: a(s)=csms2,v0=0,s0=1.5m,s1=3m,v1=200ms
Find: cm2s2
% Please enter your name inside the single quotes in the next line
name =''; % Last Name, First Name
nameInfo = isempty(name);
if (nameInfo==1)
disp('Please enter your name in Line 2.');
end;
% Define unknowns and integration variables as symbolic variables
syms c s v; % Unknowns
syms ; % integration variables
nbrSymvar = length(whos);
% Given
a = c*s; %[m/s^2]
v0=0;
s0=1.5; %[m]
s1=3; %[m]
v1=200; %[m/s]
% Solve
eqn = v * diff(v, s)== a; % Define the equation
v_sol = dsolve(eqn, v(s0)== v0); % Solve the equation
% Display
disp('You should get: The value of constant c is 28853.90 m^2/s^2.');
fprintf('The value of constant c is %.2f m^2/s^2.
',c); % Keep the two digit places
fprintf('
');
disp('You should get: The value of constant c is 2.89e+04 m^2/s^2.');
fprintf('The value of constant c is %.3g m^2/s^2.
',c); % Keep three significant digits
disp('Did you notice the difference between %f and %g?');
Learning Outcome: % Please enter your name inside

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!