Main.MatlabFunctions History

Hide minor edits - Show changes to markup

January 17, 2013, at 12:19 AM by 69.169.188.188 -
Changed lines 28-30 from:
  • t0_load.m - Load a restart file
to:
  • t0_load.m - Load a restart file

Note: Some older versions of MATLAB cannot run the apm_web_var.m or apm_web.m script. This script automatically launches the web-viewer for display of the solution results. If this is the case, comments in the script give instructions on a work-around.

January 16, 2013, at 11:58 PM by 69.169.188.188 -
Changed lines 5-6 from:

to:

APM MATLAB Functions

Changed lines 9-82 from:

(:html:) <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd"> <html> <head> <META http-equiv=Content-Type content="text/html; charset=UTF-8"> <title>Exported from Notepad++</title> <style type="text/css"> span {

	font-family: 'Courier New';
	font-size: 10pt;
	color: #000000;

} .sc0 { } .sc1 {

	color: #008000;

} .sc4 {

	font-weight: bold;
	color: #0000FF;

} .sc5 {

	color: #808080;

} .sc6 {

	font-weight: bold;
	color: #000080;

} .sc7 { } </style> </head> <body> <div style="float: left; white-space: pre; line-height: 1; background: #FFFFFF; "><span class="sc1">% APM Web-Interface Command</span><span class="sc0"> </span><span class="sc1">%</span><span class="sc0"> </span><span class="sc1">% response = apm(server,app,command)</span><span class="sc0"> </span><span class="sc1">%</span><span class="sc0"> </span><span class="sc1">% This function sends a command to the APM server with</span><span class="sc0"> </span><span class="sc1">% the following arguments:</span><span class="sc0"> </span><span class="sc1">%</span><span class="sc0"> </span><span class="sc1">% server = address of server</span><span class="sc0"> </span><span class="sc1">% app = application name</span><span class="sc0"> </span><span class="sc1">% command = instruction or line sent</span><span class="sc0"> </span><span class="sc1">% </span><span class="sc0"> </span><span class="sc1">% Some commands are:</span><span class="sc0"> </span><span class="sc1">% solve : solve the model on the server</span><span class="sc0"> </span><span class="sc1">% clear all : clear the application and all files</span><span class="sc0"> </span><span class="sc1">% clear apm : clear just the model file (apm)</span><span class="sc0"> </span><span class="sc1">% clear csv : clear just the data file (csv)</span><span class="sc0"> </span><span class="sc1">% info {FV,MV,SV,CV}, {name} : create interface to variable </span><span class="sc0"> </span><span class="sc1">% ss.t0 {values} : load ss.t0 (restart file)</span><span class="sc0"> </span><span class="sc1">% csva {contents} : add contents to the data file (csv)</span><span class="sc0"> </span><span class="sc1">% csv {line} : add one line to the data file (csv) </span><span class="sc0"> </span><span class="sc1">% apm {contents} : add to apm file without carriage return</span><span class="sc0"> </span><span class="sc1">% {otherwise} : add line to apm file</span><span class="sc0"> </span><span class="sc4">function</span><span class="sc0"> </span><span class="sc7">response</span><span class="sc0"> </span><span class="sc6">=</span><span class="sc0"> </span><span class="sc7">apm</span><span class="sc6">(</span><span class="sc7">server</span><span class="sc6">,</span><span class="sc7">app</span><span class="sc6">,</span><span class="sc7">aline</span><span class="sc6">)</span><span class="sc0">

    </span><span class="sc1">% Web-server URL base</span><span class="sc0">
    </span><span class="sc7">url_base</span><span class="sc0"> </span><span class="sc6">=</span><span class="sc0"> </span><span class="sc6">[</span><span class="sc7">deblank</span><span class="sc6">(</span><span class="sc7">server</span><span class="sc6">)</span><span class="sc0"> </span><span class="sc5">'/online/apm_line.php'</span><span class="sc6">];</span><span class="sc0">

    </span><span class="sc1">% Send request to web-server</span><span class="sc0">
    </span><span class="sc7">params</span><span class="sc0"> </span><span class="sc6">=</span><span class="sc0"> </span><span class="sc6">{</span><span class="sc5">'p'</span><span class="sc6">,</span><span class="sc7">app</span><span class="sc6">,</span><span class="sc5">'a'</span><span class="sc6">,</span><span class="sc7">aline</span><span class="sc6">};</span><span class="sc0">
    </span><span class="sc7">response</span><span class="sc0"> </span><span class="sc6">=</span><span class="sc0"> </span><span class="sc7">urlread</span><span class="sc6">(</span><span class="sc7">url_base</span><span class="sc6">,</span><span class="sc5">'get'</span><span class="sc6">,</span><span class="sc7">params</span><span class="sc6">);</span><span class="sc0">

    </span><span class="sc1">% remove newline characters from response</span><span class="sc0">
    </span><span class="sc7">newline</span><span class="sc0"> </span><span class="sc6">=</span><span class="sc0"> </span><span class="sc7">sprintf</span><span class="sc6">(</span><span class="sc5">'\r'</span><span class="sc6">);</span><span class="sc0">
    </span><span class="sc7">response</span><span class="sc0"> </span><span class="sc6">=</span><span class="sc0"> </span><span class="sc7">strrep</span><span class="sc6">(</span><span class="sc7">response</span><span class="sc6">,</span><span class="sc7">newline</span><span class="sc6">,</span><span class="sc5">''</span><span class="sc6">);</span><span class="sc0">

</span></div></body> </html> (:htmlend:)


to:
  • apm.m - Send commands to the server
  • apm_app.m - Load model and data files
  • apm_details.m - Retrieve application details
  • apm_get.m - Retrieve a file from the server
  • apm_info.m - Classify a parameter or variable
  • apm_load.m - Load model file
  • apm_meas.m - Specify a measurement
  • apm_option.m - Set an option
  • apm_sol.m - Retrieve the solution
  • apm_solve.m - ODE / DAE Integrator
  • apm_tag.m - Retrieve an option
  • apm_web.m - Open a web interface to the dashboard
  • apm_web_root.m - Open a web interface to the root directory
  • apm_web_var.m - Open a web interface to the variable values
  • csv_data.m - Load a data (csv) file locally
  • csv_element.m - Retrieve an element from loaded csv data
  • csv_load.m - Load data file
  • csv_lookup.m - Retrieve the column number for a variable
  • parse.m - Parse line given a delimiter
  • t0_load.m - Load a restart file
January 16, 2013, at 11:22 PM by 69.169.188.188 -
Added lines 1-82:

(:title APM MATLAB Interface Documentation:) (:keywords MATLAB, APM MATLAB, nonlinear, model, predictive control, differential, algebraic, modeling language:) (:description The APM MATLAB interface enhances the numerical capabilities for optimization, simulation, estimation, and control:)

The following MATLAB functions are available in the apm folder available by downloading the APM MATLAB toolbox.


