Skip to content

[newton_method] BUG: Solution to Exercise 7.2 #575

Closed

Description

@mmcky

The solution to Exercise 7.2 has a RuntimeWarning and Exception thrown.

Image

Activity

  1. added
    bug
    on Aug 28, 2025
  2. changed the title [-][newtons_method] BUG: Solution to Exercise 7.2[/-] [+][newton_method] BUG: Solution to Exercise 7.2[/+] on Aug 28, 2025
  3. added theissue type on Aug 28, 2025
  4. HumphreyYang commented on Sep 1, 2025

    @HumphreyYang
    Member

    Hi @mmcky, this is intentional to show that Newton can fail. Would you like it to be failing more gracefully?

  5. mmcky commented on Sep 1, 2025

    @mmcky
    ContributorAuthor

    Thanks @HumphreyYang ah -- so it is. I was doing a visual check of the html and didn't see the md.

    ```{code-cell} ipython3
    ---
    tags: [raises-exception]
    ---
    
    attempt = 1
    for init in initLs:
        print(f'Attempt {attempt}: Starting value is {init} \n')
        %time p = newton(lambda p: e(p, A, b, c), \
                    init, \
                    tol=1e-15, \
                    max_iter=15)
        print('-'*64)
        attempt += 1
    ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions