why report error ’ nu = constants ( ) ‘ in Matlab R2012b
Show older comments
*The follow program is to compute the Navier Stokes equations. *
function fem2d_navier_stokes_sparse ( big_cavity )
debugging = 0;
it_max = 5;
quad_num = 7;
res_tol = 0.0001;
nu = constants ( );
fprintf ( 1, '\n' );
fprintf ( 1, 'FEM2D_NAVIER_STOKES_SPARSE\n' );
fprintf ( 1, ' MATLAB version):\n' );
fprintf ( 1, '\n' );
fprintf ( 1, ' This is a special version of FREE_FEM_NAVIER_STOKES\n' );
fprintf ( 1, ' which uses MATLAB sparse matrix storage, factorization,\n' );
fprintf ( 1, ' and solution methods, replacing the general banded approach.\n' );
fprintf ( 1, '\n' );
fprintf ( 1, ' Finite element solution of the \n' );
fprintf ( 1, ' steady incompressible Navier Stokes equations\n' );
fprintf ( 1, ' on a triangulated region in 2 dimensions.\n' );
fprintf ( 1, '\n' );
fprintf ( 1, ' - nu * ( Uxx + Uyy ) + UUx + VUy + dPdx = F1(x,y)\n' );
fprintf ( 1, ' - nu * ( Vxx + Vyy ) + UVx + VVy + dPdy = F2(x,y)\n' );
fprintf ( 1, ' Ux + Vy = F3(x,y).\n' );
fprintf ( 1, '\n' );
fprintf ( 1, ' Boundary conditions:\n' );
fprintf ( 1, '\n' );
fprintf ( 1, ' U(x,y) = U_BC(x,y)\n' );
fprintf ( 1, ' V(x,y) = V_BC(x,y)\n' );
fprintf ( 1, ' P(x,y) = P_BC(x,y)\n' );
fprintf ( 1, '\n' );
fprintf ( 1, ' The finite element method uses Taylor-Hood\n' );
fprintf ( 1, ' triangular elements which are linear for pressure\n' );
fprintf ( 1, ' and quadratic for velocity.\n' );
fprintf ( 1, '\n' );
fprintf ( 1, ' Maximum number of Newton iterations IT_MAX = %d:\n', it_max );
fprintf ( 1, ' Quadrature order = %d\n', quad_num );
fprintf ( 1, ' Kinematic viscosity NU = %f\n', nu );
fprintf ( 1, '\n' );
node_filename = strcat ( big_cavity , '_nodes.txt' );
element_filename = strcat ( big_cavity , '_elements.txt' );
................
*when it run , it report the error as follow: Undefined function or variable 'constants'.
Error in fem2d_navier_stokes_sparse (line 216)
nu = constants ( )
Is there any solution? Thankyou.*
1 Comment
Azzi Abdelmalek
on 16 May 2013
What is
nu = constants ( );
Answers (1)
Azzi Abdelmalek
on 16 May 2013
Edited: Azzi Abdelmalek
on 16 May 2013
Maybe you should assign a value to nu
nu=10 % for example
Categories
Find more on Problem-Based Optimization Setup in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!