DCMotor example @named output throwing Latex error on analysis points

Running the ModelingtoolkitStandardLibrary example DCMotor https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/tutorials/dc_motor_pi/

Running the code as is it throws below error in the @named model = DCMotor():

Error message from Latexify

Failed to show value:

AssertionError: latexify does not support objects of type ModelingToolkitStandardLibrary.Blocks.AnalysisPoint.

The error is thrown from the analsysis points “:y” and “:u” in the example. Removing them from the connect()s OR suppressing the output from the @named assignment by adding;, the example runs fine.

Is this a problem with my Latex or Julia somewhere?

Julia 1.11.1

[0c46a032] DifferentialEquations v7.14.0
[f6369f11] ForwardDiff v0.10.36
[961ee093] ModelingToolkit v9.47.0
[16a59e39] ModelingToolkitStandardLibrary v2.16.0
[1dea7af3] OrdinaryDiffEq v6.89.0
[91a5bcdd] Plots v1.40.8
[7f904dfe] PlutoUI v0.7.60
[44cfe95a] Pkg v1.11.0

I don’t think it’s you. Can you share a reproducer?

It’s literally the ‘DCMotor with Speed Controller’ example copy and pasted. Or do you mean something else by ‘reproducer’ ?

Is there something special about your environment, for example using Jupyter or Pluto?

Ah: I’m running in Pluto notebook, on a Win11 machine in Firefox browser.

I see, so it must be something with the Pluto latex display in this case. I’ll see if I can recreate it in Pluto.

Interesting. @baggepinnen how would you display this?

Similar to how it’s displayed in the terminal I guess, as text. Connections without analysis points are just rendered as text IIRC?

Yes, so we probably need to add that the latexify of an analysis point is to just print mathtt its name

Track the issue here: [WIP] Add Latexify extension and AnalysisPoint support by ChrisRackauckas · Pull Request #339 · SciML/ModelingToolkitStandardLibrary.jl · GitHub

1 Like

Thank you Chris.