Skip to content

How to make SymbolicNumericIntegration.integrate not convert exp(1) to floating point? #21

@nasser1

Description

@nasser1

reference

https://discourse.julialang.org/t/basic-question-on-julia-symbolic-how-to-keep-exp-1-as-is-and-not-convert-it-to-a-floating-point-number/86476

Using this code

using Symbolics
using SymbolicNumericIntegration
using SymbolicUtils

@syms x
expr=x*Symbolics.Term(exp,[1])
julia> SymbolicNumericIntegration.integrate(expr,x)
(1.3591409142295223(x^2), 0, 2.220446049250313e-16)

As can be seen, exp(1) before the call remained exp(1) because of using Symbolics.Term(exp,[1]) to prevent evaluation.

But inside/during the call SymbolicNumericIntegration.integrate it was converted at one point to floating point.

Is there a way to keep it as exp(1) so the result should be exp(1)*x^2/2 ?

Julia 1.8 on Linux

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