Using Boolean Logic on Vectors

Using Boolean Logic on Vectors - How to use logic vectors as input to Boolean Experssions - Mensajes

#1 Publicado: 28/2/2016 23:26:20
Eddie

Eddie

0 me gusta en 2 mensajes.

Grupo: 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 Publicado: 29/2/2016 13:00:11
Davide Carpi

Davide Carpi

1.443 me gusta en 2.936 mensajes.

Grupo: 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 Publicado: 29/2/2016 13:51:39
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: 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,42 KiB) descargado 1367 vez(es).
#4 Publicado: 1/3/2016 9:10:23
Eddie

Eddie

0 me gusta en 2 mensajes.

Grupo: 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 Publicado: 1/3/2016 10:13:30
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Eddie: like this !

Jean

Utilities Matrix Vectorise LOGIC .sm (44,69 KiB) descargado 1352 vez(es).
Utilities Matrix Vectorise Friendly .sm (17,01 KiB) descargado 1348 vez(es).
A 3 usuarios les gustó este mensaje
Alexander O. Melnik 1/3/2016 14:29:00, Davide Carpi 1/3/2016 13:59:00, sergio 1/3/2016 13:47:00
#6 Publicado: 1/3/2016 13:46:05
sergio

sergio

127 me gusta en 342 mensajes.

Grupo: 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]
A 2 usuarios les gustó este mensaje
frapuano 1/3/2016 14:54:00, Davide Carpi 1/3/2016 13:55:00
#7 Publicado: 1/3/2016 16:59:22
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

... automate much simpler and more general.

Jean

Utilities Matrix Vectorise LOGIC .sm (12,05 KiB) descargado 1371 vez(es).
A 1 usuarios les gustó este mensaje
ioan92 3/3/2016 10:12:00
#8 Publicado: 4/3/2016 14:35:35
Andrey Ivashov

Andrey Ivashov

2.343 me gusta en 4.056 mensajes.

Grupo: Super Administrator

FYI, I'm currently working on this feature.

vectorize_1.png

Regards.
A 8 usuarios les gustó este mensaje
Ernesto 4/3/2016 16:51:00, Radovan Omorjan 5/3/2016 3:54:00, Jaan Praks 28/3/2016 17:20:00, ioan92 4/3/2016 14:38:00, Вячеслав Мезенцев 4/3/2016 14:46:00, Alexander O. Melnik 4/3/2016 14:56:00, Davide Carpi 4/3/2016 15:11:00, sergio 4/3/2016 16:30:00
#9 Publicado: 5/3/2016 0:49:42
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: 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,61 KiB) descargado 1382 vez(es).
#10 Publicado: 5/3/2016 18:59:22
Andrey Ivashov

Andrey Ivashov

2.343 me gusta en 4.056 mensajes.

Grupo: 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.
A 1 usuarios les gustó este mensaje
Davide Carpi 5/3/2016 21:05:00
  • Nuevos mensajes
  • Sin mensajes nuevos