Question

b. It is convenient to use the following non- dimensional variablesShow that the non-dimensional ODEs are given by dV do dT Vcos dY dT with the initial conditions V(0)-1, φ(0)-d, x(0) = Y(0) =

PART C PLEASE!!! IF YOU KNOW HOW TO CODE MATLAB PLEASE HELP THANK YOU

Write a Matlab/Python script which computes the trajectory of P according to the system of equations (1) and the corresponding (non-dimensional) range for given values of (α,φ,0), varying values of φ 0 Plot the trajectories for 6 values of φ 0 of your choice in the interval 0< φ0 π/2.

Compute the corresponding range reached by each trajectory.

Note: Special attention will be given to the computation of R within a specified tolerance.

b. It is convenient to use the following non- dimensional variables
Show that the non-dimensional ODEs are given by dV do dT Vcos dY dT with the initial conditions V(0)-1, φ(0)-d, x(0) = Y(0) = 0 and parameter α-kt립mg Hence, in non-dimensional form, the study involves only 2 parameters: α and φο, we will fix the value of α to α-1.8, which corresponds to a baseball with speed 100 mph as it leaves the bat c. Write a Matlab/Python script which com putes the trajectory of P according to the sys tem of equations (1) and the corresponding (non- dimensional) range for given values of (a,Po), vary ing values of a-Plot the trajectories for 6 values of a) of your choice in the interval 0
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Function file to solve ODE

funNondimenTraj.m

function fval= funNondimenTraj(T,K)

%% function file for ODEs i.e system of governing eqautions

alpha=1.8;

V=K(1);

phi=K(2);

X=K(3);

Y=K(4);

fval(1,1)=-sin(phi)-alpha*(V^2);

fval(2,1)=-cos(phi)/V;

fval(3,1)=V*cos(phi);

fval(4,1)=V*sin(phi);

end

Script file for solving and plotting Non dimensional number as \Phi 0 varies

runNondimenTraj.m

clc; clear all;

% Six values of Phi0

phi0=[pi/18, pi/9, pi/6, 2*pi/9, 5*pi/18, pi/3];

% plotting as phi0 varies in different subplot

for i=1:6

K0(:,i)=[1; phi0(i); 0; 0];

Tspan=[0 10];

[T,Ksol]=ode45(@(T,K) funNondimenTraj(T,K), Tspan, K0(:,i));

subplot(2,3,i), plot(T,Ksol);

legend({'V','phi','X','Y'});

xlabel('T');ylabel('Non dimensional Parameters');

hold on;

end

shg

% displaying min and max values of V, Phi, X, Y at end value of i

% so change i in for loop for differnet values of phi0

V=Ksol(:,1);

Vmin=min(V);

disp(['min value of V =',num2str(Vmin)]);

Vmax=max(V);

disp(['max value of V =',num2str(Vmax)]);

phi=Ksol(:,2);

phiMin=min(phi);

disp(['min value of phi =',num2str(phiMin)]);

phiMax=max(phi);

disp(['max value of phi =',num2str(phiMax)]);

X=Ksol(:,3);

Xmin=min(X);

disp(['min value of X =',num2str(Xmin)]);

Xmax=max(X);

disp(['max value of X =',num2str(Xmax)]);

Y=Ksol(:,4);

Ymin=min(Y);

disp(['min value of Y =',num2str(Ymin)]);

Ymax=max(Y);

disp(['max value of Y =',num2str(Ymax)]);

% subplot titles

subplot(2,3,1),title('pi/18');

subplot(2,3,2),title('pi/9');

subplot(2,3,3),title('pi/6');

subplot(2,3,4),title('2*pi/9');

subplot(2,3,5),title('5*pi/18');

subplot(2,3,6),title('pi/3');

Graphs

Non dimensional Parameters Non dimensional Parameters Non dimensional Parameters Non dimensional Parameters Non dimensional P

Ranges of Non dimensional numbers When T varies from 0 to 10 at 6 different values of \Phi 0

\Phi 0 \pi /18 \Phi 0 \pi /9 \Phi 0 \pi /6 \Phi 0 2\pi/9 \Phi 0 57/18 \Phi 0 π/3
V

0.5826 to 1

V

0.5349 to 1

V

0.4812 to 1

V

0.4221 to 1

V

0.3538 to 1

V

0.3538 to 1

Phi

-1.5708 to 0.1745

Phi

-1.5708 to 0.3491

Phi

-1.5708 to 0.5236

Phi

-1.5708 to

0.6981

Phi

-1.5708 to 0.8727

Phi

-1.5708 to 0.8727

X 0 to

0.7906

X 0 to

0.7857

X 0 to

0.7578

X 0 to

0.7050

X 0 to

0.6254

X 0 to

0.6254

Y

-6.8760 to 0.0126

Y

-6.7665 to 0.0434

Y

-6.6585 to 0.0844

Y

-6.5558 to 0.1303

Y

-6.4619 to 0.1775

Y

-6.4619 to 0.1775

Add a comment
Know the answer?
Add Answer to:
PART C PLEASE!!! IF YOU KNOW HOW TO CODE MATLAB PLEASE HELP THANK YOU Write a Matlab/Python scrip...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT