Changeset 14249


Ignore:
Timestamp:
Dec 2, 2019 4:06:37 PM (9 days ago)
Author:
randersson
Message:

#5819 Updated UG to have Python 3 as default

Location:
branches/dev-ra-2686/Compiler/UsersGuide/doc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-ra-2686/Compiler/UsersGuide/doc/Models.xml

    r10525 r14249  
    637637solves = pyjmi.log.gather_solves(log)
    638638
    639 print
    640 print 'Number of solver invocations:',                      len(solves)
    641 print 'Time of first solve:',                               solves[0].t
    642 print 'Number of block solves in first solver invocation:', len(solves[0].block_solves)
    643 print 'Names of iteration variables in first block solve:', solves[0].block_solves[0].variables
    644 print 'Min bounds in first block solve:',                   solves[0].block_solves[0].min
    645 print 'Max bounds in first block solve:',                   solves[0].block_solves[0].max
    646 print 'Initial residual scaling in first block solve:',     solves[0].block_solves[0].initial_residual_scaling
    647 print 'Number of iterations in first block solve:',         len(solves[0].block_solves[0].iterations)
    648 print
    649 print 'First iteration in first block solve: '
    650 print '  Iteration variables:',              solves[0].block_solves[0].iterations[0].ivs
    651 print '  Scaled residuals:',                 solves[0].block_solves[0].iterations[0].residuals
    652 print '  Jacobian:\n',                       solves[0].block_solves[0].iterations[0].jacobian
    653 print '  Jacobian updated in iteration:',    solves[0].block_solves[0].iterations[0].jacobian_updated
    654 print '  Residual scaling factors:',         solves[0].block_solves[0].iterations[0].residual_scaling
    655 print '  Residual scaling factors_updated:', solves[0].block_solves[0].iterations[0].residual_scaling_updated
    656 print '  Scaled residual norm:',             solves[0].block_solves[0].iterations[0].scaled_residual_norm</programlisting>
     639print('Number of solver invocations:',                      len(solves))
     640print('Time of first solve:',                               solves[0].t)
     641print('Number of block solves in first solver invocation:', len(solves[0].block_solves)
     642print('Names of iteration variables in first block solve:', solves[0].block_solves[0].variables))
     643print('Min bounds in first block solve:',                   solves[0].block_solves[0].min)
     644print('Max bounds in first block solve:',                   solves[0].block_solves[0].max)
     645print('Initial residual scaling in first block solve:',     solves[0].block_solves[0].initial_residual_scaling)
     646print('Number of iterations in first block solve:',         len(solves[0].block_solves[0].iterations)
     647print('\n')
     648print('First iteration in first block solve: ')
     649print('  Iteration variables:',              solves[0].block_solves[0].iterations[0].ivs)
     650print('  Scaled residuals:',                 solves[0].block_solves[0].iterations[0].residuals)
     651print('  Jacobian:\n',                       solves[0].block_solves[0].iterations[0].jacobian)
     652print('  Jacobian updated in iteration:',    solves[0].block_solves[0].iterations[0].jacobian_updated)
     653print('  Residual scaling factors:',         solves[0].block_solves[0].iterations[0].residual_scaling)
     654print('  Residual scaling factors_updated:', solves[0].block_solves[0].iterations[0].residual_scaling_updated)
     655print('  Scaled residual norm:',             solves[0].block_solves[0].iterations[0].scaled_residual_norm)</programlisting>
    657656      </section>
    658657    </section>
  • branches/dev-ra-2686/Compiler/UsersGuide/doc/Optimization.xml

    r9850 r14249  
    34343434[armFrictionCoefficient_opt, pendulumFrictionCoefficient_opt] = x_opt/1e3
    34353435# Print optimal parameter values and optimal function value
    3436 print 'Optimal parameter values:'
    3437 print 'arm friction coeff = ' + str(armFrictionCoefficient_opt)
    3438 print 'pendulum friction coeff = ' + str(pendulumFrictionCoefficient_opt)
    3439 print 'Optimal function value: ' + str(f_opt)
     3436print('Optimal parameter values:')
     3437print('arm friction coeff = ' + str(armFrictionCoefficient_opt))
     3438print('pendulum friction coeff = ' + str(pendulumFrictionCoefficient_opt))
     3439print('Optimal function value: ' + str(f_opt))
    34403440</programlisting>
    34413441
     
    34673467
    34683468    <programlisting language="python"># Plot simulation result
    3469 plt.figure (1)
     3469plt.figure(1)
    34703470plt.subplot(2,1,1)
    34713471plt.plot(t_opt,theta_opt,'-.',linewidth=3,
     
    34763476label='Simulation optimal parameters')
    34773477plt.legend(loc=1)
    3478 plt.show ()
     3478plt.show()
    34793479</programlisting>
    34803480
  • branches/dev-ra-2686/Compiler/UsersGuide/doc/ThirdpartyDependencies.xml

    r14127 r14249  
    1414
    1515      <para>All dependencies needed to run JModelica.org are bundled in the installer
    16       and listed in <xref linkend="thirdparty_deps_list_sec"/>.
    17       However, to utilize the OPC capabilities of openOPC the script
    18     <literal>INSTALL.bat</literal> in <literal>OpenOPC</literal> must be run, see
    19     <xref linkend="opc-sec"/>.</para>
     16      and listed in <xref linkend="thirdparty_deps_list_sec"/>.</para>
    2017  </section>
    21  
    22   <section xml:id="opc-sec"> <!-- remove this section when swithing to Python 3 -->
    23   <title>Open Platform Communication (OPC)</title>
    24   <para>OPC, Open Platform Communication, is a series of standards and specifications
    25   for communication between different platforms maintained by <link
    26   xlink:href="https://opcfoundation.org/">OPC Foundation</link>. It can be used for sending,
    27  e.g., measurement data, between control units.</para>
    28  <para>In JModelica.org there is support for OPC communication through the bundled Python package OpenOPC.
    29  However, it requires additional installations to work. During the installation of JModelica.org you will
    30       be asked whether to install Graybox OPC Automation Wrapper or not.
    31       If it is installed two dlls will be added to the windows registry and there
    32       will be a folder named <literal>OpenOPC</literal> in the installation folder.
    33       To start the required OPC server, the <literal>INSTALL.bat</literal>
    34       must be run with administration rights. It takes three optional arguments; ip adress,
    35       inactivity time, and max clients. For more information on the options, see
    36       <literal>OpenOPC/README.txt</literal>.
    37       </para>
    38      
    39       <para>It is possible to test if the OPC server was setup properly by running
    40       the following in Python (32 and 64 bit):
    41       <programlisting>from OpenOPC import open_client
    42 opc = open_client()</programlisting>
    43        If the server is not up-and-running an exception will be thrown.
    44       </para>
    45       <para>Note that you during uninstallation of JModelica.org will be asked if
    46       Graybox OPC Automation Wrapper should be uninstalled. An uninstallation will
    47       affect all installations of JModelica.org since the registred dlls will be
    48       deleted from the registry.</para>
     18
    4919  </section>
    5020  <section xml:id="thirdparty_deps_list_sec"><title>Applications, Libraries and Python Packages in JModelica.org</title> 
     
    6434              <listitem>
    6535                <para><link xlink:href="http://www.python.org/">Python
    66                 2.7.13</link></para>
    67               </listitem>
    68              
    69               <!--Replace with this when switching to Python 3 -->
    70               <!--listitem>
    71                 <para><link xlink:href="http://www.python.org/">Python
    7236                3.7.4</link></para>
    73               </listitem -->
     37              </listitem>
    7438
    7539              <listitem>
     
    13094                xlink:href="http://casadi.org">CasADi</link></para>
    13195              </listitem>
    132              
    133             <listitem> <!-- remove this section when swithing to Python 3 -->
    134               <para><link xlink:href="http://gray-box.net/download_daawrapper.php?lang=en">Graybox OPC Automation Wrapper
    135               2.02</link></para>
    136             </listitem>
    137            
    138             <listitem> <!-- remove this section when swithing to Python 3 -->
    139               <para><link xlink:href="http://openopc.sourceforge.net/">OpenOPC for Python 1.3.1</link></para>
    140             </listitem>
    141           </itemizedlist>
    142 
    14396
    14497          <para><emphasis role="bold">Python packages</emphasis></para>
    14598
    146           <!-- Switch to this when moving to Python 3
     99
    147100        <simplelist type="vert" columns="2">
    148101           <member>
     
    514467</member>
    515468</simplelist>
    516           -->
    517          
    518 <simplelist type="vert" columns="2">
    519 <member>
    520 <para><link xlink:href="http://xlwings.org">xlwings 0.11.4</link></para>
    521 </member>
    522 
    523 <member>
    524 <para><link xlink:href="http://wxPython.org/">wxPython 4.0.0a1</link></para>
    525 </member>
    526 
    527 <member>
    528 <para><link xlink:href="http://wxPython.org/">wxPython-common 3.0.2.0</link></para>
    529 </member>
    530 
    531 <member>
    532 <para><link xlink:href="https://github.com/Drekin/win-unicode-console">win-unicode-console 0.5</link></para>
    533 </member>
    534 
    535 <member>
    536 <para><link xlink:href="http://ipython.org">widgetsnbextension 3.0.3</link></para>
    537 </member>
    538 
    539 <member>
    540 <para><link xlink:href="https://github.com/SimonSapin/python-webencodings">webencodings 0.5.1</link></para>
    541 </member>
    542 
    543 <member>
    544 <para><link xlink:href="https://github.com/jquast/wcwidth">wcwidth 0.1.7</link></para>
    545 </member>
    546 
    547 <member>
    548 <para><link xlink:href="https://github.com/haypo/trollius">trollius 2.1</link></para>
    549 </member>
    550 
    551 <member>
    552 <para><link xlink:href="http://ipython.org">traitlets 4.3.2</link></para>
    553 </member>
    554 
    555 <member>
    556 <para><link xlink:href="http://www.tornadoweb.org/">tornado 4.5.2</link></para>
    557 </member>
    558 
    559 <member>
    560 <para><link xlink:href="https://github.com/jupyter/testpath">testpath 0.3.1</link></para>
    561 </member>
    562 
    563 <member>
    564 <para><link xlink:href="http://pypi.python.org/pypi/six/">six 1.11.0</link></para>
    565 </member>
    566 
    567 <member>
    568 <para><link xlink:href="http://docs.python.org/3/library/functools.html#functools.singledispatch">singledispatch 3.4.0.3</link></para>
    569 </member>
    570 
    571 <member>
    572 <para><link xlink:href="http://cheeseshop.python.org/pypi/simplegeneric">simplegeneric 0.8.1</link></para>
    573 </member>
    574 
    575 <member>
    576 <para><link xlink:href="https://github.com/pypa/setuptools">setuptools 36.5.0</link></para>
    577 </member>
    578 
    579 <member>
    580 <para><link xlink:href="https://www.scipy.org">scipy 0.19.0</link></para>
    581 </member>
    582 
    583 <member>
    584 <para><link xlink:href="https://github.com/benhoyt/scandir">scandir 1.5</link></para>
    585 </member>
    586 
    587 <member>
    588 <para><link xlink:href="http://salib.github.io/SALib/">SALib 1.0.3</link></para>
    589 </member>
    590 
    591 <member>
    592 <para><link xlink:href="http://jupyter.org">qtconsole 4.3.1</link></para>
    593 </member>
    594 
    595 <member>
    596 <para><link xlink:href="https://pyzmq.readthedocs.org">pyzmq 16.0.2</link></para>
    597 </member>
    598 
    599 <member>
    600 <para><link xlink:href="http://pythonhosted.org/pytz">pytz 2017.2</link></para>
    601 </member>
    602 
    603 <member>
    604 <para><link xlink:href="https://pythonnet.github.io/">pythonnet 2.3.0</link></para>
    605 </member>
    606 
    607 <member>
    608 <para><link xlink:href="https://dateutil.readthedocs.io">python-dateutil 2.6.1</link></para>
    609 </member>
    610 
    611 <member>
    612 <para><link xlink:href="http://irmen.home.xs4all.nl/pyro3/">Pyro 3.16</link></para>
    613 </member>
    614 
    615 <member>
    616 <para><link xlink:href="http://ipython.org/pyreadline.html">pyreadline 2.1</link></para>
    617 </member>
    618 
    619 <member>
    620 <para><link xlink:href="http://sourceforge.net/projects/pywin32/">pypiwin32 219</link></para>
    621 </member>
    622 
    623 <member>
    624 <para><link xlink:href="http://pyparsing.wikispaces.com/">pyparsing 2.2.0</link></para>
    625 </member>
    626 
    627 <member>
    628 <para><link xlink:href="http://pygments.org/">Pygments 2.2.0</link></para>
    629 </member>
    630 
    631 <member>
    632 <para><link xlink:href="https://github.com/jonathanslenders/python-prompt-toolkit">prompt-toolkit 1.0.15</link></para>
    633 </member>
    634 
    635 <member>
    636 <para><link xlink:href="https://pip.pypa.io/">pip 9.0.1</link></para>
    637 </member>
    638 
    639 <member>
    640 <para><link xlink:href="https://github.com/pickleshare/pickleshare">pickleshare 0.7.4</link></para>
    641 </member>
    642 
    643 <member>
    644 <para><link xlink:href="http://docs.openstack.org/developer/pbr/">pbr 3.1.1</link></para>
    645 </member>
    646 
    647 <member>
    648 <para><link xlink:href="https://pypi.python.org/pypi/pathlib2/">pathlib2 2.3.0</link></para>
    649 </member>
    650 
    651 <member>
    652 <para><link xlink:href="http://github.com/jgm/pandocfilters">pandocfilters 1.4.2</link></para>
    653 </member>
    654 
    655 <member>
    656 <para><link xlink:href="https://openpyxl.readthedocs.io">openpyxl 2.4.8</link></para>
    657 </member>
    658 
    659 <member>
    660 <para><link xlink:href="http://www.numpy.org">numpy 1.13.1+mkl</link></para>
    661 </member>
    662 
    663 <member>
    664 <para><link xlink:href="http://jupyter.org">notebook 5.1.0</link></para>
    665 </member>
    666 
    667 <member>
    668 <para><link xlink:href="http://readthedocs.org/docs/nose/">nose 1.3.7</link></para>
    669 </member>
    670 
    671 <member>
    672 <para><link xlink:href="http://bitbucket.org/memedough/nose-cov/overview">nose-cov 1.6</link></para>
    673 </member>
    674 
    675 <member>
    676 <para><link xlink:href="http://jupyter.org">nbformat 4.4.0</link></para>
    677 </member>
    678 
    679 <member>
    680 <para><link xlink:href="http://jupyter.org">nbconvert 5.3.1</link></para>
    681 </member>
    682 
    683 <member>
    684 <para><link xlink:href="https://github.com/SethMMorton/natsort">natsort 5.1.0</link></para>
    685 </member>
    686 
    687 <member>
    688 <para><link xlink:href="https://github.com/testing-cabal/mock">mock 2.0.0</link></para>
    689 </member>
    690 
    691 <member>
    692 <para><link xlink:href="https://github.com/lepture/mistune">mistune 0.7.4</link></para>
    693 </member>
    694 
    695 <member>
    696 <para><link xlink:href="http://matplotlib.org">matplotlib 2.0.2</link></para>
    697 </member>
    698 
    699 <member>
    700 <para><link xlink:href="http://github.com/pallets/markupsafe">MarkupSafe 1.0</link></para>
    701 </member>
    702 
    703 <member>
    704 <para><link xlink:href="http://lxml.de/">lxml 4.0.0</link></para>
    705 </member>
    706 
    707 <member>
    708 <para><link xlink:href="http://jupyter.org">jupyter 1.0.0</link></para>
    709 </member>
    710 
    711 <member>
    712 <para><link xlink:href="http://jupyter.org">jupyter-core 4.3.0</link></para>
    713 </member>
    714 
    715 <member>
    716 <para><link xlink:href="https://jupyter.org">jupyter-console 5.2.0</link></para>
    717 </member>
    718 
    719 <member>
    720 <para><link xlink:href="http://jupyter.org">jupyter-client 5.1.0</link></para>
    721 </member>
    722 
    723 <member>
    724 <para><link xlink:href="http://github.com/Julian/jsonschema">jsonschema 2.6.0</link></para>
    725 </member>
    726 
    727 <member>
    728 <para><link xlink:href="https://github.com/originell/jpype/">JPype1 0.6.2</link></para>
    729 </member>
    730 
    731 <member>
    732 <para><link xlink:href="http://jinja.pocoo.org/">Jinja2 2.9.6</link></para>
    733 </member>
    734 
    735 <member>
    736 <para><link xlink:href="http://github.com/phn/jdcal">jdcal 1.3</link></para>
    737 </member>
    738 
    739 <member>
    740 <para><link xlink:href="https://lucene.apache.org/pylucene/jcc/">JCC 2.23</link></para>
    741 </member>
    742 
    743 <member>
    744 <para><link xlink:href="http://ipython.org">ipywidgets 7.0.1</link></para>
    745 </member>
    746 
    747 <member>
    748 <para><link xlink:href="https://ipython.org">ipython 5.5.0</link></para>
    749 </member>
    750 
    751 <member>
    752 <para><link xlink:href="http://ipython.org">ipython-genutils 0.2.0</link></para>
    753 </member>
    754 
    755 <member>
    756 <para><link xlink:href="http://ipython.org">ipykernel 4.6.1</link></para>
    757 </member>
    758 
    759 <member>
    760 <para><link xlink:href="https://github.com/html5lib/html5lib-python">html5lib 0.999999999</link></para>
    761 </member>
    762 
    763 <member>
    764 <para><link xlink:href="https://github.com/agronholm/pythonfutures">futures 3.1.1</link></para>
    765 </member>
    766 
    767 <member>
    768 <para><link xlink:href="https://github.com/MiCHiLU/python-functools32">functools32 3.2.3.post2</link></para>
    769 </member>
    770 
    771 <member>
    772 <para><link xlink:href="http://funcsigs.readthedocs.org">funcsigs 1.0.2</link></para>
    773 </member>
    774 
    775 <member>
    776 <para><link xlink:href="http://freeopcua.github.io/">freeopcua 0.90.3</link></para>
    777 </member>
    778 
    779 <member>
    780 <para><link xlink:href="https://bitbucket.org/openpyxl/et_xmlfile">et-xmlfile 1.0.1</link></para>
    781 </member>
    782 
    783 <member>
    784 <para><link xlink:href="https://bitbucket.org/stoneleaf/enum34">enum34 1.1.6</link></para>
    785 </member>
    786 
    787 <member>
    788 <para><link xlink:href="https://github.com/takluyver/entrypoints">entrypoints 0.2.3</link></para>
    789 </member>
    790 
    791 <member>
    792 <para><link xlink:href="https://github.com/micheles/decorator">decorator 4.1.2</link></para>
    793 </member>
    794 
    795 <member>
    796 <para><link xlink:href="http://cython.org/">Cython 0.25.2</link></para>
    797 </member>
    798 
    799 <member>
    800 <para><link xlink:href="http://github.com/matplotlib/cycler">cycler 0.10.0</link></para>
    801 </member>
    802 
    803 <member>
    804 <para><link xlink:href="https://coverage.readthedocs.io">coverage 4.4.1</link></para>
    805 </member>
    806 
    807 <member>
    808 <para><link xlink:href="https://github.com/schlamar/cov-core">cov-core 1.15.0</link></para>
    809 </member>
    810 
    811 <member>
    812 <para><link xlink:href="http://docs.python.org/3/library/configparser.html">configparser 3.5.0</link></para>
    813 </member>
    814 
    815 <member>
    816 <para><link xlink:href="http://starship.python.net/crew/theller/comtypes">comtypes 1.1.3</link></para>
    817 </member>
    818 
    819 <member>
    820 <para><link xlink:href="https://github.com/tartley/colorama">colorama 0.3.9</link></para>
    821 </member>
    822 
    823 <member>
    824 <para><link xlink:href="http://certifi.io/">certifi 2017.7.27.1</link></para>
    825 </member>
    826 
    827 <member>
    828 <para><link xlink:href="http://github.com/mozilla/bleach">bleach 2.0.0</link></para>
    829 </member>
    830 
    831 <member>
    832 <para><link xlink:href="https://github.com/chrippa/backports.shutil_get_terminal_size">backports.shutil-get-terminal-size 1.0.0</link></para>
    833 </member>
    834 
    835 <member>
    836 <para><link xlink:href="https://github.com/cython/backports_abc">backports-abc 0.5</link></para>
    837 </member>
    838 
    839 <member>
    840 <para><link xlink:href="https://github.com/tisimst/pyDOE">pydoe 0.3.8</link></para>
    841 </member>
    842 
    843 <member>
    844 <para><link xlink:href="http://pythonhosted.org/pyserial/">pyserial 3.4</link></para>
    845 </member>
    846 
    847 <member>
    848 <para><link xlink:href="http://openopc.sourceforge.net/">openopc 1.3.1</link></para>
    849 </member>
    850 
    851 <member>
    852 <para><link xlink:href="https://github.com/pypa/wheel/tree/0.32.2">wheel 0.32.2</link></para>
    853 </member>
    854 
    855 </simplelist>
    856469
    857470</para>
Note: See TracChangeset for help on using the changeset viewer.