1
$\begingroup$

enter image description here

I use Mathematica NDSolve to numerically solve V(x,t) and export the numerical values of V(x,t) at each x and t into an external csv file. I find Mathematica only numerically give results with step size of 1 in both x and t. However, I want a finer grid of the numerical results, for example, 0, 0.01, 0.02, … , M in the x-dimension. I tried to add MaxStepSize→0.1 in the NDSolver, but it gives errors and seems not solving finer grid of x in the csv file. NDSolve::ndsz: At t == 95.86748044587323`, step size is effectively zero; singularity or stiff system suspected. >>

My question: what is the correct way to get numerical matrix on V(x,t) on a finer x? The relevant code is in export.nb

enter image description here

$\endgroup$
4
$\begingroup$

You're exporting the data1 table to your spreadsheet, so that's where you'll need to request the additional sample points. Something like this should work:

data1=Table[Evaluate[v[t,x]/.s],{t,0,T},{x,0,M,0.1}]

The fourth argument of the iterator term is the step size, which defaults to 1, so you'll need to make it smaller if you want the intermediate points.

$\endgroup$
  • $\begingroup$ It works! Thanks so much! $\endgroup$ – Wendy Yang Oct 17 '17 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.