Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have not taken a physics class and have no experience programming, so I am not

ID: 3566811 • Letter: I

Question

I have not taken a physics class and have no experience programming, so I am not understanding this very well...any help would be appreciated!

Homework:

We will return to the state method of solving the ballistic projectile problem with added twists. The goal will be to hit a target 1000 meters east of your cannon but the wind is blowing from the south. Your initial muzzle velocity is fixed at 110 meters per second, but you can control the elevation and azimuth angles of your aim. Elevation angle is measured up or down. Azimuth angle is measured right or left. Use positive x for east, positive y for north, and positive z for up.

For HW#7 you must use an iterative solution with a time increment of .001 seconds. Even if you could derive an exact solution for the position of the projectile at any instant in time, you may not use it.

You must use arrays to store the x, y, and z components of position, velocity, and acceleration. You must use functions to update the position and velocity arrays and output the current x, y, z position of the projectile after each time increment. You will terminate the iteration when the projectile hits the ground and calculate the horizontal distance from the impact point to the actual target. The closest shot wins bonus points.

Your working variables will be limited to a constant time-increment, aiming inputs and three arrays; position, velocity, and acceleration. Each array will contain 3 elements representing x, y, and z components.

Function prototypes

Void UpdatePosistion(double pos[], double vel[], const double timeInc);

Void UpdateVelocity(double vel[], const double acc[], const double timeInc);

Void OutputPosition(double pos[]);

Variables

const double timeInc = .001 // unit s

const double initialVelocity = 110; // units m/s

const double target[3] = { 1000, 0, 0}; // units m

const double acc[3] = { 0, .5, -9.81}; // units m/s2

double azimuth, elevation, time;

double pos[3], vel[3];

Explanation / Answer

#include<stdio.h>

#include<conio.h>

Void UpdatePosistion(double pos[], double vel[], const double timeInc);

Void UpdateVelocity(double vel[], const double acc[], const double timeInc);

Void OutputPosition(double pos[]);

void UpdatePosistion(double pos[], double vel[], const double timeInc)

{

int up;

up=pos[]+vel[]+timelnc;

return up;

}

void UpdateVelocity(double vel[], const double acc[], const double timeInc)

{

int vel1;

vel1=vel[]+acc[]+timelnc;

return vel1;

}

void OutputPosition(double pos[])

{

int pos1;

if(pos===pos1)

{

printf("update the position");

}

else

{

printf("not updated position");

}

return pos1;

}

void main()

{

const double timeInc = .001;

const double initialVelocity = 110;

const double target[3] = { 1000, 0, 0};

const double acc[3] = { 0, .5, -9.81};

double azimuth, elevation, time;

double pos[3], vel[3],acc[3];

printf("Enter the value of pos and vel and acc");

scanf("%f %f %f",pos[],vel[],acc[]);

position=updateposition(up);

printf("The update position is %d",up);

velocity=updatevelocity(vel);

printf("The updated velocity is %d",vel);

position1=updatepostion(pos);

printf("The updated position is %d",pos);

}