Solution of equations (find the roots)

Solution of equations (find the roots) - Сообщения

#1 Опубликовано: 17.02.2009 21:14:27
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

SMath Studio supports a built-in function to find the roots of equations. There are two ways to use it.

  • Write your equation on the page of SMath Studio, select the variable of the equation by the mouse or stylus and then press 'Calculation' > 'Solve' menu-item from the main menu.


  • Write your equation into the first argument of built-in solve() function and a variable of this equation as a second argument. To get the result just press '=' (equal to) button.


    Note, that you can define the right part of the equation (using boolean equal from Boolean Panel) or not in both cases above.
  • #2 Опубликовано: 24.06.2009 14:59:03
    besa

    besa

    0 сообщений из 2 понравились пользователям.

    Группа: User

    Hello together,

    why does SMath say "x - not defined" to sqrt(x-7)+sqrt(17-x)= ?

    I can't even enter the 4 at the end of the expression.

    Is there a small tutorial for pupils? Some curve discussion for example.

    Regards from Germany

    Sascha
    #3 Опубликовано: 24.06.2009 16:22:59
    Andrey Ivashov

    Andrey Ivashov

    2269 сообщений из 3729 понравились пользователям.

    Группа: Super Administrator

    Hello, Sascha.
    If you want to specify right part of the equation, you need to use boolean "equal to" operator from Boolean Panal.
    #4 Опубликовано: 26.06.2009 17:15:37
    besa

    besa

    0 сообщений из 2 понравились пользователям.

    Группа: User

    Thank you.
    #5 Опубликовано: 02.07.2009 14:14:44
    Smfan

    Smfan

    0 сообщений из 7 понравились пользователям.

    Группа: User

    Wrote

    Hello, Sascha.
    If you want to specify right part of the equation, you need to use boolean "equal to" operator from Boolean Panal.



    ONE SIMPLE EQU SUCH AS:

    x-20=5
    (I have used the Boolean Equ=)

    calc it, then "NO REAL ROOT found" alert.

    why?
    #6 Опубликовано: 02.07.2009 17:34:39
    Radovan Omorjan

    Radovan Omorjan

    325 сообщений из 2052 понравились пользователям.

    Группа: Moderator

    There is a problem with different Regional Settings. If you have Russian Regional settings you will have to use
    -comma "," for the decimal separator (Although in the Arithmetic palete the tooltip will say "Decimal point" )
    -semicolumn ";" for the argument separator
    For instance
    [MATH]res←solve(x-20≡5;x)[/MATH]
    [MATH]res=25[/MATH]
    [MATH]solve(x*20≡5;x)—1/4[/MATH]
    [MATH]solve(x*20≡5;x)=0,25[/MATH]

    If you use the English Reginal settings you will have to use
    -point "." for the decimal separator
    -comma "," for the argument separator
    (Can not be displayed here with "MATH" BBcode tag)
    Please take a look at the Arithmetic palete or your Reginal Settings. I do not know what yoy did, actually?

    By the way, both Reginal settings will solve your simple equation for me in Smath v0.8, but if I want to upload the file with these equation into "Live" SMath mode I've got the same error as you do: "No real roots" but only for the first (simple) equation. The other two "solve" will give the correct result ???

    I've been told by the SMath author that some problems are to be resolved with this Settings and the "Live" mode.
    Here are the pictures:
    Russian and similar settings

    English and similar settings

    "Live" mode on this site

    Regards,
    Radovan
    When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
    #7 Опубликовано: 03.07.2009 11:17:09
    Smfan

    Smfan

    0 сообщений из 7 понравились пользователям.

    Группа: User

    thanks your hint for regional setting,

    whereas i chage to russian or english and change func type(euro or world),
    the same result with it:

    no real root

    IS IT A BUG?
    #8 Опубликовано: 03.07.2009 12:04:41
    Radovan Omorjan

    Radovan Omorjan

    325 сообщений из 2052 понравились пользователям.

    Группа: Moderator

    Have you checked the Roots(range) option?
    For instance, this will work

    but this will not (25 is outside the range[-20,20])


    By the way, Roots(range) might effect on the results, especially when there are more than one result.
    It might be a problem where searching the roots of different equations. I suppose this would be changed in the next SMath version. On the other hand, it seems that solve is not a symbolical but only a numerical solver at the moment.

    Regards,
    Radovan
    When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
    #9 Опубликовано: 03.07.2009 14:56:12
    Smfan

    Smfan

    0 сообщений из 7 понравились пользователям.

    Группа: User

    Thanks very much,

    solve(x-20=5,x) SOLVED OK IF I SET THE OPTION-ROOT RANGE:-100 TO 100

    however, i found another BUG perhaps here:

    when i set -1000 to 1000, no any msg alert me
    but the result role back to: no real root

    i have tried many times, the root range seems like limited -100 to 100 HARDLY.

    #10 Опубликовано: 03.07.2009 15:59:26
    Andrey Ivashov

    Andrey Ivashov

    2269 сообщений из 3729 понравились пользователям.

    Группа: Super Administrator

    Hello.
    Wrote

    On the other hand, it seems that solve is not a symbolical but only a numerical solver at the moment.


    It's absolutely true. Solve function includes a simple iteration mechanism.

    Wrote

    the root range seems like limited -100 to 100 HARDLY.


    No. Iteration algorithm has hardcoded step (with ratio to the range - this means that number of steps - constant), that's why answer will be more accuracy if the range will be smaller. And if range will be tot big, then step can be just too big and it can simply jump across the roots.
    #11 Опубликовано: 03.07.2009 16:25:31
    Radovan Omorjan

    Radovan Omorjan

    325 сообщений из 2052 понравились пользователям.

    Группа: Moderator

    Yes, you are right. Something was wrong here.
    Even with the range [-101,101] will not work, but with [-100,100] will work. Very strange!
    I even tried with some simple quadratic and cubic equations. Range [-100,100] will work but [-101,101] will, again, not.
    On the other hand the range is limited to [-1000,1000]

    In my opinion, as this is a numerical algorithm, the most useful way is to plot the function and to see which range to use. It is better to use some narrow range in which the roots are present. On the other hand some playng with range migh be needed. As we know, even then the results are not guarantied.

    Therefore, every solve function must have the possibilitie to change the range searching roots.

    Regards,
    Radovan

    P.S. I did not see the Andrey's answer. We must have writen it at the same time.
    When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
    #12 Опубликовано: 03.07.2009 23:04:25
    Andrey Ivashov

    Andrey Ivashov

    2269 сообщений из 3729 понравились пользователям.

    Группа: Super Administrator

    omorr, thank you for your posts. They has many useful information for the SMath Studio users.
    #13 Опубликовано: 04.07.2009 07:25:39
    Radovan Omorjan

    Radovan Omorjan

    325 сообщений из 2052 понравились пользователям.

    Группа: Moderator

    You are welcome , considering that I am using it just more than a week.

    By the way, we had some comments about the range for solve. Is there maybe any possibilitie to put the range as a third parameter in the solve function, or something else? It seems that there is no good solution to put it in the Options dialog box. Of course, it is up to you to decide

    Regards,
    Radovan
    When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
    #14 Опубликовано: 04.07.2009 12:44:11
    Andrey Ivashov

    Andrey Ivashov

    2269 сообщений из 3729 понравились пользователям.

    Группа: Super Administrator

    Wrote

    Is there maybe any possibilitie to put the range as a third parameter in the solve function, or something else? It seems that there is no good solution to put it in the Options dialog box. Of course, it is up to you to decide


    Good idea! Will be implemented in the release then (in couple of days).
    #15 Опубликовано: 04.07.2009 13:22:19
    Smfan

    Smfan

    0 сообщений из 7 понравились пользователям.

    Группа: User

    Wrote

    Wrote

    Is there maybe any possibilitie to put the range as a third parameter in the solve function, or something else? It seems that there is no good solution to put it in the Options dialog box. Of course, it is up to you to decide


    Good idea! Will be implemented in the release then (in couple of days).



    Expected Hottly.
    #16 Опубликовано: 04.07.2009 14:39:55
    Radovan Omorjan

    Radovan Omorjan

    325 сообщений из 2052 понравились пользователям.

    Группа: Moderator

    Wrote

    Wrote

    Is there maybe any possibilitie to put the range as a third parameter in the solve function, or something else? It seems that there is no good solution to put it in the Options dialog box. Of course, it is up to you to decide


    Good idea! Will be implemented in the release then (in couple of days).



    Thank you Andrey

    As we know, the problematic equations for root finding could be the equations with small slope at the solutions. Here is a simple example.

    SMath solved that quite good (look at the error - order of magnitude 1e-17). But, the inconvenience could be if we try to locate the roots by plotting. I am not sure, but the scaling of the 2D plot could not be done separately on x and y axis. I think we can not locate the rots because of simultaneous scaling of both x and y axis. I spent some time trying (moving and scaling) to locate either one of the roots, but with no success. I do not know if I am right?

    Regards,
    Radovan
    When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
    #17 Опубликовано: 05.07.2009 23:54:36
    Andrey Ivashov

    Andrey Ivashov

    2269 сообщений из 3729 понравились пользователям.

    Группа: Super Administrator

    Done!

    Function solve(..) with 4 arguments implemented:


    And here is SMath Studio 0.82 for tests. If it is stable enough, then this version will be released today in the evening (06 July 2009):

    Update 07.07.09: TEST LINKS REMOVED (0.82 release will be available soon)

    Please, test it and post any serious bugs info here, if any... Hope, we could find critical errors before release will be published.

    Thanks in advance.
    Best regards, Andrey Ivashov.
    #18 Опубликовано: 06.07.2009 10:36:36
    Radovan Omorjan

    Radovan Omorjan

    325 сообщений из 2052 понравились пользователям.

    Группа: Moderator

    Thank you Andrey for your efforts,

    I supose that Roots(range) from the Options menu will be used with solve when the third and fourth argument (range) is not present. Very good, thank you.

    I must be annoying but here are few of my findings. I do not think these are critical errors, but just to be for your attention.
    Please look at the image:

    I did the same as last time - moved the regions up. I expected to se empty placeholder at the numerical evaluation of the matrix inverse?

    This one I've already mentioned on the Private Massage. I hope I made myself understood about it. It might be just confusing and prone to errors.

    (I did see that I mixed ";" and "," as argument separators - it is Ok, just a typo in the text)
    I am on my vacation from tomorow and I will not bother you for about two weeks

    Best Wishes,
    Radovan
    When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
    #19 Опубликовано: 06.07.2009 11:36:29
    Andrey Ivashov

    Andrey Ivashov

    2269 сообщений из 3729 понравились пользователям.

    Группа: Super Administrator

    Thanks.

    First one is rather serious, will fix. It's really hard to make 0.82 release, too many complex code changes...

    I wish you all the best in your vacation.
    #20 Опубликовано: 06.07.2009 11:49:10
    Radovan Omorjan

    Radovan Omorjan

    325 сообщений из 2052 понравились пользователям.

    Группа: Moderator

    Thank you,

    Best wishes to you too

    Radovan
    When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
    • Новые сообщения Новые сообщения
    • Нет новых сообщений Нет новых сообщений