Skip to content

Getting Started

dfieser edited this page Aug 21, 2026 · 1 revision

Getting Started

Requirements

  • A recent MATLAB release. The solvers use only base MATLAB (ode15s, standard array operations, interp1, trapz). No additional toolboxes are needed.
  • Any operating system MATLAB supports. All paths in the repository are relative, so no configuration is required.

Install

git clone https://github.com/dfieser/ultrafast-laser-ttm-toolbox.git

Open MATLAB with the repository root as the working directory and add the solver folder to the path:

addpath(genpath('src'))

First run

Run the simplest baseline example:

run('examples/Example_Surface_Point_Baseline.m')

The script builds a config struct for tungsten (10 W average power, 5 MHz repetition rate, 500 fs pulses, 100 um spot) and calls Surface_Point_Solver. You should see per-pulse progress lines like:

Pulse 1/50: Te_peak=2650.7 K, Teq=567.5 K, Tresid=308.6 K  (504 fine + 50 diff steps)
...
Pulse 50/50: Te_peak=2696.5 K, Teq=696.3 K, Tresid=430.2 K  (503 fine + 50 diff steps)
Simulation wall time: 0.41 s

followed by a summary block with peak temperatures, the projected steady state, and the path of the text report written under outputs/Example_Surface_Point/. The run also opens diagnostic plots and returns a results struct in the workspace.

Each progress line reports three temperatures per pulse:

  • Te_peak: peak electron temperature during the pulse
  • Teq: the equilibrated temperature after the electron and lattice baths couple
  • Tresid: the residual surface temperature after inter-pulse thermal diffusion, which becomes the starting temperature of the next pulse

The gap between Tresid and the initial temperature is the heat accumulation the toolbox is built to study.

The recommended progression

  1. examples/Example_Surface_Point_Baseline.m: the fastest 0D pulse-accumulation case.
  2. examples/Example_Depth_Profile_Baseline.m: the main 1D depth-resolved solver. Resolves electron and lattice temperatures through depth and captures the surface temperature inversion (see Model Background).
  3. examples/Example_Radial_Profile_Baseline.m: radial temperature distribution under a Gaussian spot.
  4. examples/Example_Scanning_Beam_Baseline.m: a moving-beam scan. Note this case simulates 36,000 pulses and takes several minutes.
  5. scripts/batch/ runners for parameter sweeps, once single cases behave as expected. See Batch Workflows.

Editing parameters

Each example builds a plain struct and passes it to a solver:

cfg = struct();
cfg.material    = 'W';
cfg.Pavg        = 10;
cfg.spotRadius  = 100e-6;
cfg.f_rep       = 5e6;
cfg.tau_FWHM    = 500e-15;
cfg.simDuration = 50 / cfg.f_rep;
results = Surface_Point_Solver(cfg);

Rules of thumb:

  • All inputs use SI units (meters, seconds, watts, hertz). Initial temperature T0_C is in degrees Celsius.
  • Any field you omit falls back to the default documented in the solver's input section. See Solver Reference for every field.
  • The pulse count is simDuration * f_rep. To simulate N pulses, set cfg.simDuration = N / cfg.f_rep.
  • Set cfg.makePlots = false for scripted runs, and cfg.saveFigures = true to write figures to the output folder.

Verifying your setup

Run the smoke test to exercise all supported solver surfaces with small cases:

run('scripts/Verify_Public_Repo_Smoke.m')

The test asserts the shared result contract on each solver and confirms output files land under outputs/Smoke_Test/.

Next steps

Clone this wiki locally