The closest that I can come, to making Maxima On Android display an animation.

Maxima On Android really wasn’t designed, either to allow interactive rotation of 3D Plots, or, to allow animated, 3D Plots. But let us put ourselves in the position that it is the chosen Computer Algebra System, and that the user wants ‘interactive 3D Plots’.

What Maxima On Android has to offer natively, is a 3D Plot, but displayed from a static perspective. In fact, I’ve read that the way it works is, that Maxima On Android plots to a PNG File, and then displays the PNG File in a secondary window, from which the user may switch back to the CAS window / worksheet.

Various efforts I’ve made have failed, to get the viewing window for the plots to animate. One possible reason could be, the possibility that Maxima On Android actually waits, until the entire worksheet has finished executing, before allowing the viewing window to be opened. Repeated, iterative plotting locks up the app, until the loop has finished, at which point, at best, the last version of the plot can be viewed.

The following was the best that I could do, to get this port of Maxima to plot interactively:

 


i: 0$

Frame():= block (
        plot3d(sin(%pi*(x+(i/4)))*cos(%pi*y), [x, -1, 1], [y, -1, 1]),
        i: i + 1
)$

Frame()$

 

This Maxima Batch File / Script requires some participation by the user, to work. The user may Load it from within the Maxima On Android GUI, after which the first iteration of the plot will display. After that, the user needs to tap on the ‘Back’ arrow, to get back to the worksheet. Then, tapping on the last ‘Frame()’ command, will cause it to display in the command field. Then, tapping ‘Enter’ will cause the next iteration of the plot to appear.

From the second point on, in the process, that the user has tapped on the ‘Back’ arrow, the command ‘Frame()’ should still be in the command field. Therefore, ‘Enter’ can just be tapped again, and the process repeated as often as desired.

(Updated 7/05/2020, 10h50… )

Continue reading The closest that I can come, to making Maxima On Android display an animation.

Print Friendly, PDF & Email

A simple 3D animation created with Maxima.

One of the things which I find myself doing quite often is, to be undertaking some sort of task on the computer(s), that I know is possible, but, not knowing in advance what the correct syntax and semantics are, to perform this task. This tends to take me on some sort of search on the Web, and I’ll find that other people have undertaken similar tasks, but not, a task with the same combination of parameters, as my task.

Thus, Web pages can be found according to which 2D animations have been created using a free, open-source Computer Algebra System named “Maxima”. Other Web pages may explain how to create various types of (static) 3D plots. But there may just be lacking examples out there, on how to create the 3D plot, but to animate it.

Using Maxima, there may be more than one way, such as, to keep refreshing the 3D plot over a time interval. But I find that such solutions tend to be second-rate, because of their use of busy-wait loops, as well as the possibility that they may otherwise be wasteful of computing power. I think that the best way, perhaps, to get Maxima to generate an animated 3D plot, could be, in the form of an animated GIF File (of course, as long as there isn’t an excess of frames to this animation).

Thus, the recipe that seems to work is as such:

 


load(draw)$

scenes: []$

for i thru 20 do (
    scenes: append(scenes,
            [gr3d(explicit(sin(%pi*(x+(i/10)))*cos(%pi*y),
                x, -1, 1, y, -1, 1))]
        )
)$

draw(
    delay = 10,
    file_name = "wavy",
    terminal = 'animated_gif,
    scenes
)$

 

The script outputs a file named ‘wavy.gif’ in the same folder, as whatever folder it was originally stored in. In some cases, the GIF File may appear in the user’s home directory, or even, in a temporary directory that’s difficult to find, unless the user also gives a full-path name for the file.

And, this is the GIF File that results:

wavy

 

Caution:

