using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
 

namespace TimeStepGeneration
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            double t, dt, NODES, TMAX,TAU1,tau,TauNODES,TimeNew;
            t = 0;
            
            dt = 0.0001;
            NODES = 40;
            TMAX = 100;
            TauNODES = Math.Log(TMAX);
            TAU1 = Math.Log(dt);
            t = Math.Exp(TAU1); 
            int step=2;
            dt = Math.Exp(TAU1);
            do
            {
                tau = TAU1 + (TauNODES - TAU1) * ((step - 1) / (NODES - 1));
                TimeNew = Math.Exp(tau);
                dt = TimeNew - t;

                t = TimeNew;
                step++;
            }
            while (t <= TMAX);
        }
    }
}