Scilab не может создавать Java Main-Class на Ubuntu 17.10 [duplicate]
Я установил Ubuntu 16.04.3 LTS на компьютер с AMD A4-4000 APU with Radeon(tm) HD Graphics и установил Scilab 5.5.2 здесь из официального репозитория (версия пакета 5.5.2-2ubuntu3).
Он работал нормально на 2017- 12-24, но сломано некоторым последним обновлением. Я могу опубликовать dpkg-log, но кажется, что он связан с MESA:
$ cat /var/log/dpkg.log* | grep «status installed.*mesa» 2018-01-11 14:51:08 status installed libglapi-mesa:amd64 17.2.4-0ubuntu1
16.04.2 2018-01-11 14:51:09 status installed libglapi-mesa:i386 17.2.4-0ubuntu1
16.04.2 2018-01-11 14:51:10 status installed libgl1-mesa-dri:amd64 17.2.4-0ubuntu1
16.04.2 2018-01-11 14:51:11 status installed libgl1-mesa-dri:i386 17.2.4-0ubuntu1
16.04.2 2018-01-11 14:51:16 status installed libegl1-mesa:amd64 17.2.4-0ubuntu1
16.04.2 2018-01-11 14:51:17 status installed libwayland-egl1-mesa:amd64 17.2.4-0ubuntu1
16.04.2 2018-01-11 14:51:18 status installed libosmesa6:amd64 17.2.4-0ubuntu1
16.04.2 2018-01-11 14:51:18 status installed libosmesa6:i386 17.2.4-0ubuntu1
16.04.2 2018-01-11 14:51:19 status installed libgl1-mesa-glx:amd64 17.2.4-0ubuntu1
16.04.2 2018-01-11 14:51:20 status installed libgl1-mesa-glx:i386 17.2.4-0ubuntu1
16.04.2 2018-01-11 14:51:20 status installed libgles2-mesa:amd64 17.2.4-0ubuntu1
16.04.2 2018-01-11 14:51:21 status installed mesa-vdpau-drivers:amd64 17.2.4-0ubuntu1
16.04.2 2018-01-12 12:24:25 status installed mesa-va-drivers:amd64 17.2.4-0ubuntu1
Моя системная информация:
In Software & amp; Обновления software-properties-gtk У меня есть только одно предложение об установке пакета amd64-microcode. Его установка не помогает.
Scilab does not start after some upgrades on Ubuntu Xenial
Bug Description
Software that use libjogl2-java (Scilab, Matlab. ) fail to run, because Mesa dropped ‘Gallium’ from the renderer string.
Scilab cannot create Scilab Java Main-Class (we have not been able to find the main Scilab class. Check if the Scilab and thirdparty packages are available).
Expected results:
Scilab works normally on Ubuntu 16.04 LTS system.
Actual results:
see error above.
[Regression potential]
The fix is a simple oneliner that allows libjogl2-java to detect Mesa with both new and original version of Mesa.
Software rendering with recent mesa (either LLVMPipe, softpipe or swr) breaks matlab.
Seen with MATLAB 2016a on Kubuntu 17.04 with the latest (git) mesa as of today.
Graphic commands (e.g. plot) hang and make it impossible to close Matlab cleanly.
On llvmpipe the ‘opengl info’ matlab command crashes with
On softpipe, the same command hangs.
This is curious because matlab has itself a software rendering mode, that seems to rely on mesa X11. The opengl info for it returns
Version: ‘2.1 Mesa 10.5.2’
Vendor: ‘Brian Paul’
Renderer: ‘Mesa X11’
MaxTexture Size: 16384
Visual: ‘Visual 0x72, (RGBA 32 bits (8 8 8 8), Z depth 16 bits, Hardware acceleratio…’
Software: ‘true’
HardwareS upportLevel: ‘none (known graphics driver issues)’
SupportsGraphi csSmoothing: 0
SupportsDep thPeelTranspare ncy: 1
SupportsAlignVe rtexCenters: 0
Extensions: <151x1 cell>
MaxFrameBuffer Size: 16384
So, it looks like mesa was supporting matlab 2016a just fine at the time of 10.5.2 and that we are now facing a regression.
I won’t be looking at the issue, I’m afraid yet here’s a couple of ideas/suggestions that should help:
I’ll try to work on the last point aka get more verbose information.
In any case, my intent was mostly to assure that a trace of the problem is present on the bug tracker, in case other users run into the issue and possibly to guide them if they need to get new hardware with the need to run Matlab on it.
Unfortunately the Matlab experience on Linux is sad. Not working with nouveau. Not working with soft rendering, either. Working with its own soft rendering, but with many limitations. Fortunately, it seems OK on intel graphics.
Sergio, I installed the 30-day trial of Matlab r2017b and typed ‘opengl info’ in the command window. I did not get a java exception. I got an error message that reads:
«»»
MATLAB has experienced a low-level graphics error, and may not have drawn correctly.
Read about what you can do to prevent this issue at Resolving Low-Level Graphics Issues then restart MATLAB.
To share details of this issue with MathWorks technical support,
please include this file with your service request.
«»»
I don’t see that issue when using NVIDIA’s driver.
I used apitrace to create a trace of Matlab’s GL calls with llvmpipe and with NVIDIA’s linux driver. It looks like Matlab begins by trying to find the highest supported GL version of the core profile. With NVIDIA’s driver it finds 4.5. With llvmpipe it finds 3.3.
Then, it also tries to create compatibility profile context. With NVIDIA’s driver it again gets a 4.5 context. With llvmpipe, we don’t have such profiles and Matlab stops after getting a GL 3.1 context.
Finally, with llvmpipe, Matlab tries to create a 3.3 compatibility profile and fails. It then successfully creates a legacy context with glXCreateNewCon text(). It calls glGetIntegerv( GL_MAJOR/ MINOR_VERSION) then destroys the context.
As far as I an tell, Matlab simply doesn’t accept llvmpipe’s context/version offerings. Either that’s by design or there’s some sort of logic bug in MatLab that gives up on GL support after failing to create a particular kind of context.
You could try installing some older versions of Mesa to see if Matlab 2016a works/fails. But Matlab 2017b seems to act differently.
thanks for testing! Indeed, I think that Matlab 2016 is fine with the NVIDIA proprietary driver. However, I cannot use it because I have a KDE desktop and the nvidia proprietary drivers hang the konsole as per
Furthermore, I prefer the free drivers when my graphics card copes with them.
The different response to the opengl info may be related to a slightly different mesa/graphics stack combination. Incidentally, it is unclear to me whether you got the «MATLAB has experienced a low-level graphics error» with llvmpipe or the hardware driver.
Matlab seems to use some java library to interact with opengl and I do not know if it is something commercial or something open source that MathWorks has adapted to its needs. In the latter case, testing might be easier.
. looks like also scilab has issues with the software renderer. With LIBGL_ALWAYS_ SOFTWARE= 1, scilab cannot plot (shows empty plot windows). May be a totally unrelated issue, but I think that scilab and matlab have in common the use of jogamp for graphics rendering.
By using parallel build
where x is the number of concurrent build tasks (don’t set a big number, this could overload your computer).
By using ccache
Use ccache, http://ccache.samba.org/ For this, install ccache and launch the configure with the options:
(we have report that CXX sometimes does not work under Fedora, just removed it)
Some quick benchmarks show an improvement of about 30% of the compilation’s length.
I want to color the output, how can I do that?
Providing those flags will color warnings/errors/etc (gcc4.8.5+ & clang support them).
There are dependencies between libraries. If the compilation process detects that the library which it depends on has changed, it will recompile. It is done because a symbol (ex : function name) may have been changed and this could lead to an undefined symbol.
When I try to regenerate Makefile.in and/or configure, I got a few warnings
If you have something like :
It is (unfortunately) normal. We have to override compilation flags in order to deactivate optimization for a few files.
I get this error when I am compiling lapack.
This may come from the fact that you may have tried to compile scilab with an Intel Compiler and then switch to a GNU compiler. (difference between lib included or not).
Some version of libtool have problem with Intel compilers. Try a more recent version (or the CVS one). Caution : you shouldn’t have this error unless you are altering configure.ac or Makefile.am
When I compile Scilab, I get a »undefined versioned symbol name _LIB_VERSION@@GLIBC_2.0»
I got an undefined reference ld error on »__secure_getenv» while building
All needed packages to compile Scilab under Linux can be found in Scilab SVN pre-requirements directory:
So, to download scilab and the prerequirements packages :
Note : up to the 5.4.1 version, the repo was Linux for 32 bits, linux_x64 for 64 bits. Since then it has been changed to linux and linux_x64
I compiled Scilab once but since I updated, it is complaining about a missing file
If it looks like (case A):
or with Scilab binary (case B):
It is a problem of the autotools which do not rebuild the dependencies correctly. In case A, please do
It should fix this problem.
In case B, please do:
Compilation of Scilab against Tcl/Tk 8.5 stops with an error when building macros
The workaround is to:
and start again. This problem happens for instance with KUbuntu 7.10 (Gutsy Gibbon) and OpenSuse 10.3 as well.
I compiled Scilab successfully but I get an error during startup
then you can work around it by doing:
and launch Scilab again. This problem happens for instance with openSuse 10.3. More information
I get a long Java warning on startup but Scilab is working
It is the same issue as the previous one (lib XCB).
The very crappy fix is:
I have some weird undefined reference to some gfortran stuff
If you have some errors like:
It is probably because you update some of your compilers. make clean in the module should fix the issue.
I want to compile Scilab without Java
Please not that you won’t have the Scilab GUI and the Scilab-Java API/Connector.
When I plot a function in Scilab the plot produces a blank window. How do I fix this?
You may see an error like:
The problem is twofold. The shared library libgluengen-rt.so cannot be found or the gluegen-rt.jar, jogl.jar class libraries cannot be found either. Make the three dynamic libraries (libgluegen-rt.so, libjogl.so, libjogl_awt.so) available in the LD_LIBRARY_PATH or place them in the java platform directory, like /path/to/the/jdk1.xxx/jre/lib/amd64 if you are running x86_64 linux or /path/to/the/jdk1.xxx/jre/lib/i386 if you are running i386 linux (32bit) or where ever your java runtime environment is. The jogl*.so libraries are the Java OpenGL libraries for grapjics.
Also update the SCI/etc/classpath.xml file and update the path to gluegen-rt.jar or jogl.jar or place both jar libraries in the java extension directory like /path/to/the/jdk1.xxx/jre/lib/ext for my version of Java. By doing this you do not have to include them in the CLASSPATH.
I get the message «Exception in thread «main» java.lang.UnsatisfiedLinkError: Can’t load library: /usr/lib/jvm/java-6-openjdk/jre/lib/ext/libjava-access-bridge-jni.so» on startup
This problem is related to a packaging issue of the JVM under Debian (and maybe Ubuntu) in the version 6b14-1.5
pre1-5 (at least). Update your JVM (for example, version 6b16-4 will work).
I get tonnes of «undefined reference to» at the final link of Scilab binary
If you can some error messages like:
Try to remove the argument -Wl,—as-needed which is probably causing this error.
You just need to customize your LDFLAGS variable to add the path to ATLAS. For example, if your ATLAS library is in /usr/lib64/atlas (like under mandriva/fedora 64 bits):
This command will allow configure to detect automatically that you have an ATLAS library.
It is likely that Scilab is loading a wrong library.
This occurs if you are build Scilab and there is already a packaged Scilab installed.
Using the dynamic link, I am getting «ignoring unknown tag F77»
Usually, this is because the dynamic link is not able to find a Fortran compiler. Try to install one.
On startup, I get ‘Document is empty’
I start Scilab but I am getting:
This problem occurred under Mandriva and Mageia. It was due to a bug of Tcl package. It was shipping it own buggy zlib. This zlib was using by libxml2 creating this issue.
I have been playing with Java 7 and coming back to version 6 fails
If you are getting the following error, that mean that Scilab could not load the jar tree. It can come from many reasons.
If you are editing etc/jvm_options.xml to add $SCILAB/modules/core/jar/org.scilab.modules.core.jar in it, you might get:
It should be fixed within the Scilab build system by target=»6″ in the build.incl.xml files.
How can I reproduce Scilab started with stdin closed
On startup, I get Glib-ERROR on gmem.c
On KDE the qt-gtk2 Oxygen style engine is buggy. Changing the QT-GTK theme engine to another one fix this issue.
Icons and Mimetypes user installation
Scilab provide a desktop file, icons and mimetypes descriptions on the source tree. You can copy them on $XDG_DATA_DIR eg.
/.local/share to have a nive desktop integration.
When trying to build Scilab from source following instructions given here (https://wiki.scilab.org/Compilation%20of%20Scilab). If you get following error:
The above error may be faced when trying to build Scilab 6.x on Fedora24, Mint18 and Ubuntu 16.04 distros (or newer versions of linux).
See Also
howto/install/linux for the basic compiling instructions.
Scilab cannot create scilab java main class windows 7
[Scilab-users] 5.4.1 Cannot create Java Main-Class
[Scilab-users] 5.4.1 Cannot create Java Main-Class
Scilab cannot create Scilab Java Main-Class (we have not been able to
find the main Scilab class. Check if the Scilab and thirdparty packages
are available).
I removed Scilab, restarted the machine, down loaded it again from the
website, re-installed it using defaults. Still the same message on the
very first offer to start it after the installation.
I don’t know about Java and classes. I have not knowingly done anything
with Java. I’m stuck. What do I do now?
Re: 5.4.1 Cannot create Java Main-Class
Re: 5.4.1 Cannot create Java Main-Class
Re: 5.4.1 Cannot create Java Main-Class
From this morning I am also having the same problem in windows 7 64x. I tried uninstalling java and scilab. I also changed the versions go both software and still the same error is appearing. Any clues how to solve it?
Thank you very much!
Re: 5.4.1 Cannot create Java Main-Class
Le 08/08/2013 18:14, matacosta a écrit :
> Hi,
>
> From this morning I am also having the same problem in windows 7 64x. I
> tried uninstalling java and scilab. I also changed the versions go both
> software and still the same error is appearing. Any clues how to solve it?
Try to remove or rename the SCIHOME configuration directory
http://help.scilab.org/SCIHOME
Re: 5.4.1 Cannot create Java Main-Class
[Scilab-users] Using intersci.
I can’t figure it out on the debian system.
The examples in /scilab-5.4.1/modules/intersci/examples seem not to build anymore.
0) Does anybody actually use this functionality??
1) Where is intersci-n?
2) Where is the Makefile.inc referred to in the /scilab-5.4.1/modules/intersci/examples/Makefile?
3) What questions should I be asking?
The «help» on intersci says to use «swig». without a couple of completely worked through examples, that’s not
much help.
Re: 5.4.1 Cannot create Java Main-Class
Thank you so much for the help now is all working fine!
Re: Using intersci. solved, sort of
I figured out the dynamic linking intersci issues.
The short answer is, use the skeleton toolbox
scilab-5.4.1/contrib/toolbox_skeleton
as a sample.
(If you want to see how painful it is to do this the «new» way, poke around in the toolbox,
and look at the various interface routines.
Also this was somewhat useful. obviously a lot of work to write. Thank you Michael.
http://perso.telecom-paristech.fr/
builder_gateway_fortran.sce:
===
// This file is released under the 3-clause BSD license. See COPYING-BSD.
builder_gw_fortran();
clear builder_gw_fortran; // remove builder_gw_fortran on stack
===
The «tbx_* routines copy everything to TMPDIR so that’s where you look to see what’s going on.
[Scilab-users] can not create Scilab Java Main_Class after installation of SL 5.5.0.32 on windows 7
[Scilab-users] can not create Scilab Java Main_Class after installation of SL 5.5.0.32 on windows 7
I got the following message after the install when I want to run scilab.
Scilab cannot create Scilab Java Main_Class.
(We have not been able to find the main Scilab Class.
Check if the Scilab and thirdparty packages area available).
Is there anybody who can help me with this problem.
I thank you very much.
—
Complex numbers: They are all fun and games until someone loses an i.
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Re: can not create Scilab Java Main_Class after installation of SL 5.5.0.32 on windows 7
Can you make a copy of your SCIHOME
(http://help.scilab.org/docs/5.5.0/en_US/SCIHOME.html) directory before
removing it and then restart Scilab?
If Scilab starts after this cleanup we will use your SCIHOME copy as a
basis for a bug report.
Le 15/04/2014 00:05, N.N. a écrit :
Re: can not create Scilab Java Main_Class after installation of SL 5.5.0.32 on windows 7
I am very sorry but it did not find a subdirectory scihome and
dir scihome.html /s /p did not find any file on my drive C:
and :
C:\Program Files\scilab-5.5.0>DIR >>C:\LISTING.TXT
Access is denied.
gives access denied.
Thank you very much Vincent and others.
On 4/15/14, Vincent COUVERT wrote:
—
Complex numbers: They are all fun and games until someone loses an i.
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Re: can not create Scilab Java Main_Class after installation of SL 5.5.0.32 on windows 7
It’s not scihome, but capital letters SCIHOME, which again is not the
real name of the directory, but a variable.
Start Scilab, in the console window, please type SCIHOME and Scilab
should respond with something like (in my case, Windows 7):
On 15-Apr-14 19:58, N.N. wrote:
—
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
Re: can not create Scilab Java Main_Class after installation of SL 5.5.0.32 on windows 7
Please reply on the list so others can help you. I’m just a private
person and far from an expert in Scilab.
Which version of Scilab have you installed?
1. Left side = File browser
2. Middle = CONSOLE
3. Top right = Variable browser
4. Bottom right = Command History
As you can see, the CONSOLE is there, right in the middle of your GUI.
At least, this is the default setup for Scilab.
I’m not sure what went wrong with your installation, but one advice
would be to remove the installation, then re-download and re-install
(get Scilab 5.5.0).
Another reason for message «Scilab cannot create Scilab Java Main-Class»
Another reason for message «Scilab cannot create Scilab Java Main-Class»
One of the reasons for the error message «Scilab cannot create Scilab Java Main-Class» is the environment variables used in Scilab (TMP,SCI,PATH) contain characters not recognized by Scilab.
This usually occurred for Windows with installed path name in chinese or when user login with chinese name (this affect «TMP» variable).
Can any one here check this?
Re: Another reason for message «Scilab cannot create Scilab Java Main-Class»
Re: Another reason for message «Scilab cannot create Scilab Java Main-Class»
Yes, it is the same issue I believe.
Le vendredi 02 janvier 2009 à 00:38 +0800, Yung-Jang Lee a écrit :
Re: Another reason for message «Scilab cannot create Scilab Java Main-Class»
Under Windows XP, and with Scilab 5.0.3 I’ve never experienced that
scilab failed to start from the directory C:\Documents and
Settings\Torbjørn Pettersen\My Documents\scilab
However, the bug http://bugzilla.scilab.org/show_bug.cgi?id=3089 is
still present in version 5.0.3, but from the comments in bugzilla it
seems to it may be fixed for higher versions of Scilab.
>
> Can any one here check this?
>
>
> Yung-Jang Lee
>
Re: Another reason for message «Scilab cannot create Scilab Java Main-Class»
Under Windows XP, and with Scilab 5.0.3 I’ve never experienced that scilab failed to start from the directory C:\Documents and Settings\Torbjørn Pettersen\My Documents\scilab
Can you check your SCI and TMP variables
to see if Windows’s short name make ‘ø’ hidden. If this is the case, then change ‘Torbjørn’ to ‘Tørbjorn’ may produce the error message.
However, the bug http://bugzilla.scilab.org/show_bug.cgi?id=3089 is still present in version 5.0.3, but from the comments in bugzilla it seems to it may be fixed for higher versions of Scilab.
Re: Another reason for message «Scilab cannot create Scilab Java Main-Class»
I found one more bug for my patch in core/src/c/cluni0.c that will
make project BuildMacros fail to build.
Sylvestre, please commit this fix.
2009/1/2 Yung-Jang Lee
Re: Another reason for message «Scilab cannot create Scilab Java Main-Class»
Under Windows XP, and with Scilab 5.0.3 I’ve never experienced that scilab failed to start from the directory C:\Documents and Settings\Torbjørn Pettersen\My Documents\scilab
Can you check your SCI and TMP variables
to see if Windows’s short name make ‘ø’ hidden. If this is the case, then change ‘Torbjørn’ to ‘Tørbjorn’ may produce the error message.
1.3
and
getenv(‘TMP’) returns C:\DOCUME
I opened a cmd shell and ran
md c:\æøå
set TMP=c:\æøå
and started scilab from this shell:
«c:\Program Files\scilab-5.0.3\bin\WScilex.exe»
Scilab starts without problem and getenv(‘TMP’) returns c:\æøå as it should.
So does the TMPDIR variable ( c:\æøå\SCI_TMP_3860_ ).
The fun part is that running chdir(TMPDIR) works:
BUT this command does not work:
—>chdir(‘c:\æøå\SCI_TMP_3860_’)
Can’t go to directory c:\æøå\SCI_TMP_3860_.
ans =
Основы работы в SciLab. На примере экзаменационных вопросов по КСВЭ
Завтра мне сдавать экзамен по такому предмету как КСВЭ(Компьютерный сервис вычислительного эксперимента). А лучший способ подготовки — это написание статьи. Я рассмотрю часть вопросов к экзамену, которые связаны с SciLab.
Статья больше подходит для студентов, использующих scilab для проверки решения, для или для сдачи экзамена по дисциплине КСВЭ. Для более подробного изучения надо читать литературу, указанную в конце статьи
Основные термины
Scilab (читается Сайлэб) — пакет прикладных математических программ, предоставляющий мощное открытое окружение для инженерных (технических) и научных расчётов.
CeCILL (от «CEA CNRS INRIA Logiciel Libre») — это лицензия на свободное программное обеспечение, адаптированная к интернациональному законодательству и законодательству Франции, подобная GNU General Public License и сохраняющая совместимость с ним.
Система m линейных алгебраических уравнений с n неизвестными (или, линейная система, также употребляется аббревиатура СЛА́У) в линейной алгебре — это система уравнений вида
Обыкнове́нные дифференциа́льные уравне́ния (ОДУ) — это дифференциальное уравнение вида
где — неизвестная функция (возможно, вектор-функция, тогда, как правило, тоже вектор-функция со значениями в пространстве той же размерности; в этом случае говорят о системе дифференциальных уравнений), зависящая от независимой переменной, штрих означает дифференцирование по. Число (порядок старшей производной, входящей в данное уравнение) называется порядком дифференциального уравнения (1)
1. Система компьютерной математики SciLab: История разработки. Возможности и ключевые особенности. Достоинства и недостатки.
История
С 1994 года распространяется вместе с исходным кодом через Интернет. В 2003 году для поддержки Scilab был создан консорциум Scilab Consortium. Сейчас в него входят 25 участников, в том числе Mandriva, INRIA и ENPC (Франция).
Scilab содержит сотни математических функций, и есть возможность добавления новых, написанных на различных языках (C, C++, Fortran и т. д.). Также имеются разнообразные структуры данных (списки, полиномы, рациональные функции, линейные системы), интерпретатор и язык высокого уровня.
Scilab был спроектирован как открытая система, и пользователи могут добавлять в него свои типы данных и операции путём перегрузки.
В системе доступно множество инструментов:
2D и 3D графики, анимация
Линейная алгебра, разреженные матрицы (sparse matrices)
Полиномиальные и рациональные функции
Интерполяция, аппроксимация
Симуляция: решение ОДУ и ДУ
Scicos: гибрид системы моделирования динамических систем и симуляции
Дифференциальные и не дифференциальные оптимизации
Обработка сигналов
Параллельная работа
Статистика
Работа с компьютерной алгеброй
Интерфейс к Fortran, Tcl/Tk, C, C++, Java, LabVIEW
Scilab имеет схожий с MATLAB язык программирования. В состав пакета входит утилита, позволяющая конвертировать документы Matlab в Scilab.
Scilab позволяет работать с элементарными и большим числом специальных функций (Бесселя, Неймана, интегральные функции), имеет мощные средства работы с матрицами, полиномами (в том числе и символьно), производить численные вычисления (например, численное интегрирование) и решение задач линейной алгебры, оптимизации и симуляции, мощные статистические функции, а также средство для построения и работы с графиками.
Для численных расчётов используются библиотеки Lapack, LINPACK, ODEPACK, Atlas и другие.
В состав пакета также входит Scicos — инструмент для редактирования блочных диаграмм и симуляции (аналог simulink в пакете MATLAB). Имеется возможность совместной работы Scilab с программой LabVIEW.
Ключевые особенности
Отличия от некоторых коммерческих программ:
Бесплатность.
Свободность (с версии 5.0).
Маленький размер — дистрибутив 4 версии занимал менее 20 МБ против более чем двухгигабайтного пакета MATLAB. Инсталлятор 5 версии (5.4.0) увеличился в объёме до 108 МБ.
Возможность запуска в консоли без использования графического интерфейса, в том числе в версии под Windows (в UNIX и Windows версиях MatLab-а эта возможность присутствует тоже). Это позволяет производить автоматизированные вычисления, есть пакетный режим.
Достоинства и недостатки
Поиски достоинства и недостатков на просторе интернета ни чего не дали. Так что расскажу о том, что я заметил сам.
Если говорить о достоинствах, тут самым основным для меня является бесплатность данного пакета, по сравнению с той же Mathematic, когда для выполнения лабораторных работы приходилось искать серийник или crack. Далее — это кросплатформеность, т.к. я больше предпочитаю использовать Gentoo, чем Windows. В принципе большенство достоинств описано в пункте Ключевые особенности.
Из недостатков я вижу только 2: Это нет такой визуализации программирования как в Mathematic, а так же система использует прежде всего численные подходы, для вычисления, что может сказаться на точности.
2. Основы работы в SciLab. Пользовательские и системные переменные. Математические выражения. Коментарии
При написании данной статьи я использую версию scilab-5.3.3 под windows.
SciLab 5.3.3
Операционные системы: Windows, Linux, MacOS
Пользовательские и системные переменные
Год/Дата Выпуска: 2011
Версия: 5.3.3
Разработчик: Free Open Source Software for Numerical Computation
Сайт разработчика: www.scilab.org
Разрядность: 32bit+64bit
Лицензия: CeCILL
По характеристикам данных не нашёл, но могу сказать, что данный пакет грузится без глюков на моём ноутбуке
Процессор: Intel Celeron Dual-Core T3300 2.0 ГГц
Оперативная память 2Гб DDR3
Видеоадаптер Intel GMA4500M
Прежде чем перейти дальше, рассмотрим сам интерфейс. При запуске открывается командное окно.
Есть 2 варианта работы: 1 — это работа в том же командном окне, 2 — открыть SciNotes(что-то вроде блокнота с подсветкой) где можно написать код, который позднее запустить, результат выполнения появится в командном окне.
Для примера я рассмотрю вывод Hellow world.
Командная строка. Используем функцию вывода на дисплей disp()
При работе в SciNotes вы получите что то похожее
для выполнения кода, надо или нажать на стрелочку в право 🙂 (как во многих средах разработки)
или Выполнение->… без отображение команд
в принципе можно использовать и другие методы выполнения, и не использовать вывод на экран
Результатом выполнения будет:
т.к. можно сказать что интерфейс изучен, далее я буду приводить просто код и результат выполнения
SciLab чувствителен к реестру, т.е. А и а — разные переменные переменные.
a=1,A=3
//Каждая операция начинается с новой строки или через запятую
//коментарии можно оставлять после двух символоф слэш
b=3
c=a+b
disp©
Основные операции:
+ сложение
— вычитание
* умножение
/ деление справа, т.е. x/y = xy^(-1)
\ деление слева, т.е. x\y = x^(-1)y
^ возведение в степень, т.е. x^y
** возведение в степень (эквивалентно ^)
’ эрмитово сопряжение (комплексное сопряжение и транспонирование)
3. Основы работы в SciLab. Функции и их типы. Способы объявления пользовательских функций. Использование функций. Файлы-сценарии и их применение для хранения функций.
Элементарные математические функции.
acos acosd acosh acoshm acosm acot acotd acoth
acsc acscd acsch asec asecd asech asin asind
asinh asinhm asinm atan atand atanh atanhm atanm
cos cosd cosh coshm cosm cotd cotg coth
cothm csc cscd csch sec secd sech sin
sinc sind sinh sinhm sinm tan tand tanh
tanhm tanm
exp expm log log10 log1p log2 logm max
maxi min mini modulo pmodulo sign signm sqrt
sqrtm
y = int8(x) 8-битовое число со знаком [-2^7; (2^7)-1] = [-128; 127]
y = uint8(x) 8-битовое число без знака [0; (2^8)-1] = [0; 255]
y = int16(x) 16-битовое число со знаком [-2^15; (2^15)-1] = [-32768; 32767]
y = uint16(x) 16-битовое число без знака [0; (2^16)-1] = [0; 65535]
y = int32(x) 32-битовое число со знаком [-2^31; (2^31)-1] = [-2147483648; 2147483647]
y = uint32(x) 32-битовое число без знака [0; (2^32)-1] = [0; 4294967295]
iconvert преобразование к целочисленному представлению
inttype определение типа целого числа
простейший способ вызова пользовательской функции:
пример пользовательской фунции:
function y = myfunction ( x )
y = 2 * x
endfunction
Сохраняем её. Далее приведён пример вызова данной функции
4. Определение одномерный и многомерных массивов. Основные действия над массивами.
Пример, как задаётся одномерный массив:
квадратные скобки ”[” и ”]” обозначают начало и конец перечисления
элементов матрицы,
запятой ”,” отделяются элементы матрицы, находящиеся в одной строке,
точка с запятой ”;” разделяет строки матрицы.
size определить размер матрицы
matrix изменить размер матрицы
resize_matrix создать новую матрицу заданного размера и скопировать
в нее элементы из исходной матрицы
Операции над матрицами:
Обращение к элементам матрицы
i = 1; 2, а j = 3; 4
для этого возьмём уже готовую матрицу
—>A = testmatrix (» hilb «, 5)
A =
25. — 300. 1050. — 1400. 630.
— 300. 4800. — 18900. 26880. — 12600.
1050. — 18900. 79380. — 117600. 56700.
— 1400. 26880. — 117600. 179200. — 88200.
630. — 12600. 56700. — 88200. 44100.
—>A(1: 2, 3: 4)
ans =
1050. — 1400.
— 18900. 26880
A матрица целиком
A(. ) матрица целиком
A(i:j,k) элементы матрицы в k-ом столбце с i-ой по j-ую строку
A(i,j:k) элементы матрицы в i-ой строке с j-ого по k-ый столбец
A(i,:) i-ая строка матрицы
A(:,j) j-ый столбец матрицы
Генерация единичной матрицы
пример умножения числа на еденичную матрицу 2 на 2
5. Определение одномерный и многомерных массивов. Специальные матричные функции
функции работы с матрицами
chol разложение Холесского
companion сопровождающая матрица
cond число обусловленности
det определитель матрицы
inv обратная матрица
linsolve решение систем линейных уравнений
lsq метод наименьших квадратов
lu LU-разложение с выбором опорного элемента
qr QR-разложение
rcond обратное число обусловленности
spec собственные значения и векторы
svd разложение по сингулярным числам матрицы
testmatrix генерация специальных матриц (Гильберта, Франка и др.)
trace след матрицы
6. Определение одномерный и многомерных массивов. Решение СЛАУ. Символьные массивы и операции над ними
Текст файла–сценария с решением задачи по формулам Крамера
7. Численное интегрирование. Подходы к интегрированию. Интегрирование функций заданных пользователем
Численное интегрирование (историческое название: (численная) квадратура) — вычисление значения определённого интеграла (как правило, приближённое). Под численным интегрированием понимают набор численных методов отыскания значения определённого интеграла.
Интегрирование по методу трапеций
проинтегрируем функцию, корень из 2*x-1 на отрезке от 1 до 10 с разбиением в 1 шаг
—>x=1:10
x =
1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
—>y=sqrt(2*x-1)
y =
column 1 to 6
1. 1.7320508 2.236068 2.6457513 3. 3.3166248
column 7 to 10
3.6055513 3.8729833 4.1231056 4.3588989
—>inttrap(x,y)
ans =
27.211585
Квадратурные формулы Ньютона Котеса
8.Численное дифференцирование. Подходы к дифференцированию.
Численное дифференцирование — совокупность методов вычисления значения производной дискретно заданной функции.
В основе численного дифференцирования лежит аппроксимация функции, от которой берется производная, интерполяционным многочленом. Все основные формулы численного дифференцирования могут быть получены при помощи первого интерполяционного многочлена Ньютона (формулы Ньютона для начала таблицы).
в точке
9. Решение ОДУ средствами SciLab. Функции применяемые для решение ОДУ. Решение краевых задач.
Существует 4 способа для решения ОДУ:
1. С помощью команды ode, которая является солвером для решения обыкновенного
дифференциального уравнения.
2. С помощью команды odedc, которая вычисляет решение смешанной дискретно-
непрерывной системы.
3. Команда dassl, которая дает решение неявно выраженного дифференциального уравнения.
4. С помощью команды impl, которая дает решение неявно выраженного линейного
дифференциального уравнения.
—>y0=1;
—>t0=1;
—>t=1:0.01:1.5;
—>deff(«[ydot]=f(t,y)»,«ydot=y^(1/3)*t»)
—>y=ode(y0,t0,t,f);
—>y_exact=((t^2+2)/3)^(1.5);// это функция точного решения для сравнения
—>my_er=y-y_exact;
—>plot(t,y-y_exact) // это график ошибки вычисления от аргумента t
результатом является такой график
за одно можно увидеть Графическое окно. Построение графиков будет подробно рассмотрено далее.
10. Построение двухмерных графиков в системе SciLab. Основные функции и типы графиков.
Функция plot
рассмотрим пример:
Функция plot2d
Рассмотрим функцию опять на примере:
как мы можем увидеть, у этой функции намного больше функционала.
фунции передаются сразу массивом, так же можно указать цвет линий и отрезок.
Функция polarplot
Служит для построения графика в полярных координатах
получается ромашка
параметры похожи как и в случае с plot2d
11. Построение трёхмерных графиков в системе SciLab. Основные функции и типы графиков.
Существует 4 способа построение графика:
Способ 1.
С помощью команды plot3d. Команда создает 3D график по точкам, заданным матрицами
x, y и z.
Способ 2.
С помощью команды plot3d1. Команда создает 3D график по точкам, заданным
матрицами x, y и z с помощью уровней цвета. Вещь в общем избыточная: величина
координаты z дополнительно еще и покрашена, в зависимости от принимаемого значения
z.
Способ 3.
С помощью команды fplot3d. Это аналог команды fplot3d, но изображаемая поверхность
задана с помощью внешней функции.
Способ 4.
С помощью команды fplot3d1. Это аналог команды plot3d1, но изображаемая поверхность
задана с помощью внешней функции.
Синтаксис этих команд смотри с помощью help.
забыл указать, что в графическом окне есть возможность экспорта данных, т.е. сохранить картинку
Результат такой же как в примере 1
результат такой же, как в примере 2
12. Задача полиномов в SciLab. Символьные операции с полиномами. Решение алгебраический уравнений. Сравнение функций fsolve и roots.
Рассмотрим на примере решения уравнения 2x^4-8x^3+8x^2-1=0
Для решения трансцендентных уравнений в применяют функцию Scilab fsolve(x0,f)
задача
Надеюсь данная статья послужит толчком, для дальнейшего изучения SciLab или решения своих задач/лабараторных




