Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hello. I'm new to Mathcad, and I'm trying out some symbolic variable definitions. Can I define a variable like this? :
I have tried to mimic the w^2 term, but I am unable to set an assignment statement.
Thanks in advance.
Solved! Go to Solution.
Use the literal subscript.
And if you experience troubles, show and attach your worksheet.
What are you trying to do after you made the assignment?
If you really try to ASSIGN, you can only use the variable itself, not its squared value.
Use the literal subscript.
And if you experience troubles, show and attach your worksheet.
What are you trying to do after you made the assignment?
If you really try to ASSIGN, you can only use the variable itself, not its squared value.
Being new to Mathcad, I've tried to absorb as much as I can from the tutorials, but sometimes it's as simple as understanding what I can/can't do. I repeated the logic you showed above, and it seems to work fine. The reason that I wanted to write the formula in the form that I did is because I may be solving for w_c1, c_c1, or u_c1, depending on the conditions of the problem that I'm solving. Obviously, I would just edit the "solve" statement to change the variable that I'm solving for.
Any thoughts on that approach, or better ways to set this up?
If you need both solutions, you probably have to stick with the symbolic "solve". If a single numeric result suffices, you may also use either a numeric solve block or the "root" command in one of its two flavours.
You may assign the result of the symbolic evaluation a variable and access the single values using the vector/matrix index (in the pic a numeric eval as well a symbolic one is shown)
You may as well turn the calculation into a function of the two input values and use it to compare the results for different inputs:
Again you can use this function either with symbolic or with numeric evaluation:
In case only the non-negative result is of interest you may use the "assign" modifier. Primes symbolic is rather weak compared to real symbolic math programs like Maple or Mathematica and so "assign" only works the way you may intend it if you are lucky.
Here you see a rather silly result because Prime should know that the sum of the squares of real numbers can't be negative:
But, surprise! When we actually use this function we get exactly what we intended - the non-negative solution only.
Using for variable name, is also can, but not recommended.