Write a program to calculate the derivative of an arbitrary input function with
ID: 3649982 • Letter: W
Question
Write a program to calculate the derivative of an arbitrary input function with arbitrary duration and arbitrary limits. Remember to check that you start calculating at least at the second point of data. Test your program on a simulated time-domain signal.Explanation / Answer
public: virtual Double __gc* cubicSpline2ndDifferential(Double __gc* tabPoints __gc [], Double __gc* funcVals __gc [], Double __gc* dervAt0X, Double __gc* dervAtN) __gc [] { Double __gc* place; Double __gc* holder; Int32 __gc* num = Math::Min(tabPoints->Length, funcVals->Length); Double __gc* helpArray __gc [] = __gc new Double __gc*[num]; Double __gc* returnArray __gc [] = __gc new Double __gc*[num]; if (dervAt0X> 9.9E+29) { returnArray[0] = helpArray[0] = 0; } else { returnArray[0] = -0.5; helpArray[0] = ((3 / (tabPoints[1] - tabPoints[0])) * (((funcVals[1] - funcVals[0]) / (tabPoints[1] - tabPoints[0])) - dervAt0X)); } for (Int32 __gc* i = 1; (i 9.9E+29) { place = holder = 0; } else { place = 0.5; holder = ((3 / (tabPoints[(num - 1)] - tabPoints[(num - 2)])) * (dervAtN - ((funcVals[(num - 1)] - funcVals[(num - 2)]) / (tabPoints[(num - 1)] - tabPoints[(num - 2)])))); } returnArray[(num - 1)] = ((holder - (place * helpArray[(num - 2)])) / ((place * returnArray[(num - 2)]) + 1)); for (Int32 __gc* j = (num - 2); (j>= 0); j--) { returnArray[j] = ((returnArray[j] * returnArray[(j + 1)]) + helpArray[j]); } return returnArray;Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.