I have installed python (2.7.8), sympy (0.7.5) and symbolic package (2.3.0) in Octave (4.0.0). In Octave I did
pkg install symbolic-2.3.0.tar (without errors)
pkg load symbolic (without errors)
And now I am trying to use it:
>> symbols
error: 'symbols' undefined near line 1 column 1
Windows 7, 64-bit. The package seems to be in the list of installed ones:
Package Name | Version | Installation directory
--------------+---------+-----------------------
control *| 3.0.0 | C:\Octave\Octave-4.0.0\share\octave\packages\control-3.0.0
financial *| 0.5.0 | C:\Octave\Octave-4.0.0\share\octave\packages\financial-0.5.0
io *| 2.4.1 | C:\Octave\Octave-4.0.0\share\octave\packages\io-2.4.1
optim *| 1.5.1 | C:\Octave\Octave-4.0.0\share\octave\packages\optim-1.5.1
signal *| 1.3.2 | C:\Octave\Octave-4.0.0\share\octave\packages\signal-1.3.2
splines *| 1.2.9 | C:\Octave\Octave-4.0.0\share\octave\packages\splines-1.2.9
struct *| 1.0.13 | C:\Octave\Octave-4.0.0\share\octave\packages\struct-1.0.13
symbolic *| 2.3.0 | C:\Octave\Octave-4.0.0\share\octave\packages\symbolic-2.3.0
Why is the package not used? Would be grateful for any advice.
There is not "symbols" in current version of symbolic package. You can see example of code in wiki. You can try use syms for testing of loading symbolic package:
>> syms x
Read documentation - Octave-Forge
May be useful link - symbolic-computation-and-octave
Related
How can I find where CUDA 11.x for PyTorch-GPU 1.13 get installed on Windows 10 on my computer?
What I tried:
I installed the NVIDIA CUDA drivers and toolkit for Windows from the NVIDIA website. I can verify this by typing: !nvidia-smi in Jupyter Lab, which gives me the following output. This indicates that the CUDA tools are installed, but not being used by my PyTorch package. I need to find out what version of CUDA drivers are installed so I can install the correct PyTorch-GPU package.
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 513.63 Driver Version: 513.63 CUDA Version: 11.6 |
|-------------------------------+----------------------+----------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Quadro P2000 WDDM | 00000000:01:00.0 Off | N/A |
| N/A 46C P8 N/A / N/A | 0MiB / 4096MiB | 1% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
I find many Ubuntu questions and answers for locating CUDA to add it to my PATH, but nothing specific for Windows 10.
For example:
Pytorch CUDA installation fails,
Pytorch CUDA installation using conda,
pytorch-says-that-cuda-is-not-available
What are the equivalent Python commands on Windows 10 to locate the CUDA 11.x toolkits and driver version that my PyTorch-GPU package must use? And then how to fix the problem if PyTorch is out of sync?
I am answering my own question here...
PyTorch-GPU must be compiled against specific CUDA binary drivers.
I finally found this hint Why torch.cuda.is_available() returns False even after installing pytorch with cuda? which identifies the issue.
import torch
torch.zeros(1).cuda()
The return value clearly identifies the problem.
AssertionError Traceback (most recent call last)
Cell In [222], line 2
1 import torch
----> 2 torch.zeros(1).cuda()
File C:\ProgramData\Anaconda3\envs\tf210_gpu\lib\site-packages\torch\cuda\__init__.py:221, in _lazy_init()
217 raise RuntimeError(
218 "Cannot re-initialize CUDA in forked subprocess. To use CUDA with "
219 "multiprocessing, you must use the 'spawn' start method")
220 if not hasattr(torch._C, '_cuda_getDeviceCount'):
--> 221 raise AssertionError("Torch not compiled with CUDA enabled")
222 if _cudart is None:
223 raise AssertionError(
224 "libcudart functions unavailable. It looks like you have a broken build?")
AssertionError: Torch not compiled with CUDA enabled
The problem is: "Torch not compiled with CUDA enabled"
Now I have to see if I can just re-install PyTorch-GPU to replace the current PyTorch-CPU version with one that is compiled against my CUDA CUDA-GPU v11.6 driver, without rebuilding the entire conda environment. I would rather not rebuild the conda environment from scratch unless it is really necessary.
I just installed Octave a few days ago and think I have been installing packages using the "pkg load name" function but never get a confirmation or anything that looks like the software is trying to download them. I also tried pkg install -forge package_name but that doesn't seem to work. Is there a difference between the two calls?
And; How can I know they are downloading? And where can I find a list of them that are?
The download function and automatic package installation in octave 4.2.1 is broken under windows. Nevertheless the standard packets come with the base installation. Just type
pkg list
in the octave console to display all installed packages. In my case the resulting list starts with these lines
Package Name | Version | Installation directory
---------------------+---------+-----------------------
communications | 1.2.1 | C:\Octave\OCTAVE~1.1\share\octave\packages\communications-1.2.1
control | 3.0.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\control-3.0.0
data-smoothing | 1.3.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\data-smoothing-1.3.0
database | 2.4.2 | C:\Octave\OCTAVE~1.1\share\octave\packages\database-2.4.2
dataframe | 1.1.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\dataframe-1.1.0
...
To get package information programmatically use
[dummy,info]=pkg('list');
info is a cell array of structures containing information about the packages. You can e.g. read the information about name and load state:
>> info{1}.name
ans = signal
>> info{1}.loaded
ans = 0
To get help about the package function enter help pgk on the command line. This help is currently (Octave 5.1) not included in the html documentation. That means doc help does NOT display this help page.
octave windows
Generally, I would like to be able to parse output of Octave commands such as pkg list image. Unfortunately, I cannot assign the output to a string, such as s = pkg list image.
I know that it's not absolutely necessary to be able to do this, because the error message when doint pkg load thispackagedoesnotexist is clear enough, but I'd still like to know whether it's possible, and if yes, how.
You should not need to parse the printed output of Octave functions. Octave functions return values, and it's much simpler and obvious to check those values instead.
In your specific case, you only want to check if a package is installed. So just check if the package appears listed in pkg:
installed = cellfun (#(x) x.name, pkg ("list"),
"UniformOutput", false);
if (! any (strcmp (installed, "foo")))
# Package foo is not installed
endif
or check if its description is empty:
if (isempty (pkg ("describe", "foo"){1}))
# Package foo is not installed
endif
Use system command launching another copy of octave:
[output,text]=system("echo 'pkg list image' |octave -q 2>/dev/null",true);
output is:
output = 0
text = Package Name | Version | Installation directory
----------------+---------+-----------------------
data-smoothing *| 1.3.0 | /usr/share/octave/packages/data-smoothing-1.3.0
dataframe | 0.9.1 | /usr/share/octave/packages/dataframe-0.9.1
general *| 1.3.4 | /usr/share/octave/packages/general-1.3.4
io *| 2.0.2 | /usr/share/octave/packages/io-2.0.2
linear-algebra *| 2.2.0 | /usr/share/octave/packages/linear-algebra-2.2.0
miscellaneous *| 1.2.0 | /usr/share/octave/packages/miscellaneous-1.2.0
nnet *| 0.1.13 | /usr/share/octave/packages/nnet-0.1.13
odepkg *| 0.8.4 | /usr/share/octave/packages/odepkg-0.8.4
optim *| 1.3.0 | /usr/share/octave/packages/optim-1.3.0
optiminterp *| 0.3.4 | /usr/share/octave/packages/optiminterp-0.3.4
parallel *| 2.2.0 | /usr/share/octave/packages/parallel-2.2.0
plot *| 1.1.0 | /usr/share/octave/packages/plot-1.1.0
splines *| 1.2.6 | /usr/share/octave/packages/splines-1.2.6
statistics *| 1.2.3 | /usr/share/octave/packages/statistics-1.2.3
strings *| 1.1.0 | /usr/share/octave/packages/strings-1.1.0
struct *| 1.0.10 | /usr/share/octave/packages/struct-1.0.10
symbolic *| 1.1.0 | /usr/share/octave/packages/symbolic-1.1.0
Also, you can list all packages. From octave documentation:
'list'
Show the list of currently installed packages. For example,
installed_packages = pkg ("list")
returns a cell array containing a structure for each installed
package.
If two output arguments are requested 'pkg' splits the list of
installed packages into those which were installed by the
current user, and those which were installed by the system
administrator.
[user_packages, system_packages] = pkg ("list")
The option "-forge" lists packages available at the
Octave-Forge repository. This requires an internet connection
and the cURL library. For example:
oct_forge_pkgs = pkg ("list", "-forge")
It's difficult to tell what you actually want to do with the output, but it is entirely possible that the pkg function will return information into a useful variable for you if you call it the right way. I recommend you check out the help for pkg function and look at the functional form and the type of things it will return
https://www.gnu.org/software/octave/doc/interpreter/Installing-and-Removing-Packages.html
For example:
[desc, flag] = pkg ("describe", "secs1d", "image")
will return flag which will tell you the installed or loaded state of the package.
Im having a hard time using QTOctave on Xubuntu.
Im trying to display a Bode Diagramm but I constantly get the error message from the Octave Terminal:
**warning: dcgain: unstable system; dimensions: nc=0, nz=2, mm=1, pp=1
error: 'create_set' undefined near line 141 column 16
error: called from:
error: /home/octave/control-1.0.11/__bodquist__.m at line 141, colum
n 14
error: /home/octave/control-1.0.11/bode.m at line 134, column 12
error: /home/M/Regelungstechnik/bodeTest.m at line 7, column 1
>>>**
And it is really not a difficult M file:
tau=1/5
z=1;
n=[tau,1, 0]
G=tf(z,n)
bode(G)
I am running it on my Xubuntu 14.04 Desktop and I have the following packages for Octave installed:
>>> pkg list
Package Name | Version | Installation directory
-------------------+---------+-----------------------
control *| 1.0.11 | /home/octave/control-1.0.11
fpl *| 1.2.0 | /home/octave/fpl-1.2.0
gnuplot *| 1.0.1 | /home/octave/gnuplot-1.0.1
ident *| 1.0.7 | /home/octave/ident-1.0.7
informationtheory *| 0.1.8 | /home/aronheck/octave/informationtheory-0.1.8
integration *| 1.0.7 | /home/octave/integration-1.0.7
missing-functions *| 1.0.2 | /home/octave/missing-functions-1.0.2
odebvp *| 1.0.6 | /home/octave/odebvp-1.0.6
plot *| 1.0.8 | /home/octave/plot-1.0.8
simp *| 1.1.0 | /home/octave/simp-1.1.0
I hope you can help me with my problem.
There can be two things why it's not working:
Do you get the same error when you run just Octave, i.e., without QtOctave? QtOctave was abandoned many years ago it is know to not work very well with newer Octave versions.
Your version of the control package is very very old. It seems that you have version 1.0.11 installed but the latest version is 2.8.0. I checked the ubuntu repositories for 14.04 and they have version 2.6.2.
Running Octave 3.8.2 with control version 2.8.0, your code works fine for me:
octave-cli-3.8.2:1> pkg load control
octave-cli-3.8.2:2> tau=1/5
tau = 0.20000
octave-cli-3.8.2:3> z=1;
octave-cli-3.8.2:4> n=[tau,1, 0]
n =
0.20000 1.00000 0.00000
octave-cli-3.8.2:5> G=tf(z,n)
Transfer function 'G' from input 'u1' to output ...
1
y1: -----------
0.2 s^2 + s
Continuous-time model.
octave-cli-3.8.2:6> bode(G)
I've some experience on Debian based distribution. There I've never had difficulties to install software like emacs and mercurial which I believe are quite standard packages in Linux OSes. Now I have a new laptop with Suse Enterprise. It seems that neither emacs nor mercurial are found in the list of installable packages...
I believe that I have to add some repository to zipper... So this is my actual list of repositories:
> zypper repos
# | Alias | Nome | abilitato | Attualizza
--+---------------------------------------------------+---------------------------------------------------+-----------+-----------
1 | HP-SBSO-Emergency-Channel | HP-SBSO-Emergency-Channel | Sì | Sì
2 | SUSE-Linux-Enterprise-Desktop-11-SP1 11.1.1-1.133 | SUSE-Linux-Enterprise-Desktop-11-SP1 11.1.1-1.133 | Sì | Sì
3 | hd-889c0513 | SuSE-Linux-Updates | Sì | Sì
4 | hd-aeb4361a | SuSE-Linux-Maintenance-Updates | Sì | Sì
I found many repository lists but don't understand how to add any of them (a HREF to a .repo seems needed). Any help would be appreciated.
On SLE11, emacs is in the SLE11-SP1-Updates repository
Repository: SLES11-SP1-Updates
Name: emacs
Version: 22.3-4.36.1
Arch: x86_64
Hersteller: SUSE LINUX Products GmbH, Nuernberg, Germany
Support Level: Level 3
Installiert: Nein
Status: nicht installiert
Installierte Größe: 48,9 MiB
Zusammenfassung: GNU Emacs Base Package
Beschreibung:
Basic package for the GNU Emacs editor. Requires emacs-x11 or
emacs-nox.
And mercurial is in the SDK repository:
Repository: SLE11-SDK-SP1-Pool
Name: mercurial
Version: 1.0.2-27.32
Arch: x86_64
Hersteller: SUSE LINUX Products GmbH, Nuernberg, Germany
Support Level: Unbekannt
Installiert: Nein
Status: nicht installiert
Installierte Größe: 2,8 MiB
Zusammenfassung: Scalable Distributed SCM
Beschreibung:
Mercurial is a fast, lightweight source control management system
designed for efficient handling of very large distributed projects.
Get the SDK dvd from suse.com (login required)
You add repositories either via "zypper ar" or via yast.
You can only get update repositories if you have a valid subscription with SUSE.