Newbie problem - Using a range of angles inside a cosine function

Newbie problem - Using a range of angles inside a cosine function - Trying to use cos(variable angle) - Mensajes

#1 Publicado: 3/10/2012 6:41:00
jjuddgb

jjuddgb

0 me gusta en 2 mensajes.

Grupo: User

Hi,
I'm trying to convert some old Mathcad files into SMath but am stuck with what must be an elementary problem, I've looked at various tutorials but can't find a solution, no doubt due to my own incompetence.

I am defining the following variables: angle:=72 and varangle:= 0, angle/2..360

In Mathcad if I then define: test(varangle):= cos(varangle) the output of test(varangle) displays correctly in a column.

If I try the same in SMath I receive either an 'argument must be scalar' or 'fill in all empty elements' error.

Thanks for any advice.

Screenshots of Mathcad and SMath attached.

btw, great software.
Mathcad - output.pdf (26,44 KiB) descargado 995 vez(es).
#2 Publicado: 3/10/2012 7:49:27
kilele

kilele

134 me gusta en 397 mensajes.

Grupo: User

Correct me if i'm wrong, trigonometric functions don't support arrays currently.
For now, you can do something like this.
cosinOfArray.sm (5,04 KiB) descargado 1879 vez(es).
A 1 usuarios les gustó este mensaje
1752 28/9/2024 14:44:00
#3 Publicado: 3/10/2012 11:09:17
jjuddgb

jjuddgb

0 me gusta en 2 mensajes.

Grupo: User

Thank you kilele
#4 Publicado: 3/10/2012 11:31:19
Fridel Selitsky

Fridel Selitsky

520 me gusta en 451 mensajes.

Grupo: User

You can convert the vector into a system (by w3b5urf3r_reloaded)
Regards, Ber7
https://smath.com/wiki/GetFile.aspx?File=cosinOfArray%5b1%5d.rar
A 1 usuarios les gustó este mensaje
Davide Carpi 3/10/2012 13:33:00
#5 Publicado: 3/10/2012 11:33:28
Fridel Selitsky

Fridel Selitsky

520 me gusta en 451 mensajes.

Grupo: User



Regards, Ber7

#6 Publicado: 28/9/2024 14:44:50
1752

1752

0 me gusta en 3 mensajes.

Grupo: User

Wrote

Correct me if i'm wrong, trigonometric functions don't support arrays currently.
For now, you can do something like this.



did arrays appear in trigonometric functions?
#7 Publicado: 28/9/2024 16:09:41
sergio

sergio

127 me gusta en 342 mensajes.

Grupo: User

now you can use the "vectorize" function, which you also find in the side panel, and perform the trigonometric function element by element.
sergio

28-1369.png
A 1 usuarios les gustó este mensaje
1752 28/9/2024 16:30:00
#8 Publicado: 29/9/2024 22:22:50
Martin Kraska

Martin Kraska

1.361 me gusta en 2.275 mensajes.

Grupo: Moderator

An alternative to the vectorize() function is the use of index vectors.

They, however, only work if they are used in a definition.

Worksheet1.png
Worksheet1.sm (5,28 KiB) descargado 1640 vez(es).
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
A 1 usuarios les gustó este mensaje
sergio 29/9/2024 23:37:00
  • Nuevos mensajes
  • Sin mensajes nuevos