My most recent posting had to do, with a version of Maxima that had been ported to Android. The example above will not work with that version of Maxima. In fact, I can really only be sure that this feature works under Linux, which is the O/S that Maxima was mainly designed to run on. Any directives to ‘plot()’ or ‘draw()’ open a separate GNU-Plot window, which behaves in the predictable way under Linux, including the user’s ability to rotate the 3D plots interactively. AFAIK, commands to change to a non-default ‘terminal’ (for drawing and/or plotting) will fail on other platforms.

But, There is also a Windows or Mac alternative to using this platform, which mainly presents itself in the application ‘wxMaxima’. Here, the functions ‘wxdraw2d()’ and ‘wxdraw3d()’ replace those that open a separate window, and both embed their results in the wxMaxima worksheet. In order to make this more versatile, wxMaxima also offers the functions ‘with_slider_draw()’, ‘with_slider_draw3d()’, ‘wxanimate_draw()’, and ‘wxanimate_draw3d()’.

Potential ‘wxMaxima’ users will find the documentation for how to script that Here.

Continue reading A simple 3D animation created with Maxima.

Print Friendly, PDF & Email

In certain situations, Maxima can actually solve a sextic equation.

For readers who don’t know, a sextic equation is a polynomial of the 6th degree. As the subject line suggests, recent versions of Maxima can find symbolic solutions to those, if used correctly, and, if the sextic actually has ‘an exact, analytical solution’, which is also referred to sometimes as ‘a symbolic solution’.

Whether these analytical solutions are actually more useful than numeric approximations, remains an unanswered question.

What has happened to me is, that I’ve tried to use the method shown below, to cause Maxima to display the solution, and that due to what amounted to a typo, I had given it a polynomial which was visually similar to the one shown, but which was also different in some small way, so that the only solution which Maxima displayed, was the original polynomial, thus implying that Maxima was not able to solve an altered one. The reason this happened is easy to explain…

Not all polynomials of the 6th degree actually have an analytical solution. If given an example that does not, Maxima will fail to display one. All polynomials of the 4th degree actually have an analytical solution, but it may easily be too complex for consumer-grade Computer Algebra Systems (CAS) to output. But, by the time the user is asking a CAS to solve a cubic, he should be able to expect this form of a solution to be output.

The sextic below is actually the product of two cubics, which also explains why Maxima was able to solve it. The reader will need to enable JavaScript:

  • From my site, And
  • From MathJax.org,

To be able to view the worksheet:

 


 

(Updated 7/04/2020, 13h30… )


Continue reading In certain situations, Maxima can actually solve a sextic equation.

Print Friendly, PDF & Email

Another possible reason, why my Google Pixel C might have started crashing.

One of the facts which I posted about recently was, that My Google Pixel C Tablet had started crashing, roughly every one or two months. Because I haven’t really installed any new software on it, and because the most recent System Update took place sometime in mid-2019, I had assumed that the recent malfunctions could be due to some sort of hardware problem.

The fact that this tablet, which I only bought in 2017, was starting to become unstable, was partially also, why I have recently acquired a Samsung Galaxy Tab S6 tablet, as an eventual replacement.

But, there is in fact another possible explanation, for the crashes of the Pixel C. Until 2019, that tablet had received System Updates roughly once every month. It might just be that, due to many memory leaks, that tablet really needs to be rebooted once per month, and if nothing else, System Updates also resulted in soft reboots. The failure to perform any soft reboots, may be what’s leading to hard reboots. Only, hard reboots are dangerous, because too many of them can lead to file system corruption.

In that regard, I’m hoping that the new Tab S6, which has Android 10 installed, will offer a possible preventive measure, in the fact that it can be scheduled in advance, to reboot automatically, let’s say once per week. If that feature works out as expected, then the tablet in question may indeed last longer than the Pixel C did.

Really, I think it strange, that an Android tablet would crash – or hard-boot – because it was not soft-booted for more than a month. After all, my phones, also being Android devices, have usually been able to run for more than 2 months, without requiring any reboots, and when those finally do receive a soft-boot, it’s part of their System Update.

Dirk

 

Print Friendly, PDF & Email