Using Boolean Logic on Vectors

Using Boolean Logic on Vectors - How to use logic vectors as input to Boolean Experssions - Сообщения

#1 Опубликовано: 28.02.2016 23:26:20
Eddie

Eddie

0 сообщений из 2 понравились пользователям.

Группа: User

Hi everyone,

I am a relative novice at SMath Studio, so please forgive any display of ignorance.

I want to use Boolean expressions with vectors, but I cannot find a way of doing this. It is relatively simple with Mathcad, but I want to use SMath Studio, as I am a student, and I am trying to show other students how to simplify logic circuits using Boolean algebra.

For example, the circuit described by ( A&B )|((B&C)&(B|C)) can be simplified to B&(B|C). I want to be able to call the three vectors (A, B, C) and have the output of the two expressions shown as a vector of zeros and ones (in this example the output vectors are the same as the simplified second-expression is the equivalent of the more-complex first-expression.

Is there a way of achieving this in SMath Studio.

Thanks in advance.

Eddie
#2 Опубликовано: 29.02.2016 13:00:11
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

Hello EddieAust,

To accomplish your task you have to use the programming loops (for, while) available in the right panel, and then you have to apply your logic to any element of the matrix/vector.

You can take a look here for an alternative way: Language-Integrated Query (Linq)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Опубликовано: 29.02.2016 13:51:39
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Hello Eddie,

As far as I have experimented/compared Mathcad 11/Smath,
they work both the same way, though Smath does not accept
the "maybe YES/maybe NO" logic unlike Mathcad apparently
more flexible but not correct in real instances.
Neither one of these applications will imitate Programmable
Logic Controllers. Hardly imitate a push button Start/Stop.

The attached is a good example of logic within a "While loop"
You have so many random pts in the circle, depending upon "h"
all the randoms are in there, but in larger/smaller area,
i.e: a random compressor. Great to demonstrate the gas
molecules compressed or relaxed.

Jean

Inst_Segment Partial Random.sm (39 КиБ) скачан 47 раз(а).
#4 Опубликовано: 01.03.2016 09:10:23
Eddie

Eddie

0 сообщений из 2 понравились пользователям.

Группа: User

Hi Davide and Jean,

Thanks for your prompt replies, I appreciate your efforts.

Unfortunately, as I am showing other students how to use logic, I wanted something simple for them to use. In Mathcad 15 it is easy to show an original expression, and alongside it a simplified expression resulting from using Boolean Algebra, and I was hoping that SMath Studio would do the same, as I do not expect my fellow students to pay for a copy of Mathcad. Unfortunately, SMath Studio does not have to option of a simple use for logic on vectors as does Mathcad 15 (see attached .jpg image from Mathcad 15 - I hope this works, as this is the first time I have tried to attach an image).

Once again, thanks for your assistance.

Regards
Eddie

Mathcad15_Logic.jpg


#5 Опубликовано: 01.03.2016 10:13:30
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Eddie: like this !

Jean

Utilities Matrix Vectorise LOGIC .sm (44 КиБ) скачан 66 раз(а).
Utilities Matrix Vectorise Friendly .sm (17 КиБ) скачан 61 раз(а).
3 пользователям понравился этот пост
Alexander O. Melnik 01.03.2016 14:29:00, Davide Carpi 01.03.2016 13:59:00, sergio 01.03.2016 13:47:00
#6 Опубликовано: 01.03.2016 13:46:05
sergio

sergio

115 сообщений из 329 понравились пользователям.

Группа: User

if you want to automate the operation, then define two functions as those suggested by Jean. The aesthetic result is not comparable, but the functionality yes
sergio
[albumimg]1428[/albumimg]
2 пользователям понравился этот пост
frapuano 01.03.2016 14:54:00, Davide Carpi 01.03.2016 13:55:00
#7 Опубликовано: 01.03.2016 16:59:22
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

... automate much simpler and more general.

Jean

Utilities Matrix Vectorise LOGIC .sm (12 КиБ) скачан 55 раз(а).
1 пользователям понравился этот пост
ioan92 03.03.2016 10:12:00
#8 Опубликовано: 04.03.2016 14:35:35
Andrey Ivashov

Andrey Ivashov

2270 сообщений из 3734 понравились пользователям.

Группа: Super Administrator

FYI, I'm currently working on this feature.

vectorize_1.png

Regards.
8 пользователям понравился этот пост
Ernesto 04.03.2016 16:51:00, Radovan Omorjan 05.03.2016 03:54:00, Jaan Praks 28.03.2016 17:20:00, ioan92 04.03.2016 14:38:00, Вячеслав Мезенцев 04.03.2016 14:46:00, Alexander O. Melnik 04.03.2016 14:56:00, Davide Carpi 04.03.2016 15:11:00, sergio 04.03.2016 16:30:00
#9 Опубликовано: 05.03.2016 00:49:42
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

FYI, I'm currently working on this feature.



Yes, please, thank you Andrey.
Maybe next: fft and picture operator.
In the mean time, "Vectorise EXPRESS"
for user to adapt wrt applicable project

Jean

Utilities Matrix Vectorise EXPRESS.sm (27 КиБ) скачан 54 раз(а).
#10 Опубликовано: 05.03.2016 18:59:22
Andrey Ivashov

Andrey Ivashov

2270 сообщений из 3734 понравились пользователям.

Группа: Super Administrator

Regarding initial question: see vectorize(..) function into new nightly build release: http://en.smath.info/forum/yaf_postst7329_SMath-Studio-0-98-5908--05-March-2016.aspx

Regards.
1 пользователям понравился этот пост
Davide Carpi 05.03.2016 21:05:00
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений