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 LordMike  
#1 Posted : 27 October 2009 15:57:22(UTC)
LordMike


Rank: Advanced Member

Groups: Registered
Joined: 24/10/2009(UTC)
Posts: 52
Man
Location: Denmark

Hey,

How would I specify an interval for a function?
Is an if absolutely needed?

Example:
solve(cos(x)=0, x)

I would like an answer between 0 and 2*PI.

In my calculator, it can be accomplished as such:
solve(cos(x)=0, x {0, 2*PI}) = 1.57...

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

Offline Andrey Ivashov  
#2 Posted : 27 October 2009 16:19:35(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Just use 3 and 4 arguments:
solve(cos(x);x;0;2*π)=mat(1,5707963;4,712389;2;1)
Offline omorr  
#3 Posted : 27 October 2009 16:24:52(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
LordMike wrote:
Hey,

How would I specify an interval for a function?
Is an if absolutely needed?

Example:
solve(cos(x)=0, x)

I would like an answer between 0 and 2*PI.

In my calculator, it can be accomplished as such:
solve(cos(x)=0, x {0, 2*PI}) = 1.57...

The range is specified as the third and fourth argument.
solve(cos(x)≡0;x;0;2*π)=mat(1,5708;4,7124;2;1)
(Pay attention on Boolean equal to, and function argument separator - here at the forum we must us ";" with MATH tag, but you can use either ";" or "," depending on regional settings)
If you do not specify the root find range, it is defined by default in Tools=>Options=>Roots(range). If you keep say the range [-100,100], with solve(cos(x)=0, x)= you will have lots of roots there.

Regards,
Radovan

EDIT: BTW, you can visit this wiki page

Edited by user 27 October 2009 22:04:10(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline LordMike  
#4 Posted : 27 October 2009 16:25:11(UTC)
LordMike


Rank: Advanced Member

Groups: Registered
Joined: 24/10/2009(UTC)
Posts: 52
Man
Location: Denmark

smath wrote:
Just use 3 and 4 arguments:
solve(cos(x);x;0;2*π)=mat(1,5707963;4,712389;2;1)


Thanks Good
Users browsing this topic
Guest
Similar Topics
how to apply a conditional to an interval (Questions)
by TIAGO_ENG2012 06/01/2022 00:03:42(UTC)
Grid Canvas X_Y Intervals (Samples)
by Jean Giraud 07/09/2019 16:30:13(UTC)
Vectors Intervals (Samples)
by Jean Giraud 10/07/2019 03:22:25(UTC)
n Intervals Range (Samples)
by Jean Giraud 21/11/2017 15:51:40(UTC)
How to plot a (simple) equation (and choose interval)? (Questions)
by PeterS 12/07/2017 07:22:41(UTC)
function interval in plot (Questions)
by xpetri18 23/06/2017 16:01:50(UTC)
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.