Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Expression for variables

Please login with a confirmed email address before reporting spam

I'm very new to this software and I'm now looking through the application libraries and tutorials. In one of the tutorials I come across, the modelling gyroscopic effect tutorial, there is a section where a variable is defined in the definition section of the model tree, and the expression reads mbd.hgj3.e1z, and I am expected to type this out. I was wondering what that is and how do I know that exactly. If I had attempted to type that out on my own I wouldn't have known that.


2 Replies Last Post Oct 2, 2019, 5:27 p.m. EDT
Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago Oct 2, 2019, 10:02 a.m. EDT
Updated: 5 years ago Oct 2, 2019, 5:28 p.m. EDT

Hi,

You can use the Find tool (press Ctrl+F), if you have set up all the physics. When you then add mbd.hgj3.e1z, you will find that it is a variable for the Inner Gimbal-Spinning Disc feature. You also need to activate the Equation View from the Show menu in the Model Builder toolbar. You can then find it in the Variables list in the Inner Gimbal-Spinning Disc node's Equation View subnode, where it is described as the z component of the joint axis.

I will make a suggestion to explain this variable in this tutorial example's step-by-step instructions.

Best regards,

Magnus Ringh, COMSOL

Hi, You can use the Find tool (press Ctrl+F), if you have set up all the physics. When you then add `mbd.hgj3.e1z`, you will find that it is a variable for the Inner Gimbal-Spinning Disc feature. You also need to activate the **Equation View** from the **Show** menu in the Model Builder toolbar. You can then find it in the Variables list in the **Inner Gimbal-Spinning Disc** node's **Equation View** subnode, where it is described as the z component of the joint axis. I will make a suggestion to explain this variable in this tutorial example's step-by-step instructions. Best regards, Magnus Ringh, COMSOL

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago Oct 2, 2019, 5:27 p.m. EDT
Updated: 5 years ago Oct 2, 2019, 5:29 p.m. EDT

Magnus suggestion is the way to go for 'reverse engineering', but what if you were to set up that variable 'theta' without knowing that you were looking for mbd.hgj3.e1z?

In this scenario you know that you are looking for the orientation of the axis of Inner Gimbal-Spinning Disc, but not what its variable is called.

Then you have two options:

  1. Go to Equation View under Inner Gimbal-Spinning Disc and try to find it. You can sort the Description column in alphabetical order.

  2. Use the Replace Expression dialog, and try to find it in a more structured manner (see screenshot). This, however assumes that the variable you are looking for is announced as a postprocessing variable. Most variables that you as a user would be interested in can probably be found this way. In order to have access to the Replace Expression dialog, you must have some results. Run a Get Initial Value if there is no solution yet.

Regards,
Henrik

-------------------
Henrik Sönnerlind
COMSOL
Magnus suggestion is the way to go for 'reverse engineering', but what if you were to set up that variable 'theta' without knowing that you were looking for mbd.hgj3.e1z? In this scenario you know that you are looking for the orientation of the axis of **Inner Gimbal-Spinning Disc**, but not what its variable is called. Then you have two options: 1. Go to **Equation View** under **Inner Gimbal-Spinning Disc** and try to find it. You can sort the Description column in alphabetical order. 2. Use the **Replace Expression** dialog, and try to find it in a more structured manner (see screenshot). This, however assumes that the variable you are looking for is announced as a postprocessing variable. Most variables that you as a user would be interested in can probably be found this way. In order to have access to the **Replace Expression** dialog, you must have some results. Run a **Get Initial Value** if there is no solution yet. Regards, Henrik

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.