I\'m supposed to do the Java AND C versions of this program showing the graphic
ID: 3882465 • Letter: I
Question
I'm supposed to do the Java AND C versions of this program showing the graphic it generates, and invert the graphic
once again JAVA and C versions. they should work
A pseudocode for this might look something like itialize x, V, and A for n values of each for (tetfinal dvdtd2Adx2 for all i not on boundary dat = 0 on A = A + V*dt for all i V = V + dVdt*dt for all i out put end for A simple implementation in MATLAB could be written as clear all close all clc n=100; xlinspace (o, 10,n V = 0.0*x; A = exp (-(x-5.0).*2) d/dt = 0.0*x; dxsquared dx*dx; nt= 1000 tgrid = linspace (0, 10, nt); dt tgrid ( 2 )-tgrid (1); for t tgrid for i 2:n-1 = dat (i) = (A(1+1)+A (1-1)-2.0*A (i))/dxsquared; end A = A + V* dt; plot (x, A) pause (0.0001) endExplanation / Answer
For solving this in Java we must know how to solve simple differentiation in java
Now for the Question to be answered in detail,Conditions for A must be clearly mentioned. Then After finding the Differential it should be squared.