I try to load the Zeilberger algorithm in maxima but I get this error
(%i1) load(Zeilberger);
file_search1: Zeilberger not found in file_search_maxima,file_search_lisp.
-- an error. To debug this try: debugmode(true);
I tried this
(%i1)file_search_maxima: append(["/usr/share/maxima/.../share/contrib/Zeilberger"],file_search_maxima);
(%i2) load(Zeilberger);
but doesn't work.
the same thing for other packages.
NB: I use ubuntu
Related
To learn how to use Maxima and its syntax, I am trying to solve a simple problem: find f(x) such that (f(x) + f(y))/2 = f((x+y)/2).
One of my attempts involved using diff and ode2:
diff( (f(x)+f(y))/2, x) = 'diff( f((x+y)/2), x);
ode2(%,f,x);
This gives the message "not a proper differential equation". How can I avoid this error in Maxima and solve the problem?
a=1
% Construct the trasfer function
num=[a 1 3]
den=[1 2 10]
G=tf(num,den)
% Impulse response
impulse(G)
% Step response
step(G)
When I click on 'run' this error appears "error: Order numerator >= order denominator"
If you follow the error on the terminal, it suggests that line 95 in imp_invar.m of the control package is to blame. (if you don't know where this was installed, you can find out by typing pkg list in your terminal)
If you convert this error to a warning, the code continues. Obviously you do so at your own risk. I would make a backup of the original .m file just in case.
Note that the same code run on matlab does not issue any error or warning (which is odd in itself, given the stark note about invalid impulse invariance in this scenario from octave ... there is a reference quoted inside imp_invar.m if you're interested.)
I tried function "at" with some function inside it and then give the output to some variable. Maxima successfully differentiated the expression, but then "at" fails and the output is "at( --some successfully done function--, z=l)=0". I need "at" to work properly, to give the result to a variable.
(%i34) a: 45*z^2*l-1; /*expression*/
eq1: at(diff(a, z, 1), z = l)=0; /*giving the meaning of the operations to eq1*/
at(diff(a, z, 1), z = l)=0; /*trying the same without giving the result to a variable*/
ev(eq1, eval); /*trying ev*/
(a) l*z^2* 45-1
(eq1) at(2*l*z* 45,z=l)=0
(%o34) 2*l^2* 45=0
(%o35) at(2*l*z* 45,z=l)=0
So when I don't give the result of at to other variables, it's fine but when I try to - it fails even with additional evaluation. How does that work? And also this was tried on Linux. On Windows I don't have the same problem.
I get the following output. Isn't %o3 what you are looking for?
(%i2) a: 45*z^2*l-1;
2
(%o2) 45 l z - 1
(%i3) eq1: at(diff(a, z, 1), z = l)=0;
2
(%o3) 90 l = 0
I am working w/ Maxima 5.42.2 on MacOS. What does build_info(); report on your Linux system? Some Linux distributions package an ancient version of Maxima; maybe you can get a newer version. It is actually pretty easy to build Maxima from a source tarball on a Linux system; I can help if you want to go down that road.
The last line is giving me error.I am trying to solve the Titanic dataset problem of kraggle.
The error is in above line. You forgot to close the brackets there.
Change this:
print(clf.predict(x_test[1:10])
to
print(clf.predict(x_test[1:10]))
And even after that you will get error in the line:
clf.f1_score(...)
The above line is wrong, it should be:
f1_score(y_test, clf.predict(x_test))
I'm writing a Lua script in Redis, and have one line that's breaking everything:
local to_remove = redis.call('ZRANGE', KEYS[1], -5, "+inf")
Returns:
redis.exceptions.ResponseError: Error running script (call to f_f1d95d2e103f00220a476f0ef2a2abc798682c55): ERR value is not an integer or out of range
This goes away completely if I replace "+inf" with any number. I've tried "inf" and "-inf" as well, and none of these work. Ideas?
Nevermind. I'm an idiot. Should have just used "-1" in place of "inf." ZRANGE just doesn't support inf, and -1 gives the same results I would have expected from inf. Hopefully this helps someone trying to do the same later on.