http://optics.eee.nottingham.ac.uk/w/api.php?action=feedcontributions&user=Jethro&feedformat=atomApplied Optics Wiki - User contributions [en]2024-03-28T12:54:54ZUser contributionsMediaWiki 1.27.1http://optics.eee.nottingham.ac.uk/w/index.php?title=SRAS_Technology_Development&diff=2183SRAS Technology Development2015-04-25T15:51:15Z<p>Jethro: /* SRAS Technology Development Project */</p>
<hr />
<div>===SRAS Technology Development Project===<br />
<br />
----<br />
'''PhD student''': [[Jethro Coulson]]<br />
<br />
'''Project Supervisor''': [[Steve Sharples]]<br />
<br />
'''Project Brief''': Developing the [[SRAS for materials characterisation|SRAS]] technique from a lab based instrument to a deployable industrial prototype. This project is an EngD project between the University of Nottingham and Renishaw plc.</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=SRAS_Technology_Development&diff=2182SRAS Technology Development2015-04-25T15:49:20Z<p>Jethro: Created page with "===SRAS Technology Development Project=== ---- '''PhD student''': Jethro Coulson '''Project Supervisor''': Steve Sharples '''Project Brief''': Developing the SRAS tech..."</p>
<hr />
<div>===SRAS Technology Development Project===<br />
<br />
----<br />
'''PhD student''': [[Jethro Coulson]]<br />
<br />
'''Project Supervisor''': [[Steve Sharples]]<br />
<br />
'''Project Brief''': Developing the SRAS technique from a lab based instrument to a deployable industrial prototype. This project is an EngD project between the University of Nottingham and Renishaw plc.</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Jethro_Coulson&diff=2181Jethro Coulson2015-04-25T15:45:35Z<p>Jethro: /* Jethro Coulson */</p>
<hr />
<div>== Jethro Coulson ==<br />
{|class="wikitable" align="right"<br />
|-<br />
|[[Image:jc_pic.jpg|200px]]<br />
|-<br />
|}<br />
----<br />
''Contacts details''<br />
<br />
Location: Renishaw plc, Innovation Centre, Exeter, EX4 4RN<br />
<br />
Phone:+44 (0)1453 523532<br />
<br />
Email: eexjc9 (at) nottingham.ac.uk ''or'' jethro.coulson (at) renishaw.com<br />
<br />
<br />
----</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Jethro_Coulson&diff=2180Jethro Coulson2015-04-25T15:43:50Z<p>Jethro: /* Jethro Coulson */</p>
<hr />
<div>== Jethro Coulson ==<br />
{|class="wikitable" align="right"<br />
|-<br />
|[[Image:jc_pic.jpg|200px]]<br />
|-<br />
|}<br />
----<br />
''Contacts details''<br />
<br />
Location: Renishaw plc, Innovation Centre, Exeter, EX4 4RN<br />
<br />
Phone:+44 (0)1453 523532<br />
<br />
Email: eexjc9@nottingham.ac.uk ''or'' jethro.coulson@renishaw.com<br />
<br />
<br />
----</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Jethro_Coulson&diff=2179Jethro Coulson2015-04-25T15:43:30Z<p>Jethro: </p>
<hr />
<div>== Jethro Coulson ==<br />
{|class="wikitable" align="right"<br />
|-<br />
|[[Image:jc_pic.jpg|200px]]<br />
|-<br />
|}<br />
----<br />
''Contacts details''<br />
<br />
Location: Renishaw plc, Innovation Centre, Exeter, EX4 4RN<br />
<br />
Phone:+44 (0)1453 523532<br />
<br />
Email: eexjc9@nottingham.ac.uk ''or'' jethro.coulson@renishaw.com</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Jethro_Coulson&diff=2178Jethro Coulson2015-04-25T15:33:01Z<p>Jethro: /* Jethro Coulson */</p>
<hr />
<div>== Jethro Coulson ==<br />
{|class="wikitable" align="right"<br />
|-<br />
|[[Image:jc_pic.jpg|200px|thumb]]<br />
|-<br />
|}<br />
----<br />
''Contacts details''<br />
<br />
Location: Renishaw plc, Innovation Centre, Exeter, EX4 4RN<br />
<br />
Phone:+44 (0)1453 523532<br />
<br />
Email: eexjc9@nottingham.ac.uk ''or'' jethro.coulson@renishaw.com</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=File:Jc_pic2.jpg&diff=2177File:Jc pic2.jpg2015-04-25T15:23:55Z<p>Jethro: </p>
<hr />
<div></div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=File:Jc_pic.jpg&diff=2176File:Jc pic.jpg2015-04-25T15:19:55Z<p>Jethro: </p>
<hr />
<div></div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Jethro_Coulson&diff=2175Jethro Coulson2015-04-25T15:17:51Z<p>Jethro: Created page with "== Jethro Coulson == {|class="wikitable" align="right" |- |Image:http://i.imgur.com/zmfmOd2.jpg |- |} ---- ''Contacts details'' Location: Renishaw plc, Innovation Centre, Ex..."</p>
<hr />
<div>== Jethro Coulson ==<br />
{|class="wikitable" align="right"<br />
|-<br />
|[[Image:http://i.imgur.com/zmfmOd2.jpg]]<br />
|-<br />
|}<br />
----<br />
''Contacts details''<br />
<br />
Location: Renishaw plc, Innovation Centre, Exeter, EX4 4RN<br />
<br />
Phone:+44 (0)1453 523532<br />
<br />
Email: eexjc9@nottingham.ac.uk ''or'' jethro.coulson@renishaw.com</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Useful_information&diff=1402Useful information2013-01-24T13:49:02Z<p>Jethro: </p>
<hr />
<div>== AO resources ==<br />
<br />
*[[AO resources]] - Facilities, equipment, instruments, internal expertise. Please add to this list.<br />
*[http://optics.eee.nottingham.ac.uk/order_form/ Order Form Creator], [[Order Form Creator Guidance]], and [http://optics.eee.nottingham.ac.uk/order_form/orders/ Order forms already created] (by [[Steve Sharples | Steve]])<br />
*[[Publications | Applied Optics publications, papers and thesis]]<br />
*[http://tlptweb.eee.nottingham.ac.uk/GoodsIn/ Goods In] and [[Tea breaks]].<br />
<br />
*[http://optics.eee.nottingham.ac.uk/links/logo/ Applied Optics Group Logo]<br />
*[http://optics.eee.nottingham.ac.uk/optics/antiword/ Word to text and pdf converter] (broken).<br />
*[[Laser Safety]] <br />
*[[Printers and printing]]<br />
<br />
== AO local documentation ==<br />
<br />
*[[Linux How-tos]]. Instructions on how to install the current stable version of Linux on your PC and set it up for use in the Applied Optics Group, useful hints, how to set up drivers for hardware in experimental PCs etc.<br />
*[http://vlsi.eee.nottingham.ac.uk/ VLSI Web Pages]. Useful info for VLSI users, set up by Roger Light.<br />
*[http://optics.eee.nottingham.ac.uk/eagle/eagle2pcbtrain.html Eagle PCB -> PCBTrain Export Mini How-To].<br />
*[http://optics.eee.nottingham.ac.uk/eagle/eagle2lpkf_at_eee.html EAGLE PCB Export Page]. How to export EAGLE files for use in CircuitCAM.<br />
*Common network settings<br />
*[http://optics.eee.nottingham.ac.uk/optics/documentation/latex-thesis/latex-thesis.pdf LaTeX thesis template] (PDF). A very short guide on some salient points for using LaTeX to write your thesis. See also the [http://optics.eee.nottingham.ac.uk/optics/documentation/latex-thesis/thesis_template.zip thesis template] (ZIP file).<br />
*[http://optics.eee.nottingham.ac.uk/optics/documentation/o-sam/no_more_flipping.pdf No More Flipping]. Documentation concerning the O-SAM and ARRO-SAM hardware (PDF)<br />
*[http://optics.eee.nottingham.ac.uk/vxi11/ VXI-11 protocol for Linux]. The basis for communicating with most scopes and other instruments over ethernet.<br />
<br />
<br />
== VLSI resources ==<br />
<br />
* Links relevant for [[VLSI]] users.<br />
* [[Vlsi:Chips|Chips]] manufactured to date.<br />
* [[Cadence]] tutorials.<br />
* [[Spartan Starter Pinouts]]<br />
<br />
== Matlab Resources ==<br />
<br />
*[[Comsol-Matlab tutorial]]<br />
*[[Installing_MTEX_for_Matlab]]<br />
<br />
== Other resources ==<br />
<br />
=== Web pages and links ===<br />
<br />
*http://optics.eee.nottingham.ac.uk<br />
*[http://optics.eee.nottingham.ac.uk/jobs/ Applied Optics Job Vacancies]<br />
*[http://www.nottingham.ac.uk/eee/research/applied_optics_intro.php Applied Optics Group "Offical" EEE Webpage]<br />
*[http://babbage.eee.nottingham.ac.uk/ibios/ iBIOS]<br />
*[http://www.nottingham.ac.uk/match/ Multidisciplinary Assessment of Technology Centre for Healthcare (MATCH) Homepage]<br />
*[http://www.nottingham.ac.uk/eee/research/applied_optics_members.php Applied Optics team members]<br />
*[http://www.nottingham.ac.uk/eee/ EEE Homepage]<br />
*[http://www.nottingham.ac.uk/ University of Nottingham Homepage] | [http://my.nottingham.ac.uk/ Portal] | [https://owa.nottingham.ac.uk Outlook web mail access]<br />
*[http://research.nottingham.ac.uk/ UoN Research Pages] | [http://www.nottingham.ac.uk/is/about/news/issue/index.phtml The ISsue] (Information Services eBulletin) | [http://www.nottingham.ac.uk/exchange/ Exchange Magazine] | [http://www.nottingham.ac.uk/bridging/ Bridging the Gaps]<br />
<br />
=== Driver, code and useful bits and bobs ===<br />
[[Drivers and code| Drivers, code and useful bits and bobs]]</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Useful_information&diff=1401Useful information2013-01-24T13:47:46Z<p>Jethro: </p>
<hr />
<div>== AO resources ==<br />
<br />
*[[AO resources]] - Facilities, equipment, instruments, internal expertise. Please add to this list.<br />
*[http://optics.eee.nottingham.ac.uk/order_form/ Order Form Creator], [[Order Form Creator Guidance]], and [http://optics.eee.nottingham.ac.uk/order_form/orders/ Order forms already created] (by [[Steve Sharples | Steve]])<br />
*[[Publications | Applied Optics publications, papers and thesis]]<br />
*[http://tlptweb.eee.nottingham.ac.uk/GoodsIn/ Goods In] and [[Tea breaks]].<br />
<br />
*[http://optics.eee.nottingham.ac.uk/links/logo/ Applied Optics Group Logo]<br />
*[http://optics.eee.nottingham.ac.uk/optics/antiword/ Word to text and pdf converter] (broken).<br />
*[[Laser Safety]] <br />
*[[Printers and printing]]<br />
<br />
== AO local documentation ==<br />
<br />
*[[Linux How-tos]]. Instructions on how to install the current stable version of Linux on your PC and set it up for use in the Applied Optics Group, useful hints, how to set up drivers for hardware in experimental PCs etc.<br />
*[http://vlsi.eee.nottingham.ac.uk/ VLSI Web Pages]. Useful info for VLSI users, set up by Roger Light.<br />
*[http://optics.eee.nottingham.ac.uk/eagle/eagle2pcbtrain.html Eagle PCB -> PCBTrain Export Mini How-To].<br />
*[http://optics.eee.nottingham.ac.uk/eagle/eagle2lpkf_at_eee.html EAGLE PCB Export Page]. How to export EAGLE files for use in CircuitCAM.<br />
*Common network settings<br />
*[http://optics.eee.nottingham.ac.uk/optics/documentation/latex-thesis/latex-thesis.pdf LaTeX thesis template] (PDF). A very short guide on some salient points for using LaTeX to write your thesis. See also the [http://optics.eee.nottingham.ac.uk/optics/documentation/latex-thesis/thesis_template.zip thesis template] (ZIP file).<br />
*[http://optics.eee.nottingham.ac.uk/optics/documentation/o-sam/no_more_flipping.pdf No More Flipping]. Documentation concerning the O-SAM and ARRO-SAM hardware (PDF)<br />
*[http://optics.eee.nottingham.ac.uk/vxi11/ VXI-11 protocol for Linux]. The basis for communicating with most scopes and other instruments over ethernet.<br />
<br />
<br />
== VLSI resources ==<br />
<br />
* Links relevant for [[VLSI]] users.<br />
* [[Vlsi:Chips|Chips]] manufactured to date.<br />
* [[Cadence]] tutorials.<br />
* [[Spartan Starter Pinouts]]<br />
<br />
== Matlab Resources ==<br />
<br />
*[[Comsol-Matlab tutorial]]<br />
<br />
== Other resources ==<br />
<br />
=== Web pages and links ===<br />
<br />
*http://optics.eee.nottingham.ac.uk<br />
*[http://optics.eee.nottingham.ac.uk/jobs/ Applied Optics Job Vacancies]<br />
*[http://www.nottingham.ac.uk/eee/research/applied_optics_intro.php Applied Optics Group "Offical" EEE Webpage]<br />
*[http://babbage.eee.nottingham.ac.uk/ibios/ iBIOS]<br />
*[http://www.nottingham.ac.uk/match/ Multidisciplinary Assessment of Technology Centre for Healthcare (MATCH) Homepage]<br />
*[http://www.nottingham.ac.uk/eee/research/applied_optics_members.php Applied Optics team members]<br />
*[http://www.nottingham.ac.uk/eee/ EEE Homepage]<br />
*[http://www.nottingham.ac.uk/ University of Nottingham Homepage] | [http://my.nottingham.ac.uk/ Portal] | [https://owa.nottingham.ac.uk Outlook web mail access]<br />
*[http://research.nottingham.ac.uk/ UoN Research Pages] | [http://www.nottingham.ac.uk/is/about/news/issue/index.phtml The ISsue] (Information Services eBulletin) | [http://www.nottingham.ac.uk/exchange/ Exchange Magazine] | [http://www.nottingham.ac.uk/bridging/ Bridging the Gaps]<br />
<br />
=== Driver, code and useful bits and bobs ===<br />
[[Drivers and code| Drivers, code and useful bits and bobs]]</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Comsol-Matlab_tutorial&diff=1397Comsol-Matlab tutorial2013-01-07T15:53:58Z<p>Jethro: </p>
<hr />
<div>Below is a guide to using the Comsol-Matlab interface to run models. It is compiled purely from my own work and is based largely on the results of extensive trial and error. Hopefully there are some helpful hints, I thoroughly recommend reading the memory issue section if you intend to do multiple runs of a model.<br />
<br />
===Setting up the software===<br />
<br />
The first step is installing the correct software. You will require a licensed copy of Comsol 3.5a, and a licensed copy of Matlab 2007. Both of these can be installed from the VPM repo. <br />
<br />
A Comsol-Matlab (CM) interface is initialised by running the command ''comsol_35a matlab''. This should start a java instance of Matlab 2007 with Comsol commands enabled. To check the link try the command ''flclear fem'' which will not work in a standard Matlab instance.<br />
<br />
Within the CM interface all Matlab functionality is unchanged. In addition to this a new set of Comsol commands are available, all of which are documented and have standard ''help'' functionality.<br />
<br />
==Building a model==<br />
<br />
There is no particular correct way to build your model in a CM interface, it is not all that intuitive. Personally, I have found that the best way to work with and build models is within a standard Comsol session. Once built a model can easily be manipulated within the CM interface. The internal language used by Comsol is fully compatible with Matlab script, and as you build a model Comsol saves the commands in a Matlab usable format in a file named ''myModel_history.m''. I have uploaded an example script here [[File:JcModel history.txt]].<br />
<br />
===Building your initial script===<br />
<br />
The history file is generally split into three parts; setting up the model, running the model, and post-processing and plotting. If your model has been tweaked, run and saved multiple times then the history file can become quite convoluted and there will be multiple instances of these three parts. Since this file is written chronologically, the most up-to-date version of your model will be at the end and this is the part that should be copied into a new script.<br />
<br />
There are several actions that must be in your script to define the model, most of which will be pulled directly from the history script;<br />
* The ''Comsol version'' blurb, at the very start of the history script.<br />
* The description of the ''Geometry'', also found at the start of the script. This commands for the geometry are not reissued each time you run the model unless changed. You may have to scroll through the model to find the most recent version of the geometry description. This must be followed by the ''Analysed geometry'' commands.<br />
* A ''Constants'' section is next followed by an ''Application mode'' section. Both of these describe the mode in which Comsol runs and the constants it uses.<br />
* Various ''Boundary'' and ''Subdomain'' settings and equations which describe the variables to be kept track of, and any input (heat, pressure etc) to the model along its boundaries or surfaces.<br />
* A ''Library materials'' section which is completely optional.<br />
* A few model initialisation commands.<br />
* A mesh initialisation command.<br />
* A 'run the model' command.<br />
* Post-processing commands.<br />
<br />
===Adding variables===<br />
<br />
One of the main benefits of using the CM interface is the ability to setup automated changes of model variables. This removes the tedious and repetitive need to perform this operation in a Comsol window. <br />
<br />
The CM interface allows standard Matlab commands and variables to be used. Thus, when defining a model, it is straightforward to replace a hard-coded value with a variable. In the uploaded example script, the line<br />
<br />
equ.D = {{1.6360e11,0.9230e11,0.6792e11,0,0,0;0.9230e11, ... <br />
1.6360e11,0.6792e11,0,0,0;0.6792e11,0.6792e11,1.8520e11, ... <br />
0,0,0;0,0,0,0.3565e11,0,0;0,0,0,0,0.4705e11, ... <br />
0;0,0,0,0,0,0.4705e11}};<br />
<br />
is replaced with <br />
<br />
equ.D = elac_const; <br />
<br />
where elac_const is a 6x6 matrix of elastic constants which is altered for each iteration of the model. Note that the elac_const variable must be in the same format as what it is replacing, i.e. a 6x6 cell within a 1x1 cell. Different variables are stored in different ways.<br />
<br />
==Exporting results==<br />
<br />
Once the model has been run the solution is saved to a fem.sol structure and can be manipulated. There are multiple ways and commands to do this. A few of the most useful commands are:<br />
* ''postinterp'' for interpolating results onto a regular grid,<br />
* ''posteval'' for evaluating a solution at a particular point/surface/boundary,<br />
* ''postplot'' for plotting.<br />
All of these commands have reasonable documentation. These commands can be used to save the solution to a variable which is easily saved as a .mat file.<br />
<br />
==Memory issues==<br />
<br />
The CM interface has a particularly irritating problem with memory leakage. If a single model run is performed then there is no problem, however for multiple iterations the previous model is not properly cleared from memory. Thus each iteration fills the memory further until you end up in swap. I have not found a solution to this problem, and only have a work around. Instead of altering a variable and running the model within a for-loop, instead a model can be run in CM batch mode.<br />
<br />
Essentially two scripts are required; a subscript which runs with the CM interface and does all the model related things, and a main script to call the subscript.<br />
The main script is called once and run in a standard Matlab 2011 window. All the main script does is:<br />
* save all of the changing variables to a reference .mat file, <br />
* launch CM to run the model code in batch mode,<br />
* the CM script then loads the reference .mat file and uses the variables saved in it to run the model once, the CM script then exits back to the 2011 Matlab window, <br />
* the main script then loops to the next iteration of the model, with a new set of variables and we start from step one.<br />
<br />
This is not the prettiest solution, but does work well. The code required to run CM in batch mode is;<br />
!comsol_35a matlab -np 4 -ml -nodesktop -ml -nosplash -mlr "SubscriptFile, exit"<br />
The 4 is replaced by however many cores there are available to run the model, and SubscriptFile is replaced by the name of the subscript without the .m extension.<br />
<br />
Feel free to email me with any questions [[User:Jethro|Jethro]] 15:51, 7 January 2013 (GMT)</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Comsol-Matlab_tutorial&diff=1396Comsol-Matlab tutorial2013-01-07T15:51:19Z<p>Jethro: </p>
<hr />
<div>Below is a guide to using the Comsol-Matlab interface to run models. It is compiled purely from my own work and is based largely on the results of extensive trial and error.<br />
<br />
===Setting up the software===<br />
<br />
The first step is installing the correct software. You will require a licensed copy of Comsol 3.5a, and a licensed copy of Matlab 2007. Both of these can be installed from the VPM repo. <br />
<br />
A Comsol-Matlab (CM) interface is initialised by running the command ''comsol_35a matlab''. This should start a java instance of Matlab 2007 with Comsol commands enabled. To check the link try the command ''flclear fem'' which will not work in a standard Matlab instance.<br />
<br />
Within the CM interface all Matlab functionality is unchanged. In addition to this a new set of Comsol commands are available, all of which are documented and have standard ''help'' functionality.<br />
<br />
==Building a model==<br />
<br />
There is no particular correct way to build your model in a CM interface, it is not all that intuitive. Personally, I have found that the best way to work with and build models is within a standard Comsol session. Once built a model can easily be manipulated within the CM interface. The internal language used by Comsol is fully compatible with Matlab script, and as you build a model Comsol saves the commands in a Matlab usable format in a file named ''myModel_history.m''. I have uploaded an example script here [[File:JcModel history.txt]].<br />
<br />
===Building your initial script===<br />
<br />
The history file is generally split into three parts; setting up the model, running the model, and post-processing and plotting. If your model has been tweaked, run and saved multiple times then the history file can become quite convoluted and there will be multiple instances of these three parts. Since this file is written chronologically, the most up-to-date version of your model will be at the end and this is the part that should be copied into a new script.<br />
<br />
There are several actions that must be in your script to define the model, most of which will be pulled directly from the history script;<br />
* The ''Comsol version'' blurb, at the very start of the history script.<br />
* The description of the ''Geometry'', also found at the start of the script. This commands for the geometry are not reissued each time you run the model unless changed. You may have to scroll through the model to find the most recent version of the geometry description. This must be followed by the ''Analysed geometry'' commands.<br />
* A ''Constants'' section is next followed by an ''Application mode'' section. Both of these describe the mode in which Comsol runs and the constants it uses.<br />
* Various ''Boundary'' and ''Subdomain'' settings and equations which describe the variables to be kept track of, and any input (heat, pressure etc) to the model along its boundaries or surfaces.<br />
* A ''Library materials'' section which is completely optional.<br />
* A few model initialisation commands.<br />
* A mesh initialisation command.<br />
* A 'run the model' command.<br />
* Post-processing commands.<br />
<br />
===Adding variables===<br />
<br />
One of the main benefits of using the CM interface is the ability to setup automated changes of model variables. This removes the tedious and repetitive need to perform this operation in a Comsol window. <br />
<br />
The CM interface allows standard Matlab commands and variables to be used. Thus, when defining a model, it is straightforward to replace a hard-coded value with a variable. In the uploaded example script, the line<br />
<br />
equ.D = {{1.6360e11,0.9230e11,0.6792e11,0,0,0;0.9230e11, ... <br />
1.6360e11,0.6792e11,0,0,0;0.6792e11,0.6792e11,1.8520e11, ... <br />
0,0,0;0,0,0,0.3565e11,0,0;0,0,0,0,0.4705e11, ... <br />
0;0,0,0,0,0,0.4705e11}};<br />
<br />
is replaced with <br />
<br />
equ.D = elac_const; <br />
<br />
where elac_const is a 6x6 matrix of elastic constants which is altered for each iteration of the model. Note that the elac_const variable must be in the same format as what it is replacing, i.e. a 6x6 cell within a 1x1 cell. Different variables are stored in different ways.<br />
<br />
===Exporting results===<br />
<br />
Once the model has been run the solution is saved to a fem.sol structure and can be manipulated. There are multiple ways and commands to do this. A few of the most useful commands are:<br />
* ''postinterp'' for interpolating results onto a regular grid,<br />
* ''posteval'' for evaluating a solution at a particular point/surface/boundary,<br />
* ''postplot'' for plotting.<br />
All of these commands have reasonable documentation. These commands can be used to save the solution to a variable which is easily saved as a .mat file.<br />
<br />
===Memory issues===<br />
<br />
The CM interface has a particularly irritating problem with memory leakage. If a single model run is performed then there is no problem, however for multiple iterations the previous model is not properly cleared from memory. Thus each iteration fills the memory further until you end up in swap. I have not found a solution to this problem, and only have a work around. Instead of altering a variable and running the model within a for-loop, instead a model can be run in CM batch mode.<br />
<br />
Essentially two scripts are required; a subscript which runs with the CM interface and does all the model related things, and a main script to call the subscript.<br />
The main script is called once and run in a standard Matlab 2011 window. All the main script does is:<br />
* save all of the changing variables to a reference .mat file, <br />
* launch CM to run the model code in batch mode,<br />
* the CM script then loads the reference .mat file and uses the variables saved in it to run the model once, the CM script then exits back to the 2011 Matlab window, <br />
* the main script then loops to the next iteration of the model, with a new set of variables and we start from step one.<br />
<br />
This is not the prettiest solution, but does work well. The code required to run CM in batch mode is;<br />
!comsol_35a matlab -np 4 -ml -nodesktop -ml -nosplash -mlr "SubscriptFile, exit"<br />
The 4 is replaced by however many cores there are available to run the model, and SubscriptFile is replaced by the name of the subscript without the .m extension.<br />
<br />
Feel free to email me with any questions [[User:Jethro|Jethro]] 15:51, 7 January 2013 (GMT)</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Comsol-Matlab_tutorial&diff=1395Comsol-Matlab tutorial2013-01-07T15:38:00Z<p>Jethro: </p>
<hr />
<div>===Setting up the software===<br />
<br />
The first step is installing the correct software. You will require a licensed copy of Comsol 3.5a, and a licensed copy of Matlab 2007. Both of these can be installed from the VPM repo. <br />
<br />
A Comsol-Matlab (CM) interface is initialised by running the command ''comsol_35a matlab''. This should start a java instance of Matlab 2007 with Comsol commands enabled. To check the link try the command ''flclear fem'' which will not work in a standard Matlab instance.<br />
<br />
Within the CM interface all Matlab functionality is unchanged. In addition to this a new set of Comsol commands are available, all of which are documented and have standard ''help'' functionality.<br />
<br />
==Building a model==<br />
<br />
There is no particular correct way to build your model in a CM interface, it is not all that intuitive. Personally, I have found that the best way to work with and build models is within a standard Comsol session. Once built a model can easily be manipulated within the CM interface. The internal language used by Comsol is fully compatible with Matlab script, and as you build a model Comsol saves the commands in a Matlab usable format in a file named ''myModel_history.m''. I have uploaded an example script here [[File:JcModel history.txt]].<br />
<br />
===Building your initial script===<br />
<br />
The history file is generally split into three parts; setting up the model, running the model, and post-processing and plotting. If your model has been tweaked, run and saved multiple times then the history file can become quite convoluted and there will be multiple instances of these three parts. Since this file is written chronologically, the most up-to-date version of your model will be at the end and this is the part that should be copied into a new script.<br />
<br />
There are several actions that must be in your script to define the model, most of which will be pulled directly from the history script;<br />
* The ''Comsol version'' blurb, at the very start of the history script.<br />
* The description of the ''Geometry'', also found at the start of the script. This commands for the geometry are not reissued each time you run the model unless changed. You may have to scroll through the model to find the most recent version of the geometry description. This must be followed by the ''Analysed geometry'' commands.<br />
* A ''Constants'' section is next followed by an ''Application mode'' section. Both of these describe the mode in which Comsol runs and the constants it uses.<br />
* Various ''Boundary'' and ''Subdomain'' settings and equations which describe the variables to be kept track of, and any input (heat, pressure etc) to the model along its boundaries or surfaces.<br />
* A ''Library materials'' section which is completely optional.<br />
* A few model initialisation commands.<br />
* A mesh initialisation command.<br />
* A 'run the model' command.<br />
* Post-processing commands.<br />
<br />
===Adding variables===<br />
<br />
One of the main benefits of using the CM interface is the ability to setup automated changes of model variables. This removes the tedious and repetitive need to perform this operation in a Comsol window. <br />
<br />
The CM interface allows standard Matlab commands and variables to be used. Thus, when defining a model, it is straightforward to replace a hard-coded value with a variable. In the uploaded example script, the line<br />
<br />
equ.D = {{1.6360e11,0.9230e11,0.6792e11,0,0,0;0.9230e11, ... <br />
1.6360e11,0.6792e11,0,0,0;0.6792e11,0.6792e11,1.8520e11, ... <br />
0,0,0;0,0,0,0.3565e11,0,0;0,0,0,0,0.4705e11, ... <br />
0;0,0,0,0,0,0.4705e11}};<br />
<br />
is replaced with <br />
<br />
equ.D = elac_const; <br />
<br />
where elac_const is a 6x6 matrix of elastic constants which is altered for each iteration of the model. Note that the elac_const variable must be in the same format as what it is replacing, i.e. a 6x6 cell within a 1x1 cell. Different variables are stored in different ways.<br />
<br />
===Memory issues===<br />
<br />
The CM interface has a particularly irritating problem with memory leakage. If a single model run is performed then there is no problem, however for multiple iterations the previous model is not properly cleared from memory. Thus each iteration fills the memory further until you end up in swap. I have not found a solution to this problem, and only have a work around. Instead of altering a variable and running the model within a for-loop, instead a model can be run in CM batch mode.<br />
<br />
Essentially two scripts are required; a subscript which runs with the CM interface and does all the model related things, and a main script to call the subscript.<br />
The main script is called once and run in a standard Matlab 2011 window. All the main script does is:<br />
* save all of the changing variables to a reference .mat file, <br />
* launch CM to run the model code in batch mode,<br />
* the CM script then loads the reference .mat file and uses the variables saved in it to run the model once, the CM script then exits back to the 2011 Matlab window, <br />
* the main script then loops to the next iteration of the model, with a new set of variables and we start from step one.<br />
<br />
This is not the prettiest solution, but does work well. The code required to run CM in batch mode is;<br />
!comsol_35a matlab -np 4 -ml -nodesktop -ml -nosplash -mlr "SubscriptFile, exit"<br />
The 4 is replaced by however many cores there are available to run the code, and SubscriptFile is replaced by the name of the subscript without the .m extension.</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Comsol-Matlab_tutorial&diff=1394Comsol-Matlab tutorial2013-01-07T15:35:04Z<p>Jethro: </p>
<hr />
<div>===Setting up the software===<br />
<br />
The first step is installing the correct software. You will require a licensed copy of Comsol 3.5a, and a licensed copy of Matlab 2007. Both of these can be installed from the VPM repo. <br />
<br />
A Comsol-Matlab (CM) interface is initialised by running the command ''comsol_35a matlab''. This should start a java instance of Matlab 2007 with Comsol commands enabled. To check the link try the command ''flclear fem'' which will not work in a standard Matlab instance.<br />
<br />
Within the CM interface all Matlab functionality is unchanged. In addition to this a new set of Comsol commands are available, all of which are documented and have standard ''help'' functionality.<br />
<br />
==Building a model==<br />
<br />
There is no particular correct way to build your model in a CM interface, it is not all that intuitive. Personally, I have found that the best way to work with and build models is within a standard Comsol session. Once built a model can easily be manipulated within the CM interface. The internal language used by Comsol is fully compatible with Matlab script, and as you build a model Comsol saves the commands in a Matlab usable format in a file named ''myModel_history.m''. I have uploaded an example script here [[File:JcModel history.txt]].<br />
<br />
===Building your initial script===<br />
<br />
The history file is generally split into three parts; setting up the model, running the model, and post-processing and plotting. If your model has been tweaked, run and saved multiple times then the history file can become quite convoluted and there will be multiple instances of these three parts. Since this file is written chronologically, the most up-to-date version of your model will be at the end and this is the part that should be copied into a new script.<br />
<br />
There are several actions that must be in your script to define the model, most of which will be pulled directly from the history script;<br />
* The ''Comsol version'' blurb, at the very start of the history script.<br />
* The description of the ''Geometry'', also found at the start of the script. This commands for the geometry are not reissued each time you run the model unless changed. You may have to scroll through the model to find the most recent version of the geometry description. This must be followed by the ''Analysed geometry'' commands.<br />
* A ''Constants'' section is next followed by an ''Application mode'' section. Both of these describe the mode in which Comsol runs and the constants it uses.<br />
* Various ''Boundary'' and ''Subdomain'' settings and equations which describe the variables to be kept track of, and any input (heat, pressure etc) to the model along its boundaries or surfaces.<br />
* A ''Library materials'' section which is completely optional.<br />
* A few model initialisation commands.<br />
* A mesh initialisation command.<br />
* A 'run the model' command.<br />
* Post-processing commands.<br />
<br />
===Adding variables===<br />
<br />
One of the main benefits of using the CM interface is the ability to setup automated changes of model variables. This removes the tedious and repetitive need to perform this operation in a Comsol window. <br />
<br />
The CM interface allows standard Matlab commands and variables to be used. Thus, when defining a model, it is straightforward to replace a hard-coded value with a variable. In the uploaded example script, the line<br />
<br />
equ.D = {{1.6360e11,0.9230e11,0.6792e11,0,0,0;0.9230e11, ... <br />
1.6360e11,0.6792e11,0,0,0;0.6792e11,0.6792e11,1.8520e11, ... <br />
0,0,0;0,0,0,0.3565e11,0,0;0,0,0,0,0.4705e11, ... <br />
0;0,0,0,0,0,0.4705e11}};<br />
<br />
is replaced with <br />
<br />
equ.D = elac_const; <br />
<br />
where elac_const is a 6x6 matrix of elastic constants which is altered for each iteration of the model.<br />
<br />
===Memory issues===<br />
<br />
The CM interface has a particularly irritating problem with memory leakage. If a single model run is performed then there is no problem, however for multiple iterations the previous model is not properly cleared from memory. Thus each iteration fills the memory further until you end up in swap. I have not found a solution to this problem, and only have a work around. Instead of altering a variable and running the model within a for-loop, instead a model can be run in CM batch mode.<br />
<br />
Essentially two scripts are required; a subscript which runs with the CM interface and does all the model related things, and a main script to call the subscript.<br />
The main script is called once and run in a standard Matlab 2011 window. All the main script does is:<br />
* save all of the changing variables to a reference .mat file, <br />
* launch CM to run the model code in batch mode,<br />
* the CM script then loads the reference .mat file and uses the variables saved in it to run the model once, the CM script then exits back to the 2011 Matlab window, <br />
* the main script then loops to the next iteration of the model, with a new set of variables and we start from step one.<br />
<br />
This is not the prettiest solution, but does work well. The code required to run CM in batch mode is;<br />
!comsol_35a matlab -np 4 -ml -nodesktop -ml -nosplash -mlr "SubscriptFile, exit"<br />
The 4 is replaced by however many cores there are available to run the code, and SubscriptFile is replaced by the name of the subscript without the .m extension.</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Comsol-Matlab_tutorial&diff=1393Comsol-Matlab tutorial2013-01-07T15:22:40Z<p>Jethro: </p>
<hr />
<div>===Setting up the software===<br />
<br />
The first step is installing the correct software. You will require a licensed copy of Comsol 3.5a, and a licensed copy of Matlab 2007. Both of these can be installed from the VPM repo. <br />
<br />
A Comsol-Matlab (CM) interface is initialised by running the command ''comsol_35a matlab''. This should start a java instance of Matlab 2007 with Comsol commands enabled. To check the link try the command ''flclear fem'' which will not work in a standard Matlab instance.<br />
<br />
Within the CM interface all Matlab functionality is unchanged. In addition to this a new set of Comsol commands are available, all of which are documented and have standard ''help'' functionality.<br />
<br />
==Building a model==<br />
<br />
There is no particular correct way to build your model in a CM interface, it is not all that intuitive. Personally, I have found that the best way to work with and build models is within a standard Comsol session. Once built a model can easily be manipulated within the CM interface. The internal language used by Comsol is fully compatible with Matlab script, and as you build a model Comsol saves the commands in a Matlab usable format in a file named ''myModel_history.m''. I have uploaded an example script here [[File:JcModel history.txt]].<br />
<br />
===Building your initial script===<br />
<br />
The history file is generally split into three parts; setting up the model, running the model, and post-processing and plotting. If your model has been tweaked, run and saved multiple times then the history file can become quite convoluted and there will be multiple instances of these three parts. Since this file is written chronologically, the most up-to-date version of your model will be at the end and this is the part that should be copied into a new script.<br />
<br />
There are several actions that must be in your script to define the model, most of which will be pulled directly from the history script;<br />
* The ''Comsol version'' blurb, at the very start of the history script.<br />
* The description of the ''Geometry'', also found at the start of the script. This commands for the geometry are not reissued each time you run the model unless changed. You may have to scroll through the model to find the most recent version of the geometry description. This must be followed by the ''Analysed geometry'' commands.<br />
* A ''Constants'' section is next followed by an ''Application mode'' section. Both of these describe the mode in which Comsol runs and the constants it uses.<br />
* Various ''Boundary'' and ''Subdomain'' settings and equations which describe the variables to be kept track of, and any input (heat, pressure etc) to the model along its boundaries or surfaces.<br />
* A ''Library materials'' section which is completely optional.<br />
* A few model initialisation commands.<br />
* A mesh initialisation command.<br />
* A 'run the model' command.<br />
* Post-processing commands.<br />
<br />
===Adding variables===<br />
<br />
One of the main benefits of using the CM interface is the ability to setup automated changes of model variables. This removes the tedious and repetitive need to perform this operation in a Comsol window. <br />
<br />
The CM interface allows standard Matlab commands and variables to be used. Thus, when defining a model, it is straightforward to replace a hard-coded value with a variable. In the uploaded example script, the line<br />
<br />
equ.D = {{1.6360e11,0.9230e11,0.6792e11,0,0,0;0.9230e11, ... <br />
1.6360e11,0.6792e11,0,0,0;0.6792e11,0.6792e11,1.8520e11, ... <br />
0,0,0;0,0,0,0.3565e11,0,0;0,0,0,0,0.4705e11, ... <br />
0;0,0,0,0,0,0.4705e11}};<br />
<br />
is replaced with <br />
<br />
equ.D = elac_const; <br />
<br />
where elac_const is a 6x6 matrix of elastic constants.<br />
<br />
===Memory issues===</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Comsol-Matlab_tutorial&diff=1392Comsol-Matlab tutorial2013-01-07T15:20:52Z<p>Jethro: </p>
<hr />
<div>===Setting up the software===<br />
<br />
The first step is installing the correct software. You will require a licensed copy of Comsol 3.5a, and a licensed copy of Matlab 2007. Both of these can be installed from the VPM repo. <br />
<br />
A Comsol-Matlab (CM) interface is initialised by running the command ''comsol_35a matlab''. This should start a java instance of Matlab 2007 with Comsol commands enabled. To check the link try the command ''flclear fem'' which will not work in a standard Matlab instance.<br />
<br />
Within the CM interface all Matlab functionality is unchanged. In addition to this a new set of Comsol commands are available, all of which are documented and have standard ''help'' functionality.<br />
<br />
==Building a model==<br />
<br />
There is no particular correct way to build your model in a CM interface, it is not all that intuitive. Personally, I have found that the best way to work with and build models is within a standard Comsol session. Once built a model can easily be manipulated within the CM interface. The internal language used by Comsol is fully compatible with Matlab script, and as you build a model Comsol saves the commands in a Matlab usable format in a file named ''myModel_history.m''. I have uploaded an example script here [[File:JcModel history.txt]].<br />
<br />
===Building your initial script===<br />
<br />
The history file is generally split into three parts; setting up the model, running the model, and post-processing and plotting. If your model has been tweaked, run and saved multiple times then the history file can become quite convoluted and there will be multiple instances of these three parts. Since this file is written chronologically, the most up-to-date version of your model will be at the end and this is the part that should be copied into a new script.<br />
<br />
There are several actions that must be in your script to define the model, most of which will be pulled directly from the history script;<br />
* The ''Comsol version'' blurb, at the very start of the history script.<br />
* The description of the ''Geometry'', also found at the start of the script. This commands for the geometry are not reissued each time you run the model unless changed. You may have to scroll through the model to find the most recent version of the geometry description. This must be followed by the ''Analysed geometry'' commands.<br />
* A ''Constants'' section is next followed by an ''Application mode'' section. Both of these describe the mode in which Comsol runs and the constants it uses.<br />
* Various ''Boundary'' and ''Subdomain'' settings and equations which describe the variables to be kept track of, and any input (heat, pressure etc) to the model along its boundaries or surfaces.<br />
* A ''Library materials'' section which is completely optional.<br />
* A few model initialisation commands.<br />
* A mesh initialisation command.<br />
* A 'run the model' command.<br />
* Post-processing commands.<br />
<br />
===Adding variables===<br />
<br />
One of the main benefits of using the CM interface is the ability to setup automated changes of model variables. This removes the tedious and repetitive need to perform this operation in a Comsol window. <br />
<br />
The CM interface allows standard Matlab commands and variables to be used. Thus, when defining a model, it is straightforward to replace a hard-coded value with a variable. In the uploaded example script, the line<br />
<br />
<br />
<blockquote><br />
equ.D = {{1.6360e11,0.9230e11,0.6792e11,0,0,0;0.9230e11, ... 1.6360e11,0.6792e11,0,0,0;0.6792e11,0.6792e11,1.8520e11, ... 0,0,0;0,0,0,0.3565e11,0,0;0,0,0,0,0.4705e11, ... 0;0,0,0,0,0,0.4705e11}};<br />
</blockquote><br />
<br />
is replaced with <br />
<br />
<blockquote><br />
equ.D = elac_const; <br />
</blockquote><br />
<br />
where elac_const is a 6x6 matrix of elastic constants.<br />
<br />
===Memory issues===</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Comsol-Matlab_tutorial&diff=1391Comsol-Matlab tutorial2013-01-07T14:54:32Z<p>Jethro: </p>
<hr />
<div>===Setting up the software===<br />
<br />
The first step is installing the correct software. You will require a licensed copy of Comsol 3.5a, and a licensed copy of Matlab 2007. Both of these can be installed from the VPM repo. <br />
<br />
A Comsol-Matlab (CM) interface is initialised by running the command ''comsol_35a matlab''. This should start a java instance of Matlab 2007 with Comsol commands enabled. To check the link try the command ''flclear fem'' which will not work in a standard Matlab instance.<br />
<br />
Within the CM interface all Matlab functionality is unchanged. In addition to this a new set of Comsol commands are available, all of which are documented and have standard ''help'' functionality.<br />
<br />
==Building a model==<br />
<br />
There is no particular correct way to build your model in a CM interface, it is not all that intuitive. Personally, I have found that the best way to work with and build models is within a standard Comsol session. Once built a model can easily be manipulated within the CM interface. The internal language used by Comsol is fully compatible with Matlab script, and as you build a model Comsol saves the commands in a Matlab usable format in a file named ''myModel_history.m''. I have uploaded an example script here [[File:JcModel history.txt]].<br />
<br />
===Building your initial script===<br />
<br />
The history file is generally split into three parts; setting up the model, running the model, and post-processing and plotting. If your model has been tweaked, run and saved multiple times then the history file can become quite convoluted and there will be multiple instances of these three parts. Since this file is written chronologically, the most up-to-date version of your model will be at the end and this is the part that should be copied into a new script.<br />
<br />
There are several actions that must be in your script to define the model, most of which will be pulled directly from the history script;<br />
* The ''Comsol version'' blurb, at the very start of the history script.<br />
* The description of the ''Geometry'', also found at the start of the script. This commands for the geometry are not reissued each time you run the model unless changed. You may have to scroll through the model to find the most recent version of the geometry description. This must be followed by the ''Analysed geometry'' commands.<br />
* A ''Constants'' section is next followed by an ''Application mode'' section. Both of these describe the mode in which Comsol runs and the constants it uses.<br />
* Various ''Boundary'' and ''Subdomain'' settings and equations which describe the variables to be kept track of, and any input (heat, pressure etc) to the model along its boundaries or surfaces.<br />
* A ''Library materials'' section which is completely optional.<br />
* A few model initialisation commands.<br />
* A mesh initialisation command.<br />
* A 'run the model' command.<br />
* Post-processing commands.<br />
<br />
<br />
<br />
===Memory issues===</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Comsol-Matlab_tutorial&diff=1390Comsol-Matlab tutorial2013-01-07T14:33:27Z<p>Jethro: </p>
<hr />
<div>===Setting up the software===<br />
<br />
The first step is installing the correct software. You will require a licensed copy of Comsol 3.5a, and a licensed copy of Matlab 2007. Both of these can be installed from the VPM repo. <br />
<br />
A Comsol-Matlab (CM) interface is initialised by running the command ''comsol_35a matlab''. This should start a java instance of Matlab 2007 with Comsol commands enabled. To check the link try the command ''flclear fem'' which will not work in a standard Matlab instance.<br />
<br />
Within the CM interface all Matlab functionality is unchanged. In addition to this a new set of Comsol commands are available, all of which are documented and have standard ''help'' functionality.<br />
<br />
===Building a model===<br />
<br />
There is no particular correct way to build your model in a CM interface, it is not all that intuitive. Personally, I have found that the best way to work with and build models is within a standard Comsol session. Once built a model can easily be manipulated within the CM interface. The internal language used by Comsol is fully compatible with Matlab script, and as you build a model Comsol saves the commands in a Matlab usable format in a file named ''myModel_history.m''. I have uploaded an example script here [[File:JcModel history.txt]].<br />
<br />
The history file is generally split into through parts; setting up the model, running the model, and post-processing and plotting. If your model has been tweaked, run and saved multiple times then the history file can become quite convoluted. Since this file is written chronologically, the most up-to-date version of your model will be at the end.<br />
<br />
<br />
<br />
===Memory issues===</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Comsol-Matlab_tutorial&diff=1389Comsol-Matlab tutorial2013-01-07T14:23:27Z<p>Jethro: </p>
<hr />
<div>===Setting up the software===<br />
<br />
The first step is installing the correct software. You will require a licensed copy of Comsol 3.5a, and a licensed copy of Matlab 2007. Both of these can be installed from the VPM repo. <br />
<br />
A Comsol-Matlab (CM) interface is initialised by running the command ''comsol_35a matlab''. This should start a java instance of Matlab 2007 with Comsol commands enabled. To check the link try the command ''flclear fem'' which will not work in a standard Matlab instance.<br />
<br />
Within the CM interface all Matlab functionality is unchanged. In addition to this a new set of Comsol commands are available, all of which are documented and have standard ''help'' functionality.<br />
<br />
===Building a model===<br />
<br />
There is no particular correct way to build your model in a CM interface, it is not all that intuitive. Personally, I have found that the best way to work with and build models is within a standard Comsol session. Once built a model can easily be manipulated within the CM interface. The internal language used by Comsol is fully compatible with Matlab script, and as you build a model Comsol saves the commands in a Matlab usable format in a file named ''myModel_history.m''. I have uploaded an example script here [[File:JcModel history.txt]].<br />
<br />
===Memory issues===</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=File:JcModel_history.txt&diff=1388File:JcModel history.txt2013-01-07T14:22:44Z<p>Jethro: Example of comsol-matlab code</p>
<hr />
<div>Example of comsol-matlab code</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Comsol-Matlab_tutorial&diff=1387Comsol-Matlab tutorial2013-01-07T14:17:03Z<p>Jethro: </p>
<hr />
<div>===Setting up the software===<br />
<br />
The first step is installing the correct software. You will require a licensed copy of Comsol 3.5a, and a licensed copy of Matlab 2007. Both of these can be installed from the VPM repo. <br />
<br />
A Comsol-Matlab (CM) interface is initialised by running the command ''comsol_35a matlab''. This should start a java instance of Matlab 2007 with Comsol commands enabled. To check the link try the command ''flclear fem'' which will not work in a standard Matlab instance.<br />
<br />
Within the CM interface all Matlab functionality is unchanged. In addition to this a new set of Comsol commands are available, all of which are documented and have standard ''help'' functionality.<br />
<br />
===Building a model===<br />
<br />
There is no particular correct way to build your model in a CM interface, it is not all that intuitive. Personally, I have found that the best way to work with and build models is within a standard Comsol session. Once built a model can easily be manipulated within the CM interface. The internal language used by Comsol is fully compatible with Matlab script, and as you build a model Comsol saves the commands in a Matlab usable format in a file named ''myModel_history.m''. <br />
<br />
===Memory issues===</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Comsol-Matlab_tutorial&diff=1386Comsol-Matlab tutorial2013-01-07T14:06:38Z<p>Jethro: </p>
<hr />
<div>===Setting up the software===<br />
<br />
The first step is installing the correct software. You will require a licensed copy of Comsol 3.5a, and a licensed copy of Matlab 2007. Both of these can be installed from the VPM repo. <br />
<br />
A Comsol-Matlab (CM) interface is initialised by running the command ''comsol_35a matlab''. This should start a java instance of Matlab 2007 with Comsol commands enabled. To check the link try the command ''flclear fem'' which will not work in a standard Matlab instance.<br />
<br />
Within the CM interface all Matlab functionality is unchanged. In addtion to this a new set of Comsol commands are available, all of which are documented and have ''help'' functionality.<br />
<br />
===Building a model===<br />
<br />
There is no particular correct way to build your model in a CM interface, it is not all that intuitive. Personally, I have found that the best way to work with and build models is within a standard Comsol session. Once built a model can easily be manipulated within the CM interface. The internal language used by Comsol is fully compatible with Matlab script, and as you build a model Comsol saves the commands in a Matlab usable format in a file named ''myModel_history.m''. <br />
<br />
<br />
===Memory issues===</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Comsol-Matlab_tutorial&diff=1385Comsol-Matlab tutorial2013-01-07T13:50:08Z<p>Jethro: </p>
<hr />
<div>===Getting Started===<br />
<br />
The first step is installing the correct software. You will require a licensed copy of Comsol 3.5a, and a licensed copy of Matlab 2007. Both of these can be installed from Roger's repo. <br />
<br />
A Comsol-Matlab (CM) interface is initialised by running the command ''comsol_35a matlab''. This should start a java instance of Matlab 2007 with Comsol commands enabled. To check the link try the command ''flclear fem'' which will not work in a standard Matlab instance.</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Useful_information&diff=1384Useful information2013-01-07T13:42:02Z<p>Jethro: </p>
<hr />
<div>== AO resources ==<br />
<br />
*[[AO resources]] - Facilities, equipment, instruments, internal expertise. Please add to this list.<br />
*[http://optics.eee.nottingham.ac.uk/order_form/ Order Form Creator], [[Order Form Creator Guidance]], and [http://optics.eee.nottingham.ac.uk/order_form/orders/ Order forms already created] (by [[Steve Sharples | Steve]])<br />
*[[Publications | Applied Optics publications, papers and thesis]]<br />
*[http://tlptweb.eee.nottingham.ac.uk/GoodsIn/ Goods In] and [[Tea breaks]].<br />
<br />
*[http://optics.eee.nottingham.ac.uk/links/logo/ Applied Optics Group Logo]<br />
*[http://optics.eee.nottingham.ac.uk/optics/antiword/ Word to text and pdf converter] (broken).<br />
*[[Laser Safety]] <br />
*[[Printers and printing]]<br />
<br />
== AO local documentation ==<br />
<br />
*[[Linux How-tos]]. Instructions on how to install the current stable version of Linux on your PC and set it up for use in the Applied Optics Group, useful hints, how to set up drivers for hardware in experimental PCs etc.<br />
*[http://vlsi.eee.nottingham.ac.uk/ VLSI Web Pages]. Useful info for VLSI users, set up by Roger Light.<br />
*[http://optics.eee.nottingham.ac.uk/eagle/eagle2pcbtrain.html Eagle PCB -> PCBTrain Export Mini How-To].<br />
*[http://optics.eee.nottingham.ac.uk/eagle/eagle2lpkf_at_eee.html EAGLE PCB Export Page]. How to export EAGLE files for use in CircuitCAM.<br />
*Common network settings<br />
*[http://optics.eee.nottingham.ac.uk/optics/documentation/latex-thesis/latex-thesis.pdf LaTeX thesis template] (PDF). A very short guide on some salient points for using LaTeX to write your thesis. See also the [http://optics.eee.nottingham.ac.uk/optics/documentation/latex-thesis/thesis_template.zip thesis template] (ZIP file).<br />
*[http://optics.eee.nottingham.ac.uk/optics/documentation/o-sam/no_more_flipping.pdf No More Flipping]. Documentation concerning the O-SAM and ARRO-SAM hardware (PDF)<br />
*[http://optics.eee.nottingham.ac.uk/vxi11/ VXI-11 protocol for Linux]. The basis for communicating with most scopes and other instruments over ethernet.<br />
<br />
<br />
== VLSI resources ==<br />
<br />
* Links relevant for [[VLSI]] users.<br />
* [[Vlsi:Chips|Chips]] manufactured to date.<br />
* [[Cadence]] tutorials.<br />
* [[Spartan Starter Pinouts]]<br />
<br />
== Other resources ==<br />
<br />
*[[Comsol-Matlab tutorial]]<br />
<br />
=== Web pages and links ===<br />
<br />
*http://optics.eee.nottingham.ac.uk<br />
*[http://optics.eee.nottingham.ac.uk/jobs/ Applied Optics Job Vacancies]<br />
*[http://www.nottingham.ac.uk/eee/research/applied_optics_intro.php Applied Optics Group "Offical" EEE Webpage]<br />
*[http://babbage.eee.nottingham.ac.uk/ibios/ iBIOS]<br />
*[http://www.nottingham.ac.uk/match/ Multidisciplinary Assessment of Technology Centre for Healthcare (MATCH) Homepage]<br />
*[http://www.nottingham.ac.uk/eee/research/applied_optics_members.php Applied Optics team members]<br />
*[http://www.nottingham.ac.uk/eee/ EEE Homepage]<br />
*[http://www.nottingham.ac.uk/ University of Nottingham Homepage] | [http://my.nottingham.ac.uk/ Portal] | [https://owa.nottingham.ac.uk Outlook web mail access]<br />
*[http://research.nottingham.ac.uk/ UoN Research Pages] | [http://www.nottingham.ac.uk/is/about/news/issue/index.phtml The ISsue] (Information Services eBulletin) | [http://www.nottingham.ac.uk/exchange/ Exchange Magazine] | [http://www.nottingham.ac.uk/bridging/ Bridging the Gaps]<br />
<br />
=== Driver, code and useful bits and bobs ===<br />
[[Drivers and code| Drivers, code and useful bits and bobs]]</div>Jethrohttp://optics.eee.nottingham.ac.uk/w/index.php?title=Comsol-Matlab_tutorial&diff=1383Comsol-Matlab tutorial2013-01-07T13:39:04Z<p>Jethro: Created page with " This is a guide to using the Comsol-Matlab interface. You will require: * Comsol 3.5a, * Matlab 2007, * plenty of patience."</p>
<hr />
<div><br />
This is a guide to using the Comsol-Matlab interface. You will require:<br />
* Comsol 3.5a,<br />
* Matlab 2007,<br />
* plenty of patience.</div>Jethro