(:html:) <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd"> <html> <head> <META http-equiv=Content-Type content="text/html; charset=UTF-8"> <title>Exported from Notepad++</title> <style type="text/css"> span {

	font-family: 'Courier New';
	font-size: 10pt;
	color: #000000;

} .sc0 { } .sc1 {

	color: #008000;

} .sc4 {

	font-weight: bold;
	color: #0000FF;

} .sc5 {

	color: #808080;

} .sc6 {

	font-weight: bold;
	color: #000080;

} .sc7 { } </style> </head> <body> <div style="float: left; white-space: pre; line-height: 1; background: #FFFFFF; "><span class="sc1">% APM Web-Interface Command</span><span class="sc0"> </span><span class="sc1">%</span><span class="sc0"> </span><span class="sc1">% response = apm(server,app,command)</span><span class="sc0"> </span><span class="sc1">%</span><span class="sc0"> </span><span class="sc1">% This function sends a command to the APM server with</span><span class="sc0"> </span><span class="sc1">% the following arguments:</span><span class="sc0"> </span><span class="sc1">%</span><span class="sc0"> </span><span class="sc1">% server = address of server</span><span class="sc0"> </span><span class="sc1">% app = application name</span><span class="sc0"> </span><span class="sc1">% command = instruction or line sent</span><span class="sc0"> </span><span class="sc1">% </span><span class="sc0"> </span><span class="sc1">% Some commands are:</span><span class="sc0"> </span><span class="sc1">% solve : solve the model on the server</span><span class="sc0"> </span><span class="sc1">% clear all : clear the application and all files</span><span class="sc0"> </span><span class="sc1">% clear apm : clear just the model file (apm)</span><span class="sc0"> </span><span class="sc1">% clear csv : clear just the data file (csv)</span><span class="sc0"> </span><span class="sc1">% info {FV,MV,SV,CV}, {name} : create interface to variable </span><span class="sc0"> </span><span class="sc1">% ss.t0 {values} : load ss.t0 (restart file)</span><span class="sc0"> </span><span class="sc1">% csva {contents} : add contents to the data file (csv)</span><span class="sc0"> </span><span class="sc1">% csv {line} : add one line to the data file (csv) </span><span class="sc0"> </span><span class="sc1">% apm {contents} : add to apm file without carriage return</span><span class="sc0"> </span><span class="sc1">% {otherwise} : add line to apm file</span><span class="sc0"> </span><span class="sc4">function</span><span class="sc0"> </span><span class="sc7">response</span><span class="sc0"> </span><span class="sc6">=</span><span class="sc0"> </span><span class="sc7">apm</span><span class="sc6">(</span><span class="sc7">server</span><span class="sc6">,</span><span class="sc7">app</span><span class="sc6">,</span><span class="sc7">aline</span><span class="sc6">)</span><span class="sc0">

    </span><span class="sc1">% Web-server URL base</span><span class="sc0">
    </span><span class="sc7">url_base</span><span class="sc0"> </span><span class="sc6">=</span><span class="sc0"> </span><span class="sc6">[</span><span class="sc7">deblank</span><span class="sc6">(</span><span class="sc7">server</span><span class="sc6">)</span><span class="sc0"> </span><span class="sc5">'/online/apm_line.php'</span><span class="sc6">];</span><span class="sc0">

    </span><span class="sc1">% Send request to web-server</span><span class="sc0">
    </span><span class="sc7">params</span><span class="sc0"> </span><span class="sc6">=</span><span class="sc0"> </span><span class="sc6">{</span><span class="sc5">'p'</span><span class="sc6">,</span><span class="sc7">app</span><span class="sc6">,</span><span class="sc5">'a'</span><span class="sc6">,</span><span class="sc7">aline</span><span class="sc6">};</span><span class="sc0">
    </span><span class="sc7">response</span><span class="sc0"> </span><span class="sc6">=</span><span class="sc0"> </span><span class="sc7">urlread</span><span class="sc6">(</span><span class="sc7">url_base</span><span class="sc6">,</span><span class="sc5">'get'</span><span class="sc6">,</span><span class="sc7">params</span><span class="sc6">);</span><span class="sc0">

    </span><span class="sc1">% remove newline characters from response</span><span class="sc0">
    </span><span class="sc7">newline</span><span class="sc0"> </span><span class="sc6">=</span><span class="sc0"> </span><span class="sc7">sprintf</span><span class="sc6">(</span><span class="sc5">'\r'</span><span class="sc6">);</span><span class="sc0">
    </span><span class="sc7">response</span><span class="sc0"> </span><span class="sc6">=</span><span class="sc0"> </span><span class="sc7">strrep</span><span class="sc6">(</span><span class="sc7">response</span><span class="sc6">,</span><span class="sc7">newline</span><span class="sc6">,</span><span class="sc5">''</span><span class="sc6">);</span><span class="sc0">

</span></div></body> </html> (:htmlend:)