fsolve_test03 <- function ( ) #*****************************************************************************80 # ## fsolve_test03 tests fsolve() on 4 equation. # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 09 April 2021 # # Author: # # John Burkardt # { source ( "/home/burkardt/public_html/r_src/fsolve_test/f3.R" ) cat ( "\n" ) cat ( "fsolve_test03\n" ) cat ( " Use fsolve() to solve 4 nonlinear equations.\n" ) x0 <- c ( 0.0, 0.0, 0.0, 0.0 ) cat ( "\n" ) cat ( " The initial vector x0: " ) print ( x0 ) fx0 <- f3 ( x0 ) cat ( " The function value f(x0): " ) print ( fx0 ) result <- fsolve ( f3, x0 ) cat ( " The final vector x: " ) print ( result$x ) cat ( " The function value f(x): " ) print ( result$fval ) }