顯示具有 HowTo 標籤的文章。 顯示所有文章
顯示具有 HowTo 標籤的文章。 顯示所有文章

2011/03/31

How to install Cantera?

 

Note: remember to change the file access permission if you have a problem like:

************************************************
                Cantera Error!                 
************************************************


Procedure: ct2ctml
Error:   could not convert input file to CTML.

 

=== repost from http://web.mit.edu/2.62/www/cantera/install.html ===

Installing Cantera for Windows

  1. Install Python
    • Go to python.org.
    • 32-bit: Download the most recent "Windows installer" for Python 2.6.
    • 64-bit: Download the most recent "Windows X86-64 installer" for Python 2.6.
    • Run the installer. The default installation options should be fine.
  2. Install NumPy
  3. Install Cantera
  4. Configure Matlab (optional)
    • Launch Matlab
    • Go to File-<Set Path...
    • Select Add with Subfolders
    • Browse to the folder c:\Program Files\Cantera\MATLAB\toolbox\cantera
    • Select Save, then Close.
  5. Set the environment variable PYTHON_CMD
    • This step is not necessary if you are using only the Python module.
    • Right-click My Computer, select Properties
    • Go to the Advanced tab.
    • Select Environment Variables.
    • Add a New variable with PYTHON_CMD as the name and the full path to the Python executable (e.g. c:\python26\python.exe) as the value.
  6. Create the nasa_gas.xml file
    • Option 0: At a Python prompt, type:
      import Cantera, os
      os.chdir('c:/Program Files/cantera/data')
      Cantera.Solution('nasa_gas.cti')



    • Option 1: At the Matlab prompt, type:
      cd 'c:\Program Files\cantera\data'
      Solution('nasa_gas.cti')



    • This will give an error (Procedure: xml_findByName; Error: name phase not found), but it should produce the file nasa_gas.xml in the current directory.


    • This allows you to use any of the species specified in nasa_gas.cti in any of your .cti files.




  7. Test the installation

    • Python:
      import Cantera
      gas = Cantera.IdealGasMix('gri30.cti')
      h2o = Cantera.importPhase('liquidvapor.cti','water')



    • Matlab:
      gas = IdealGasMix('gri30.cti')
      h2o = importPhase('liquidvapor.cti','water')





  8. Install Sundials (optional)

    • This step is necessary only to build and link C/C++ programs that use the Sundials integrators CVODE and IDA.


    • 32-bit Download sundials-2.4.0-x86.zip


    • 64-bit Download sundials-2.4.0-amd64.zip


    • Extract the contents of the ZIP file to the Cantera installation directory, e.g. C:\Program Files\Cantera, merging the contents of the lib and include subdirectories.



2010/04/05

How to run script in batch mode or background

 

comsol matlab -ml -nodesktop -ml -nosplash -mlr "myscript, exit"

Note: add a line at the beginning of the script

flreport('off')

in background

nohup comsol matlab –ml –nodesktop –ml –nosplash < myscript.m >& nohup.log &

2009/11/02

How to UNLOCK Your cellphone with an unlock code

 

 

This is the best deal I can find on the internet.

http://www.mobileincanada.com/?l=en&u=all&coupon=school

 

image

Now I am still waiting for the unlock code. 

I got the unlock code and it does work~  That’s great~

2009/07/28

How to run m-function on linux in the background

 

nohup matlab < test.m > output.log &

If you don’t need the output, change “output.log” instead of /dev/null.

2009/07/27

How to use more than 2G memory in MATLAB

 

Memory Support and Windows Operating Systems

boot.ini

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINNT="????" /3GB

2009/07/02

How to number equations

 

I know Mathtype can do that, but I can't afford it.  So, I went to official website of Microsoft to see if there is a solution for that.

http://blogs.msdn.com/microsoft_office_word/archive/2006/10/20/equation-numbering.aspx

This one is better than none.

2009/02/28

Three columns template

 

Three Columns Denim Template

This blogger describes how to change the blogger template "Denim template" to 3 columns template very clearly.

2009/02/03

Tips for HD film on Youtube


Just append this string " &amp;ap=%2526fmt%3D22; " to the embed URLs, and then people can watch High Definition film.

2008/11/29

How to use MATLAB and COMSOL on the cluster

You can launch COMSOL or MATLAB on the cluster from everywhere as long as you can access internet.
Open cygwin and keyin:


ssh -X11 yourCCID@masternode.eche.ualberta.ca
qsub -l nodes=1,walltime=20:00:00 -I

image

Remember the number of the node, in this case node14.

Open the other cygwin and start XWin by using "startx"

ssh -Y CCID@masternode.eche.ualberta.ca
ssh nodeN

 

image

image image