This LED lighting example demonstrates the value of simulating both the electrical and thermal aspects of power dissipating circuits together, simultaneously. This is a "Live, Tunable" design, which means the user can modify many of the design parameters (those highlighted in blue), and then simply re-run the simulation to see the resulting performance changes.
The upper part of the schematic (with black "wires") shows the electrical aspects of the circuit. This includes the AC input with transformer voltage step-down, a full-wave diode bridge rectifier, and an adjustable linear regulator with a variable feedback resistor to provide a voltage proportional to the LED string current. Also, because the regulator current capability is too low to drive the LEDs at full brightness, a PNP bypass transistor is used to supply part of the load current.
The lower part of the schematic (with red "wires") shows the thermal aspects of the design. For the specific electronic devices, including the transistor, regulator and LEDs, the manufacture's datasheet provided not only the electrical characteristics for that part number, but also the junction-to-case "_jc_" thermal resistance. So those values are fixed. However, the user can modify the case-to-enclosure "_ce_" thermal resistances as part of the thermal design "tuning" process, as well as the enclosure-to-outside ambient thermal resistance.
One interesting and perhaps counter-intuitive characteristic of this design is that the regulator temperature has a higher value when the LEDs are dimmed, rather than operating a full brightness. This is due to load sharing with the transistor. At higher LED currents, the voltage across the "r_bypass" resistor increases, which turns on the PNP transistor. But this voltage increase also reduces the effective voltage drop across the regulator (see the light blue and magenta waveforms), and thereby reduces its power dissipation! You can try changing r_bypass and see its effect on the regulator and PNP transistor temperatures (orange and red waveforms, respectively). You can also vary many of the circuit operating conditions, such as the AC input voltage and frequency, the outside ambient temperature, and the LED current set-points using the variable sense resistor's "initial" and "pulse" settings.