TransWikia.com

Notation parse rule does parse when it acts as a argument

Mathematica Asked by eason on August 10, 2021

https://reference.wolfram.com/language/Notation/tutorial/NotationSymbolizeAndInfixNotation.html

Notation[boxes ⟹ expr] set boxes to be parsed to expr

I want a simplified notation for entering a TransferFunctionModel by Notaton.
But the Notation rule doesn’t parse expression when the expression as one argument

is there any missing step?

enter image description here

I found the subtle problem by the FullForm

enter image description here

2 Answers

It's not very clear what problem you are trying to solve here. Normally, you would use such a call to the Notation package to introduce a pretty way of displaying some Mathematica object. Here that is unnecessary as Mathematica does what you are asking automatically.

I infer that you are wanting a simplified notation for entering a TransferFunctionModel. One way to do this is with

totf[expr_] := TransferFunctionModel[{{expr}}, First[Cases[expr, _Symbol, ∞]]]

This lets you do

enter image description here

In my opinion, the Notation package is probably best left to advanced users of Mathematica. I would advise you to learn the basics first. However, you can use the function totf to define a notation.

enter image description here

Correct answer by mikado on August 10, 2021

the missing step is

s = $CellContext`s

enter image description here

Answered by eason on August 10, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP