Ask Your Question

Ingo's profile - activity

2024-03-05 21:22:41 +0200 received badge  Popular Question (source)
2024-03-05 21:22:41 +0200 received badge  Notable Question (source)
2023-04-26 12:50:09 +0200 received badge  Famous Question (source)
2022-10-18 17:16:24 +0200 asked a question Geometric Algebra: Getting the coefficients of multivector

Geometric Algebra: Getting the coefficients of multivector I am using Ga from galgebra.ga. How can I get the coefficient

2021-08-17 22:48:38 +0200 received badge  Notable Question (source)
2020-10-30 11:06:47 +0200 received badge  Good Question (source)
2020-10-28 18:31:05 +0200 received badge  Commentator
2020-10-28 18:31:05 +0200 commented answer Simplification Methods Survey

My initial problem was not whether there is a function that handles this specific term, but whether there is some guidance to find functions that may handle some given term, so I don't think this was overkill.

If there is no automatic selection of a simplification method, the approach to define a set of rewrite rules and apply them is helpful, preferably encapsulated in a single function which takes a term and a ruleset and applies it. https://wiki.sagemath.org/symbolics/r... is close to that, except that it has a fixed ruleset.

.

I confess that I am looking for an easy-to-use function as I am not a Sage expert.

2020-10-28 18:18:02 +0200 commented answer Simplification Methods Survey

Thanks, that's indeed a helpful function. Experimenting with it I wonder why

from sage.symbolic.constants import Constant
constants=var('a1,a2,b,c,L')
custom_simplify((a1*b)^c/(L*a1*z+a1*b)^c)

does not work, but it is working if L is replaced by d.

2020-10-28 18:01:20 +0200 commented answer Simplification Methods Survey

I wouldn't mind if the system asks for assumptions to work (as desolve does).

2020-10-28 14:31:02 +0200 received badge  Nice Question (source)
2020-10-27 19:32:18 +0200 asked a question Simplification Methods Survey

I noted that SageMath has many ways to simplify expressions, including simplify_full(), full_simplify and canonicalize_radical. Is there a survey nd usage guide available for these? In particular, I am trying to simplify an expression as in

constants=var('a1,a2,b,c')

((a1*b)^c/(a2*b)^c).simplify_full()

such that I get (a1/a2)^c, but without success.

2020-09-08 16:45:56 +0200 received badge  Popular Question (source)
2020-09-08 14:24:49 +0200 asked a question How to use surface_to_stl

https://trac.sagemath.org/ticket/7744 describes a function surface_to_stl to export 3D surfaces. It has the following example:

    sage: x,y,z = var('x,y,z')
    sage: a = implicit_plot3d(x^2+y^2+z^2-9, [x,-5,5], [y,-5,5],[z,-5,5])
    sage: a
    sage: f=file.open("foo.stl",'w')
    sage: f.write(surface_to_stl(a))
    sage: f.close()

When I run it, I get Name 'file' is not defined. When I remove 'file', I can print, but get "name 'surface_to_stl' is not defined.

So, what is the correct way to use surface_to_stl and what are the limitations of this function or of the method .save('foo.stl')?

2020-06-08 13:15:08 +0200 commented answer Connected Selectors

Excellent! Let me thank you with this URL for comparing the basic COVID-19 data from any two countries, which now applies your advice

2020-06-07 14:08:41 +0200 commented answer Connected Selectors

Thanks! Indeed, nesting of interacts opens up many possibilities I wasn't aware of.

That leads me to another problem: Nested interacts are drawn in nested boxes which become smaller when nesting gets deeper.

Are there options to style these boxes, in particular when used in SageCells, to avoid the boxes' borders and left/right margins/paddings?

2020-06-06 22:36:57 +0200 asked a question Connected Selectors

In a Jupyter Notebook with SageMath kernel I'd like to offer the user an interactive for selecting a country by first selecting a region and then a country, from a dropdown list of countries in that region.

Ideally both selections would occur in one cell and the options for the second selector adapt as soon as the first selection is made. Alternatively I may have both selectors in different cells, but then the second cell should be executed whenever the variable selected in the first cell changes.

Would that be possible?

2019-09-30 23:36:33 +0200 received badge  Nice Question (source)
2019-09-21 11:15:22 +0200 answered a question Controlling animation speed

I found that the 3rd parameter of sxrange apparently determines the step size of the animation parameter and a slowdown can be achieved by using more frames, i.e. smaller step size. In my case, where I animate a compbination of 2 implicit_3d objects, using the 3rd parameter I only get a message

WARNING: 1 intermediate output message was discarded.

as output while the animation renders well if I don't use a 3rd parameter

2019-09-21 10:45:20 +0200 asked a question Controlling animation speed

