Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline krugerdude  
#1 Posted : 28 May 2019 02:56:17(UTC)
krugerdude

Rank: Newbie

Groups: Registered
Joined: 28/05/2019(UTC)
Posts: 3
New Zealand

I'm having issues with using variables, I have a bunch of equations that have a single variable (end goal is to plot this) and when I use variable functions/matrices they make the outputs wrong somehow.
I have no issues when setting x to be a single number, but when I set x to a range of numbers the outputs go wrong.


https://imgur.com/a/B4Y8Sod


https://imgur.com/a/Qk3IxY8

Am I just doing it wrong?

Edited by user 28 May 2019 03:02:20(UTC)  | Reason: Fixing screen shots

Offline Jean Giraud  
#2 Posted : 28 May 2019 03:49:02(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,952
Canada

Was thanked: 707 time(s) in 553 post(s)
Originally Posted by: krugerdude Go to Quoted Post
I'm having issues with using variables, I have a bunch of equations that have a single variable (end goal is to plot this) and when I use variable functions/matrices they make the outputs wrong somehow.
I have no issues when setting x to be a single number, but when I set x to a range of numbers the outputs go wrong.

Please: attach the Smath work sheet to see what you may be missing.

Offline krugerdude  
#3 Posted : 28 May 2019 04:37:14(UTC)
krugerdude

Rank: Newbie

Groups: Registered
Joined: 28/05/2019(UTC)
Posts: 3
New Zealand

Smath Data Ranges.sm (695kb) downloaded 19 time(s).

Here is the smath file, the important parts are at the bottom.
Offline PompelmoTell  
#4 Posted : 28 May 2019 11:09:27(UTC)
PompelmoTell


Rank: Advanced Member

Groups: Registered
Joined: 23/12/2011(UTC)
Posts: 170
Italy
Location: italy

Was thanked: 64 time(s) in 54 post(s)
you have to use the vectorize function
vectorize28-05-19.png

sergio
thanks 1 user thanked PompelmoTell for this useful post.
on 28/05/2019(UTC)
Offline Jean Giraud  
#5 Posted : 28 May 2019 15:33:46(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,952
Canada

Was thanked: 707 time(s) in 553 post(s)
Originally Posted by: krugerdude Go to Quoted Post
Here is the smath file, the important parts are at the bottom.

...added at the end of your document.

draw.PNG

Smath Data Ranges.sm (701kb) downloaded 6 time(s).
Offline krugerdude  
#6 Posted : 29 May 2019 05:26:56(UTC)
krugerdude

Rank: Newbie

Groups: Registered
Joined: 28/05/2019(UTC)
Posts: 3
New Zealand

Thanks for your help, the vectors did the trick (although I don't understand why they have to be vectors).

Here is the end result,

Capture1.GIF

Capture2.GIF
Offline PompelmoTell  
#7 Posted : 29 May 2019 11:41:53(UTC)
PompelmoTell


Rank: Advanced Member

Groups: Registered
Joined: 23/12/2011(UTC)
Posts: 170
Italy
Location: italy

Was thanked: 64 time(s) in 54 post(s)
Obviously it's not a trick.
That way you ask to perform the evaluation element by element contained in the vector.
In the wrong way you used, perform the evaluation in a matrix sense (following the rules on matrix operations) because x1 is a matrix (vector).

sergio
Offline uni  
#8 Posted : 29 May 2019 15:52:57(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 956
Man
Russian Federation

Was thanked: 871 time(s) in 490 post(s)
Another form. The arrow is a vector summation.

2019-05-29_17-53-49.png
Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://money.yandex.ru/to/410013245578758/100
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.