Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.1K Views
|
6 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Accessing matrix elements and evaluating terms multiplied by zero

Posted 1 year ago

I'm totally new to Mathematica. I defined a simple matrix and I tried to query the elements of the matrix but I keep getting an error as shown in the figure attached. I don't know if I'm doing a mistake in the syntax or this is a bug. Error

As a follow up to this question, another simple issue I'm facing is when I tried to evaluate some quantities I get a huge output with most of the terms multiplied by zero. Why is mathematica not making them zero, even when used with the commands Simplify or FullSimplify.

Please let me know where I'm making the mistake. Thanks.

POSTED BY: Arun KG
6 Replies

You are probably using the dot . as multiplication, but in WL it means scalar product of vectors. For example {1, 1} . (0) does not give zero. Plain multiplication is made with *

POSTED BY: Gianluca Gorni
Posted 1 year ago

Yes that was the mistake I was making. Thanks for the help! It works now :)

POSTED BY: Arun KG
Posted 1 year ago
POSTED BY: Eric Rimbey
Posted 1 year ago

Ah that makes sense, it is such a silly mistake on my part XD. Thanks for clearing that up. As to the follow-up I mean the results I show in the image attachedZeroNotEvaluated

There are terms here that are clearly zero since they are multiplied by zero, but Mathematica is not evaluating them. How do I fix this minor issue? Please help. Thanks.

POSTED BY: Arun KG
Posted 1 year ago

You'll get better answers if you post code rather than pictures, because that allows people to copy-paste your code into their own notebooks to play around with. All I can do is make a guess based on your picture. My guess is that those are Dot products, and Dot doesn't evaluate when the arguments are not of compatible dimensions.

POSTED BY: Eric Rimbey
Posted 1 year ago

Yes it works correctly now. Thanks a lot of the help! And yes I will start sharing the notebook from the next time. I'm totally new to this so I'm just learning how things are done here, thanks a lot for the patience.

POSTED BY: Arun KG
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard