21.01.2015 Views

COMSOL Multiphysics™

COMSOL Multiphysics™

COMSOL Multiphysics™

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

femtime<br />

Reassembly” on page 439 in User’s Guide. The corresponding value is a string or a<br />

cell array of strings.<br />

The property Tlist must be a strictly monotone vector of real numbers.<br />

Commonly, the vector consists of a start time and a stop time. If more than two<br />

numbers are given, the intermediate times can be used as output times, or to control<br />

the size of the time-steps (see below). If just a single number is given, it represents<br />

the stop time, and the start time is 0.<br />

The property Tout determines the times that occur in the output. If Tout=tsteps,<br />

then the output contains the time steps actually taken by the solver. If Tout=tlist,<br />

then the output contains interpolated solutions for the times in the Tlist property.<br />

The default is Tout=tsteps, except when the property Tsteps=free and Tlist<br />

has length greater that 2, in which case Tout=tlist.<br />

The property Tsteps controls the selection of time steps. If Tsteps=free, then the<br />

solver selects the time steps according to its own logic, disregarding the<br />

intermediate times in the Tlist vector. If Tsteps=strict, then time steps taken by<br />

the solver contain the times in Tlist. If Tsteps=intermediate, then there are at<br />

least one time step in each interval of the Tlist vector.<br />

For more information about the time-dependent solver; see “The Time-Dependent<br />

Solver” on page 385 in <strong>COMSOL</strong> Multiphysics User’s Guide.<br />

Example<br />

Solve the heat equation<br />

------<br />

∂u<br />

– ∆u<br />

= 0<br />

∂t<br />

on a square geometry -1 ≤ x, y ≤ 1. Choose u(0) = 1 on the disk x 2 +y 2 < 0.4 2 , and<br />

u(0) = 0 otherwise. Use Dirichlet boundary conditions u = 0. Compute the solution<br />

at times linspace(0,0.1,20).<br />

clear fem<br />

fem.geom = square2(2,'pos',[-1 -1])+circ2(0.4);<br />

fem.mesh = meshinit(fem);<br />

fem.shape = 2;<br />

fem.equ.c = 1; fem.equ.da = 1;<br />

fem.bnd.h = 1;<br />

fem.equ.init = {0 1};<br />

fem.xmesh = meshextend(fem);<br />

fem.sol = femtime(fem,'report','on','tlist',linspace(0,0.1,20));<br />

postanim(fem,'u')<br />

170 | CHAPTER 1: COMMAND REFERENCE

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!