Skip to content

Float32 types are automatically converted to Float64 #3553

Closed
@TorkelE

Description

@TorkelE
using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
using OrdinaryDiffEq
@parameters p d
@variables X(t)
eqs = [D(X) ~ p - d*X]
@mtkbuild osys = ODESystem(eqs, t)
u0 = [X => 1.0f0]
ps = [p => 1.0f0, d => 2.0f0]
oprob = ODEProblem(osys, u0, 1.0, ps)
sol = solve(oprob)

typeof(oprob[X]) # Float64
eltype(sol[X]) # Float64

This one popped out in the Catalyst tests with the latest MTK release. Among other things it should be a major problem for GPU parallelisation.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions