La recherche a retourné 22 résultats

par niccolo
jeu. août 13, 2020 7:05 pm
Forum : Xcas - English
Sujet : solve([a+b=6, a/b=1/2], a)
Réponses : 1
Vues : 427

solve([a+b=6, a/b=1/2], a)

I don't understand this:

solve([a+b=6, a/b=1/2], a) returns []
solve([a+b=6, a/b=1/2], [a]) returns []
solve([a+b=6, a/b=1/2], [a,b]) returns [[2,4]] (correctly)

Is this a bug?

(Is this somehow related to solve([2*x=2,x=1.0], x) ?)
par niccolo
lun. juin 22, 2020 3:23 pm
Forum : Bugs
Sujet : "autosave" feature moves focus to the application
Réponses : 4
Vues : 938

Re: "autosave" feature moves focus to the application

(A year has passed.) An update: I've upgraded to Ubuntu 20.04, and installed xcas 1.5.0 (using Ubuntu's official package manager). The problem has returned: 'xcas' steals the focus. Highly annoying . I found two solutions: (1) Before switching to some other app, save the session. (2) Before switchin...
par niccolo
dim. juin 23, 2019 1:23 pm
Forum : Xcas - English
Sujet : solve([2*x=2,x=1.0], x)
Réponses : 1
Vues : 714

solve([2*x=2,x=1.0], x)

solve([2*x=2,x=1.0], [x]) returns [[1.0]].
solve([2*x=2,x=1.0], x) returns [].

Is this a bug?

(I know I can write "1" instead of "1.0", and then I get the solution in either case. My "complaint" here is about having to write "[x]" instead of "x".)
par niccolo
mer. juin 19, 2019 12:33 am
Forum : Xcas - English
Sujet : A problem formatting a list returned from solve()
Réponses : 4
Vues : 716

Re: A problem formatting a list returned from solve()

Aaahhh.....

I think I understand why xcas displays [[1,2,3]] the way it does: it's a matrix. One that happens to have a single row.

Still, it's problematic that we can't tell the difference between [1,2,3] and [[1,2,3]].

Is there a hidden configuration option to "fix" this?
par niccolo
mar. juin 18, 2019 10:44 pm
Forum : Xcas - English
Sujet : A problem formatting a list returned from solve()
Réponses : 4
Vues : 716

Re: A problem formatting a list returned from solve()

I've found the problem:

solve() returns a list of lists. So I have to use 'solution[0]', not 'solution'.

I wasn't aware of this because xcas displays this:

[[1,2,3]]

the same as this:

[1,2,3]

So I had no way of knowing there was a list inside :-(

That's a big problem.

Why does xcas do this?
par niccolo
mar. juin 18, 2019 7:27 pm
Forum : Xcas - English
Sujet : A problem formatting a list returned from solve()
Réponses : 4
Vues : 716

A problem formatting a list returned from solve()

I have a solution to some problem: solution := [z-4, 25-2*z, z] And I'm trying to see what happens when 'z' runs from 0 to 9, so I do: makelist(x->subst(solution, [z=x]), 0, 9) This works ok. 'xcas' displays the big list as a nice matrix which is easy to read. The problem is that in reality my 'solu...
par niccolo
mer. juin 12, 2019 6:44 pm
Forum : Xcas - English
Sujet : Automatically load my own functions on startup
Réponses : 6
Vues : 966

Re: Automatically load my own functions on startup

I did this by using the following: I modified runxcas.en to: Thanks. I considered this solution, but it's flawed for me: I usually launch xcas from the directory I work in, as I want xcas to save the file to the diretcory I'm in, without me navigating there. But if I load it with a template file, i...
par niccolo
mer. juin 12, 2019 6:13 pm
Forum : Xcas - English
Sujet : solve([x=1,y=2],[x,y])
Réponses : 2
Vues : 481

Re: solve([x=1,y=2],[x,y])

I suspect I understand why. It's because "x=1" (the solution I was expecting) isn't a solution to the set of equations. In other words, it's as if giac does "subst(equation_set, solution)" and if not *all* the equations in equation_set evaluate to 'true', it's not considered a solution. E.g., "subst...
par niccolo
mer. juin 12, 2019 5:57 pm
Forum : Xcas - English
Sujet : solve([x=1,y=2],[x,y])
Réponses : 2
Vues : 481

solve([x=1,y=2],[x,y])

Hello!

The following works:

Code : Tout sélectionner

solve([x=1,y=2],[x,y])
But when I do:

Code : Tout sélectionner

solve([x=1,y=2],[x])
I don't get any solution. Why is that?
par niccolo
mar. mai 28, 2019 12:48 pm
Forum : Xcas - English
Sujet : vector^2 without a warning?
Réponses : 3
Vues : 645

Re: vector^2 without a warning?

Just follow the hint: replace ^ by .^ like (pointB - pointA).^2 Given the vector [a,b,c], I want to arrive at a^2 + b^2 + c^2. [a,b,c]^2 does this (but gives a warning). [a,b,c].^2 gives [a^2, b^2, c^2]. Not good. I know I can do "[a,b,c]*[a,b,c]" or "sum([a,b,c].^2)", but I was wondering if there'...
par niccolo
mar. mai 28, 2019 10:30 am
Forum : Xcas - English
Sujet : vector^2 without a warning?
Réponses : 3
Vues : 645

vector^2 without a warning?

I often need to "dot product" a vector with itself. E.g., "(pointB - pointA)^2". But when I do this I see the warning: Warning, ^ is ambiguous on non square matrices. Use .^ to apply ^ element by element. Is there a way to get rid of this warning? I know I can do "dot(expr, expr)" instead, but then ...
par niccolo
dim. mai 26, 2019 5:44 pm
Forum : Bugs
Sujet : "autosave" feature moves focus to the application
Réponses : 4
Vues : 938

Re: "autosave" feature moves focus to the application

Thanks: I upgraded to 1.5.0 and the problem is gone.
par niccolo
dim. mai 26, 2019 3:24 pm
Forum : Bugs
Sujet : "autosave" feature moves focus to the application
Réponses : 4
Vues : 938

"autosave" feature moves focus to the application

I'm using xcas 1.2.3 (of Ubuntu 18.04). xcas has an autosave feature: every minute, or so, it saves the session (if changes exist in it), to "~/xcas_auto_XXXXXXXX.xws". Unfortunately, this seemingly nice feature makes life unbearable for Linux users: After autosaving, xcas moves the focus to its win...
par niccolo
dim. mai 26, 2019 3:13 pm
Forum : Xcas - English
Sujet : Automatically load my own functions on startup
Réponses : 6
Vues : 966

Re: Automatically load my own functions on startup

Thanks for replying. I checked your solution. It works for 'giac' only (the console app), not for 'xcas' (the GUI app). For example, I added ";myfunc(x):=x*666;" to ~/.xcasrc. 'giac' then recognizes "myfunc", but 'xcas' doesn't. Is there a solution that works for 'xcas' as well? For reference, here'...
par niccolo
dim. mai 26, 2019 12:42 pm
Forum : Xcas - English
Sujet : Automatically load my own functions on startup
Réponses : 6
Vues : 966

Automatically load my own functions on startup

Is it possible to define my own functions in some file, and have it loaded automatically each time 'giac' or 'xcas' start?