Skip to content

Simplification and Latexify Issues #1474

@nathanrboyer

Description

@nathanrboyer

I am trying to make a Quarto document to demonstrate solving simple symbolic equations.
I am getting the correct answer, but the expressions look a mess.

Image

  1. The equation eq display is not latexifying correctly.
    a. It is not in math font.
    b. The subscripts are shown with underscores.
  2. The solution sol display shows the subscripts correctly, but ...
    a. sqrt is shown as "ssqrt" with an extra s for some reason
    b. There is a 1/2 pulled out front that makes no sense, even when I explicitly ask for simplify, expand, and simplify_fractions.
# Cell 1
using Symbolics, Nemo, Latexify
@variables v_f, v_i, y_f, y_i, a
eq = v_f^2 ~ v_i^2 + 2 * a * (y_f - y_i)
latexify(eq)

# Cell 2
sol = symbolic_solve(eq, v_f)
sol = simplify.(sol[1], expand=true, simplify_fractions=true)
latexify(sol)

# Cell 3
d = Dict(
    v_i => 20,
    v_f => 0,
    a => -32.2,
    y_i => 0,
    y_f => 6.2,
)
v_f_unique = substitute(sol, d)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions