Hello I wrote this program but it's not working properly.

The value of xv1 and xp1 is given I want to use those values to work out the values of xp2...xp100 and xv2...xv100. The program is meant to use the value of xp and xv to figure out which formula to use. After doing that it is meant to workout "a" using the values derived from the formula. After determining the value of "a" it uses another formula to workout the next xp and xv. It is meant to repeat this process 100 times. I need help badly with this please somebody help me with this program.

Code:
#include <stdio.h>
#include <math.h>

#define CALCULATIONSXp 100
#define CALCULATIONSXv 100

int main()
{
	//float x1=-0.12; // xp
	//float x2=-0.3; // xv
	float xp[CALCULATIONSXp];
	float xv[CALCULATIONSXv];
	float xp[0]=-0.12;
	float xv[0]=-0.3;
	float ypNS;
	float ypNM;
	float ypNS2;
	float ypZE;
	float ypZE2;
	float ypPS;
	float ypPS2;
	float ypPM;
	float yvNS;
	float yvNM;
	float yvNS2;
	float yvZE;
	float yvZE2;
	float yvPS;
	float yvPS2;
	float yvPM;
//	float y1;
//	float state1;
//	float stateX2;
	float a;
	float a1=0.0455;
	float a2=0.9091;
	float b1=0.6667;
	float b2=0.0455;
	float T=0.02;
	float g=9.8;
//	float x1=-0.12;
//	float x2=-0.3;
//	float F=5.87804878;
//	float x2k;
//	float x1k;
	int i;
	int j;
	int k;

	for(i=0; i<=100;i++)
{
	// Information on graph x1

	if((xp >=-0.2) && (xp <= -0.1))
	{
		ypNS=10*xp+2;

		ypNM=-10*xp-1;
	}

	if((xp>=-0.1) && (xp <= 0))
	{
		ypNS2=-10*xp;

		ypZE=10*xp+1;
	}

	
	if((xp>=0) && (xp <= 0.1))
	{
		ypZE2=-10*xp+1;

		ypPS=10*xp;
	}

	if((xp>=0.1) && (xp <= 0.2))
	{
		ypPS2=-10*xp+2;

		ypPM=10*xp-1;
	}

	// Information on graph x2

	if((xv >=-1) && (xv <= -0.5))
	{
		yvNS=2*xv+2;

		yvNM=-2*xv-1;
	}

	if((xv>=-0.5) && (xv <= 0))
	{
		yvNS2=-10*xv;

		yvZE=2*xv+1;
	}

	
	if((xv >=0) && (xv <= 0.5))
	{
		yvZE2=-10*xv+1;

		yvPS=10*xv;
	}

	if((xv>=0.5) && (xv <= 1))
	{
		yvPS2=-2*xv+2;

		yvPM=2*xv-1;
	}

	if(((xp >=-0.2) && (xp <= -0.1)) && ((xv >=-1) && (xv <= -0.5)))
	{
		a=((ypNS*yvNS*10)+(ypNS*yvNM*10)+(ypNM*yvNM*10)+(ypNM*yvNS*10))/((ypNS*yvNS)+(ypNS*yvNM)+(ypNM*yvNM)+(ypNM*yvNS));
	}

	else if(((xp >=-0.2) && (xp <= -0.1)) && ((xv>=-0.5) && (xv <= 0)))
	{
		a=((ypNS*yvNS2*10)+(ypNS*yvZE*5)+(ypNM*yvZE*10)+(ypNM*yvNS2*10))/((ypNS*yvNS2)+(ypNS*yvZE)+(ypNM*yvZE)+(ypNM*yvNS2));
	}

	else if(((xp >=-0.2) && (xp <= -0.1)) && ((xv >=0) && (xv <= 0.5)))
	{
		a=((ypNS*yvPS*0)+(ypNS*yvZE2*5)+(ypNM*yvZE2*10)+(ypNM*yvPS*5))/((ypNS*yvPS)+(ypNS*yvZE2)+(ypNM*yvZE2)+(ypNM*yvPS));
	}

	else if(((xp >=-0.2) && (xp <= -0.1)) && ((xv>=0.5) && (xv <= 1)))

	{
		a=((ypNS*yvPS2*0)+(ypNS*yvPM*-5)+(ypNM*yvPM*0)+(ypNM*yvPS2*5))/((ypNS*yvPS2)+(ypNS*yvPM)+(ypNM*yvPM)+(ypNM*yvPS2));
	}

	if(((xp>=-0.1) && (xp <= 0)) && ((xv >=-1) && (xv <= -0.5)))
	{
		a=((ypNS2*yvNM*10)+(ypNS2*yvNS*10)+(ypZE*yvNM*10)+(ypZE*yvNS*5))/((ypNS2*yvNM)+(ypNS2*yvNS)+(ypZE*yvNM)+(ypZE*yvNM));
	}

	else if(((xp>=-0.1) && (xp <= 0)) &&  ((xv>=-0.5) && (xv <= 0)))
	{
		a=((ypNS2*yvNS2*10)+(ypNS2*yvZE*5)+(ypZE*yvNS2*5)+(ypZE*yvZE*0))/((ypNS2*yvNS2)+(ypNS2*yvZE)+(ypZE*yvNS2)+(ypZE*yvZE));
	}

	else if(((xp>=-0.1) && (xp <= 0)) &&  ((xv >=0) && (xv <= 0.5)))
	{
		a=((ypNS2*yvZE2*5)+(ypNS2*yvPS*0)+(ypZE*yvZE2*0)+(ypZE*yvPS*-5))/((ypNS2*yvZE2)+(ypNS2*yvPS)+(ypZE*yvZE2)+(ypZE*yvPS));
	}

	else if(((xp >=-0.2) && (xp <= -0.1)) && ((xv>=0.5) && (xv <= 1)))
	{
		a=((ypNS2*yvPS2*0)+(ypNS2*yvPM*-5)+(ypZE*yvPS2*-5)+(ypZE*yvPM*-10))/((ypNS2*yvPS2)+(ypNS2*yvPM)+(ypZE*yvPS2)+(ypZE*yvPM));
	}

	if(((xp>=0) && (xp <= 0.1)) && ((xv >=-1) && (xv <= -0.5)))
	{
		a=((ypZE2*yvNM*10)+(ypZE2*yvNS*5)+(ypPS*yvNM*5)+(ypPS*yvNS*0))/((ypZE2*yvNM)+(ypZE2*yvNS)+(ypPS*yvNM)+(ypPS*yvNS));
	}

	else if(((xp>=0) && (xp <= 0.1)) && ((xv>=-0.5) && (xv <= 0)))
	{
		a=((ypZE2*yvNS2*5)+(ypZE2*yvZE*0)+(ypPS*yvNS2*0)+(ypPS*yvZE*-5))/((ypZE2*yvNS2)+(ypZE2*yvZE)+(ypPS*yvNS2)+(ypPS*yvZE));
	}

	else if(((xp>=0) && (xp <= 0.1))  &&  ((xv >=0) && (xv <= 0.5)))
	{
		a=((ypZE2*yvZE2*0)+(ypZE2*yvPS*-5)+(ypPS*yvZE2*-5)+(ypPS*yvPS*-10))/((ypZE2*yvZE2)+(ypZE2*yvPS)+(ypPS*yvZE2)+(ypPS*yvPS));
	}

	else if(((xp>=0) && (xp <= 0.1)) && ((xv>=0.5) && (xv <= 1)))
	{
		a=((ypZE2*yvPS2*-5)+(ypZE2*yvPM*-10)+(ypPS*yvPM*-10)+(ypPS*yvPS2*-10))/((ypZE2*yvPS2)+(ypZE2*yvPM)+(ypPS*yvPM)+(ypPS*yvPS2));
	}

	if(((xp>=0.1) && (xp <= 0.2)) &&  ((xv >=-1) && (xv <= -0.5)))
	{
		a=((ypPS2*yvNM*5)+(ypPS2*yvNS*0)+(ypPM*yvNM*0)+(ypPM*yvNS*-5))/((ypPS2*yvNM)+(ypPS2*yvNS)+(ypPM*yvNM)+(ypPM*yvNS));
	}

	else if(((xp>=0.1) && (xp <= 0.2)) && ((xv>=-0.5) && (xv <= 0)))
	{
		a=((ypPS2*yvNS2*0)+(ypPS2*yvZE*-5)+(ypPM*yvNS2*-5)+(ypPM*yvZE*-10))/((ypPS2*yvNS2)+(ypPS2*yvZE)+(ypPM*yvNS2)+(ypPM*yvZE));
	}

	else if(((xp>=0.1) && (xp <= 0.2)) &&  ((xv >=0) && (xv <= 0.5)))
	{
		a=((ypPS2*yvZE2*-5)+(ypPS2*yvPS*-10)+(ypPM*yvZE2-10)+(ypPM*yvPS-10))/((ypPS2*yvZE2)+(ypPS2*yvPS)+(ypPM*yvZE2)+(ypPM*yvPS));
	}

	else if(((xp>=0.1) && (xp <= 0.2)) && ((xv>=0.5) && (xv <= 1)))
	{
		a=((ypPS2*yvPS2*-10)+(ypPS2*yvPM*-10)+(ypPM*yvPS2*-10)+(ypPM*yvPM*-10))/((ypPS2*yvPS2)+(ypPS2*yvPM)+(ypPM*yvPS2)+(ypPM*yvPM));
	}

	xv[j]= xv[j] + T*(((g*sin(xp[k]) + (cos(xp[k]))*(-a1*pow(xv[j],2)*sin(xp[k])) + a2*a))/(b1 - b2*pow(cos(xp[j]),2)));
	xp[k]= xp[k] + T*xv[j];

	printf("The value of a is %f while xp=%f and xv=%f\n",a,xp,xv);
}

return 0;
}