5

I've searched and found this but it wasn't helpful. To be direct, I'm completely unfamiliar with what the OP in that thread was even attempting to do, though I may have a similar problem.

I have a package of AddOns which I once used from a book co-authored by Eric Schulz, "Visual Linear Algebra." Particularly, the AddOns which I used most heavily were the ones which allowed me to do elementary row operations on matrices for an intro linear algebra class. I have seen a discussion here which offers a work-around, but I am wondering if there is an elegant way to make these addons work in Mathematica 12. Attempting to load the package of addons using Needs[...] generates a cascade of error messages, which I do not know how to remedy.

I'm willing to learn what I can to salvage what can reasonably be salvaged from these addons, but not even sure where to start working/looking. The instructions which used to work called for a folder with some notebooks and other files to be installed where Mathematica 5 looked for addons, which in OS X is /Library/Mathematica/Applications in the proper user folder. I installed that file as instructed, but Mathematica 12 doesn't behave like Mathematica 7 or 8 did with those commands.

Added for clarity, the instructions call for two commands to be executed:

Quit[ ]
Needs["VisualLA`"]

The error messages which appear are: Error Messages

Update:

Following the instructions of xzczd, I installed the Arrow and Colors packages. In /Library/Mathematica/Applications (in the same user folder where the VisualLA folder resides in OS X) I now find Arrow.wl and Colors.wl, but executing the

Quit[ ]
Needs["VisualLA`"]

commands still results in precisely the same sequence of error messages as pictured above.

I opened the main package, Library.m and find the following:

    BeginPackage["VisualLA`Library`",{
    "Global`",
    "Graphics`Colors`",
    "Graphics`Arrow`",
    "Graphics`ImplicitPlot`",
    "NumericalMath`SplineFit`",
    "LinearAlgebra`Orthogonalization`",
    "LinearAlgebra`MatrixManipulation`",
    "Utilities`FilterOptions`"}]

Needs["GraphicsGraphics"];

I saved the Library.m package after making the edit for Splines and now I am getting this:

Post-edit behavior

Final Update

With many, many thanks to xzczd, got it working, on Windows 10, at least. It generates a flurry of error messages when executing the

Quit[ ]
Needs["VisualLA`"]

