# DCMotor example @named output throwing Latex error on analysis points

**URL:** <https://discourse.julialang.org/t/dcmotor-example-named-output-throwing-latex-error-on-analysis-points/121752>\
**Category:** Modelling & Simulations\
**Tags:** modelingtoolkit\
**Created:** [October 25, 2024, 3:50pm UTC](https://discourse.julialang.org/t/dcmotor-example-named-output-throwing-latex-error-on-analysis-points/121752 "2024-10-25T15:50:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![RobbesU](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robbesu/32/212459_2.png) [@RobbesU](https://discourse.julialang.org/u/RobbesU)\
**Post date:** [October 25, 2024, 3:50pm UTC](https://discourse.julialang.org/t/dcmotor-example-named-output-throwing-latex-error-on-analysis-points/121752/1 "2024-10-25T15:50:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 25, 2024, 4:18pm UTC](https://discourse.julialang.org/t/dcmotor-example-named-output-throwing-latex-error-on-analysis-points/121752/2 "2024-10-25T16:18:17Z")

</div>

> [@RobbesU](#):
>
> Is this a problem with my Latex or Julia somewhere?

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

---

<div class="post-metadata">

**Author:** ![RobbesU](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robbesu/32/212459_2.png) [@RobbesU](https://discourse.julialang.org/u/RobbesU)\
**Post date:** [October 25, 2024, 4:27pm UTC](https://discourse.julialang.org/t/dcmotor-example-named-output-throwing-latex-error-on-analysis-points/121752/3 "2024-10-25T16:27:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 25, 2024, 4:29pm UTC](https://discourse.julialang.org/t/dcmotor-example-named-output-throwing-latex-error-on-analysis-points/121752/4 "2024-10-25T16:29:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RobbesU](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robbesu/32/212459_2.png) [@RobbesU](https://discourse.julialang.org/u/RobbesU)\
**Post date:** [October 25, 2024, 4:31pm UTC](https://discourse.julialang.org/t/dcmotor-example-named-output-throwing-latex-error-on-analysis-points/121752/5 "2024-10-25T16:31:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 25, 2024, 4:40pm UTC](https://discourse.julialang.org/t/dcmotor-example-named-output-throwing-latex-error-on-analysis-points/121752/6 "2024-10-25T16:40:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 27, 2024, 4:06pm UTC](https://discourse.julialang.org/t/dcmotor-example-named-output-throwing-latex-error-on-analysis-points/121752/7 "2024-10-27T16:06:02Z")

</div>

Interesting. @baggepinnen how would you display this?

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [October 27, 2024, 4:47pm UTC](https://discourse.julialang.org/t/dcmotor-example-named-output-throwing-latex-error-on-analysis-points/121752/8 "2024-10-27T16:47:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 27, 2024, 5:27pm UTC](https://discourse.julialang.org/t/dcmotor-example-named-output-throwing-latex-error-on-analysis-points/121752/9 "2024-10-27T17:27:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 28, 2024, 8:20am UTC](https://discourse.julialang.org/t/dcmotor-example-named-output-throwing-latex-error-on-analysis-points/121752/10 "2024-10-28T08:20:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RobbesU](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robbesu/32/212459_2.png) [@RobbesU](https://discourse.julialang.org/u/RobbesU)\
**Post date:** [November 6, 2024, 3:57pm UTC](https://discourse.julialang.org/t/dcmotor-example-named-output-throwing-latex-error-on-analysis-points/121752/11 "2024-11-06T15:57:11Z")

</div>

Thank you Chris.
