Question: dx dt 2. Write a C program that calculates the discrete values x[n] of = f(x(t),u(t)) equation by using F1 = T f (x(t), u(t))

 dx dt 2. Write a C program that calculates the discrete

dx dt 2. Write a C program that calculates the discrete values x[n] of = f(x(t),u(t)) equation by using F1 = T f (x(t), u(t)) F2 = T,f(x(t) + F1,u(t) +) F3 = T,f (x(t) + 4 F2, u(t) +) F4 = Tif(x(t) +T,F3, u(t) +T) x[n + 1] = x[n] + (F1 + 2F2 + 2F3 + F4) equation with Ts = 0.01 seconds and x[0] = 1. The function part is given as f(x,u) = -sin (exp(-x)) + 2u then the input function is u(t) = sin(2mt/100). n=0 starts from zero then will be maximum n=100 which means that 10 seconds total period (t = nts). It is compulsory to define a user defined function to calculate function values of f(x,y). Define arrays for t, F1, F2, F3, F4, u[n], x[n] values but print on t, u[n], x[n] at the same on the screen. C:\Users\IDU\Desktop\Ques2.exe t = 0.000000, u[0]=0.000000 x[0]=1.000000 t = 0.010000, u[1]=0.000628 x[1]=0.996504 t = 0.020000, u[2]=8.001257 [2]=0.993008 t = 0.030000, u[3]=0.801885 x[3]=0.989512 t = 0.840000, u[4]=6.902513 x[4]=0.986017 t = 0.050000, u[5]=0.003141 x[5]=6.982523 t = 0.060000, 0[6]=0.003770 x[6]=0.979029 t = 0.070900, u[7]=0.894398 x[7]=0.975535 t = 0.080000, u[8]=0.005026 x[8]=0.972042 t = 0.098000, u[9]=0.005655 x[9]=0.968549 t = 0.100000, u[10]=0.986283 x[10]=0.965056 t = 0.110090, u[11]=0.986911 x[11]=0.961564 t = 0.120000, u[12]=0.007548 x[12]=6.958871 t = 0.130000, u[13]=0.008168 x[13]=0.954579 t = 0.140000, u[14] =0.008796 x[14]=6.951087 t = 0.150000, u[15]=0.009424 x[15]=0.947595 t = 0.160000, [16]=0.010053 x[16] -0.944103 t = 0.170000, u[17]=0.010681 x[17]=6.940611 t = 0.189000, u[18]=0.011389 x[18]=8.937119 t = 0.199000, u[19]=0.011937 x[19]=6.933627 t = 0.209000, u[20]=0.012566 x [20]=0.930135

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 Databases Questions!