How can I reduce the speed of replay of animated plots (in CoCalc)? Ideal would be a player with a frame rate slider and play/pause. Addendum: I found that apparently I can reduce the speed by adding more frames by reducing the step size of the animation with the 3rd parameter of sxrange in the definition of the animation(? is this correct?).

However, when I use this parameter with value 0.4 in my animation (combination of 2 implicit_plot3d objects) I only get a warning

WARNING: 1 intermediate output message was discarded.

while the animation renders well if I don't use this parameter or use it with value 0.5. The rendering of each of the images separately with a step size of 0.1 works.

2019-09-18 22:22:55 +0200 commented answer Intersection of implicitely defined surfaces

I confirm your example works in CoCalc with developement kernel. It intersects a surface defined by an equation with a region defined by an inequality. When I replace the inequality with an equation to view the curves on the intersection of both manifolds I see nothing. Can I get that with some other parameters?

Moreover, in Cocalc with the development kernel I get another warning that hurts my document:

show(LatexExpr("f_r(x,y)=\Re(f(x+iy))=")) yields a deprecation warning without a hint how to correct it:

DeprecationWarning: invalid escape sequence \R

2019-09-18 14:04:22 +0200 commented answer Intersection of implicitely defined surfaces

That example yields in SageCell and in CoCalc

AttributeError: 'sage.plot.plot3d.implicit_surface.ImplicitSurface' object has no attribute 'add_condition'

2019-09-17 21:29:36 +0200 received badge  Nice Question (source)
2019-09-16 22:40:30 +0200 received badge  Editor (source)
2019-09-16 22:36:53 +0200 asked a question Intersection of implicitely defined surfaces

Is there a general way to visualize the space curve defined by the intersection of 2 implicitely defined surfaces?

I know, this has been discussed here before with the following suggested solutions:

  1. Visualize all equations in the same plot - this has the disadvantage that surfaces - even if opaque, distract attention and may obstruct the view on the intersection curves

  2. Combine the defining equations into a system of euations and solve it, present the solutions as parametric plots - this doesn't work with complex surfaces where Sage cannot solve the system.

I know, some 3D objects have an intersection() method, but apparently not those generated by implicit_plot3d. But maybe, someone has another solution?

2019-09-16 18:45:25 +0200 commented answer 2D implicit_plot Problem

Yes, I know - my objective was exactly to demonstrate, how the intersection of a plane with a closed surface develops from being empty to a curve and back to empty while moving the plane through the surface. So I cannot restrict $d$ and that single failure point destroys the message - it shouldn't be there, I guess.

2019-09-15 12:38:06 +0200 asked a question 2D implicit_plot Problem

Consider the following cell content:

var('x,y,d')

f(d,x,y)=(0.577350269189626*d + 0.7071067811865475*x + 0.408248290463863*y)^2 + (0.577350269189626*d - 0.7071067811865472*x + 0.40824829046386296*y)^2 + (0.577350269189626*d - 0.816496580927726*y)^2 - 1

@interact
def _(d=slider(-2,2,default=1.73,label="$d$",step_size=0.1)):

    show(N(f(d,0,0)))
    show(implicit_plot(f(d,x,y)==0,(x,-2,2),(y,-2,2)))

The plot draws a point at (0,0), though the value of f(1.73,0,0) is far from zero. When working with fixed value of d instead of slider, a warning is issued that no contour could be found, but the point is drawn nevertheless. I’d have expected that nothing is drawn.

Background: I'd like to draw the students' attention to what happens when touching a surface with a plane- i. e. before - when NOTHING (not even a single point!) is in the plane - , at touch point and with intersection.

In a larger context I also observed sometimes that the point at (0,0) appears only after moving the slider a bit.

2019-09-10 14:12:56 +0200 commented answer How to re-use value from interact?

Great, thanks!

2019-09-10 13:58:52 +0200 received badge  Student (source)
2019-09-10 12:17:24 +0200 asked a question How to re-use value from interact?

I have 3 subsequent SageMath code cells C1, C2, C3 in a Jupyter notebook.

  1. C1 sets a value a=1
  2. C2 has an interact widget (say a slider for a1) using the value of a as default
  3. C3 should assign the current value of a1 to a and proceed.

What do I have to write in C3 to access the current value of a1 in C2?

2019-08-25 23:38:56 +0200 commented answer Slider for fractions of pi

The current value from the sliderr is displayed to the right of the sliderr - that would show the value of x_r, but I should like to see there that value augmented by $\cdot2\cdot \pi$.

2019-08-22 19:24:25 +0200 asked a question Slider for fractions of pi

I'd like to have in @interact a slider for (0,2pi) with stepsize 0.05pi that shows as label $\alpha$ and the current value only in the format $x*\pi$