Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline paul-l  
#1 Posted : 12 December 2019 15:41:20(UTC)
paul-l

Rank: Newbie

Groups: Registered
Joined: 12/12/2019(UTC)
Posts: 2
United Kingdom

Hello,

Will the case function evaluate all the potentially true cases in it? There seams to be a feature where as soon as one case is evaluated as true then the output from that case is returned independent on weather following cases rule the first out.

im trying to construct a piecewise flow characteristic for a number of different applications where cases will be true dependant on the input. In certain situations the lower of the possibilities needs to be returned.
Smath case behave example.sm (19kb) downloaded 36 time(s).

any thoughts?

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 12 December 2019 18:37:46(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: paul-l Go to Quoted Post
Will the case function evaluate all the potentially true cases in it ?

Just by inspection of your document: answer is NO ... Why ?
1. define completely #≤# ... #≥# piecewise elements.
Smath does not forgive/forget.
2. If not plot ... zap units.
Come back as needed ... Jean.

Smath case behave example.sm (20kb) downloaded 30 time(s).

Offline paul-l  
#3 Posted : 12 December 2019 19:13:00(UTC)
paul-l

Rank: Newbie

Groups: Registered
Joined: 12/12/2019(UTC)
Posts: 2
United Kingdom

Originally Posted by: Jean Giraud Go to Quoted Post
Smath does not forgive/forget.


Thanks Jean, this I am discovering!

The plots seam to work fine with the units - and its a good sense check for me.
Coming from MCD I was hoping that the case structure would work in the same way as a line form with ifs in (but no elses) and check each case in turn. I'll just have to be more careful about the relative importance / order of the cases.
Offline Jean Giraud  
#4 Posted : 12 December 2019 22:12:33(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: paul-l Go to Quoted Post
Thanks Jean, this I am discovering!

The plots seam to work fine with the units - and its a good sense check for me.
Coming from MCD I was hoping that the case structure would work in the same way as a line form with ifs in (but no elses) and check each case in turn. I'll just have to be more careful about the relative importance / order of the cases.

Smath does not have the single line if MCD ... not yet coded.
Good it works with units.
Bolean is often a good candidate.
In some instances Smath will not complain incomplete <, >.
In other instances [I only know 1 in years], must be incomplete.
Cheers, welcome ... Jean.
Offline Razonar  
#5 Posted : 12 December 2019 22:53:49(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: paul-l Go to Quoted Post


The plots seam to work fine with the units - and its a good sense check for me.


Hi. This is a better way for use units, function and plots.

Smath case behave example.sm (21kb) downloaded 72 time(s).

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 13/12/2019(UTC)
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.