commands, even more than I posted upstream, and the formatting related spew after executing the commands for row operations, but they work, which I greatly appreciate. I am so thankful, as this allows me to easily salvage a bunch of notebooks that I put away many years ago, and is greatly appreciated.

  • 1
    Is the package available on Internet? What warnings do you encounter when loading the package? – xzczd Mar 12 '21 at 00:45
  • 1
    Mathematica has changed so much between V5 and V12 the I believe that trying to salvage the code from the package is not worth the effort. I am convinced that there is no *elegant* way to make these addons work in Mathematica 12. – m_goldberg Mar 12 '21 at 03:44
  • 1
    One can only @ one user in one comment so you need to @m_goldberg in a separate comment. (As to the usage of @ , you may want to read this: https://meta.stackexchange.com/a/43020/284701 ) Then, as requested in my last comment, can you add the warning messages you've encountered to the question? Currently it's hard to help. Also, you may consider directly contacting the author, Eric Schulz is a member of Wolfram Community: https://community.wolfram.com/web/ericschulz/home – xzczd Mar 15 '21 at 02:42
  • @xzczd, not that I am aware of, unless one of the authors has released them. – Zippy The Pinhead Mar 16 '21 at 00:07
  • @m_goldberg, I expect you are correct, just based on the volume of error messages. – Zippy The Pinhead Mar 16 '21 at 00:07
  • Eric should still be around. He's done work at wolfram and his last school I remember him being at was walla Walla college. Just go to the source. He's meticulous and probably has updated his packages. – zeattledave Mar 16 '21 at 07:45
  • Actually I did email him directly, yet without response. I'm sure he's busy, and it wouldn't surprise me if he got more than a few similar emails over the span of a week. Several of the palettes that install with Mathematica were authored by him, no? – Zippy The Pinhead Mar 16 '21 at 16:29
  • 1
    You need to execute the Internal\InheritedBlock[…]everytime you load the package in a fresh kernel. If you don't bother to, consider saving the code piece inSystemOpen@"init.m"`, then every time you start Mathematica, the package will be loaded automatically. – xzczd Mar 17 '21 at 04:54
  • So in other words, the optimal sequence would be Quit[] and then Internal[...] and then Needs[...]? – Zippy The Pinhead Mar 17 '21 at 19:38
  • Will upgrading to a new version cause the custom folders in [...]Program Files\Wolfram Research\Mathematica\12.1\AddOns\Applications\ to be swept away? – Zippy The Pinhead Mar 17 '21 at 19:47
  • 1
    You don't need to execute Needs[...] again, the Needs@"VisualLA\"is already inInternal`InheritedBlock[…]`. "Will upgrading to a new version cause the custom folders in [...]Program Files\Wolfram Research\Mathematica\12.1\AddOns\Applications\ to be swept away?" Yes. – xzczd Mar 18 '21 at 03:15

1 Answers1

6

The package isn't available on Internet so I can't check, but the following should make the package work in v12 (in theory). Feel free to comment if you find something still doesn't work properly.

According to the info in the question, the package VisualLA` seems to have called 9 obsolete packages, they're

"Graphics`Colors`"
"Graphics`Arrow`"
"Graphics`ImplicitPlot`"
"NumericalMath`SplineFit`"
"LinearAlgebra`Orthogonalization`"
"LinearAlgebra`MatrixManipulation`"
"Utilities`FilterOptions`"
"Graphics`Graphics`"
"Statistics`DataManipulation`"

7 of them are still available in Wolfram Library Archive:

Graphics`Colors` Legacy Standard Add-On Package

Graphics`Arrow` Legacy Standard Add-On Package

Graphics`ImplicitPlot` Legacy Standard Add-On Package

Graphics`Graphics` Legacy Standard Add-On Package (If you care about warnings (they're harmless in principle), remove the "Graphics`Common`GraphicsCommon`", and definitions for Histogram and BarChart. )

LinearAlgebra`Orthogonalization` Legacy Standard Add-On Package

LinearAlgebra`MatrixManipulation` Legacy Standard Add-On Package

Statistics`DataManipulation` Legacy Standard Add-On Package

Download and install them. Since the VisualLA` package has called these packages using e.g. << Graphics`Arrow`, we need to create 3 folders Graphics, LinearAlgebra and Statistics in

(* Execute the following code in a notebook, 
   then the folder will be opened, at least in Windows. *)
FileNameJoin@{$BaseDirectory, "Applications"} // SystemOpen

and place the first 4 packages in Graphics, subsequent 2 in LinearAlgebra, and the last 1 in Statistics. (For more info check the Details and Options section of document of Get. )

As to NumericalMath`SplineFit`, according to the compatibility information Compatibility/tutorial/NumericalMath/SplineFit, one way to update it is to replace all the NumericalMath`SplineFit` in the package with Splines`; Utilities`FilterOptions` has been discussed quite a bit in this site, you may refer to those posts to modify the package. But since manual modification is tedious (esp. FilterOptions, which has been called in numerous obsolete packages! ), let's try something different. Instead of modifying the package, we load the package with the following code:

Internal`InheritedBlock[{Get, Needs}, Unprotect[Get, Needs];
 Get["NumericalMath`SplineFit`"] := Get["Splines`"];
 Get["Utilities`FilterOptions`"] := "";
 Needs["Utilities`FilterOptions`"] := "";
 System`FilterOptions[a_, b___] := Sequence @@ FilterRules[{b}, Options[a]];

Needs@"VisualLA`" (* Notice the package is already loaded here. *)]

If you don't bother to manually execute the code piece everytime you load the package, consider saving it in SystemOpen@"init.m"(* Execute this in a notebook *), then every time you start Mathematica, the package VisualLA` will be loaded automatically.

xzczd
  • 65,995
  • 9
  • 163
  • 468
  • Greatly appreciate this, I will dig in and see what can be done. – Zippy The Pinhead Mar 16 '21 at 05:17
  • I installed the GraphicsColors and GraphicsArrow packages and noticed Colors.wl and Arrow.wl showed up in /Library/Mathematica/Applications in the proper user folder. However, executing the Needs["VisualLA`"] command after installing them still results in the same cascade of error messages. I expected it would generate fewer of them? – Zippy The Pinhead Mar 16 '21 at 05:41
  • I edited the OP to include some additional information. – Zippy The Pinhead Mar 16 '21 at 05:45
  • 1
    @ZippyThePinhead Oops, I should have checked more carefully. Since the package VisualLA\`` has called the packages using something like<< Graphics`Arrow``, the menu item Install isn't that convenient now. We need to create a folder Graphics in /Library/Mathematica/Applications and place the 2 packages inside it. – xzczd Mar 16 '21 at 06:22
  • 1
    @ZippyThePinhead I've added possible way to handle the rest obsolete packages. Have a look. – xzczd Mar 16 '21 at 07:26
  • Does the folder structure need to change significantly for a Windows 10 installation? – Zippy The Pinhead Mar 16 '21 at 16:28
  • 1
    @ZippyThePinhead The code FileNameJoin@{$BaseDirectory, "Applications"} // SystemOpen should work on all the platforms. – xzczd Mar 16 '21 at 16:44
  • Forgive my ignorance, but while attempting to follow your instructions, I had a couple of questions. First, in searching "GraphicsImplicitPlot" for the ContourSmoothing -> True command, I was unable to locate it. I searched every occurrence of "contour" in the package and did not find the option. Can I assume this is not an issue? – Zippy The Pinhead Mar 17 '21 at 01:15
  • Second, I have never needed to edit a package before, so when you write "remove the definitions for Histogram and Barchart," this means delete many lines of code? I'm guessing Barchart is 20-30 lines and Histogram is a few hundred lines. So your instructions amount to deleting everything between "(* Note: Histogram calls an internal RangeCounts..." and "(* end Histogram *)"? In the case of Histogram, obviously, and similarly for Barchart? – Zippy The Pinhead Mar 17 '21 at 01:27
  • 1
    @ZippyThePinhead Oh, seems that Implicit package has already been updated in Wolfram Library Archive (I directly checked the package in v5.2), so, yes, you don't need to modify the package. As to Graphics\Graphics`` package, if you don't care about warning messages, you don't need to edit the package (in principle), then you'll see several warnings about Histogram and BarChart because they're built-in and Protected nowadays. – xzczd Mar 17 '21 at 01:33
  • 1
    Finally, regarding the commands above, "Internal`InheritedBlock[{Get, Needs},..." and "FileNameJoin@{$BaseDirectory, "Applications"} // SystemOpen," are these inserted into a package or into a notebook? If the former, where? Just out of curiosity I pasted the latter into a notebook and executed it, but I received a "Failed" error message. However this was in OS X, and it worked in Windows. – Zippy The Pinhead Mar 17 '21 at 01:34
  • 1
    @ZippyThePinhead Both are to execute in notebook. (The first for loading the package VisualLA, and the last for opening the folder for placing the package. ) I've no experience for OS X so not quite sure why it fails, but it's quite handy a way to open certain folder in Windows. – xzczd Mar 17 '21 at 01:40
  • 1
    One other question: the Windows instructions for VisualLA state that the folder with the packages, etc., written by Eric Schulz should be placed in C:\Program Files\Wolfram Research\Mathematica\5.1\AddOns\Applications. I went looking for the equivalent for 12.1 and created the folders you instructed in [...]Program Files\Wolfram Research\Mathematica\12.1\AddOns\Applications, which is not the directory that your "FileNameJoin@{$BaseDirectory, "Applications"} // SystemOpen" command opened. The latter directory was ProgramData\Mathematica\Applications. I just want to be sure where to install. – Zippy The Pinhead Mar 17 '21 at 01:42
  • 1
    @ZippyThePinhead It depends on how the package is written, in most cases both directory should be OK, but I'd suggest placing it in Program Files\Wolfram Research\Mathematica\12.1\AddOns\Applications\ because VisualLA might have used global variable like $TopDirectory. – xzczd Mar 17 '21 at 02:01
  • Worked on Windows 10, I updated the OP. Many, many thanks. Super-helpful. Greatly appreciated. – Zippy The Pinhead Mar 17 '21 at 04:14