Consulting

Results 1 to 2 of 2

Thread: Optimization of newton-raphson iterative solution with excel solver vba

  1. #1
    VBAX Newbie
    Joined
    Oct 2023
    Posts
    1
    Location

    Optimization of newton-raphson iterative solution with excel solver vba

    I have an excel worksheet that solves system of PDEs using newton-raphson method. The solution obviously depends on some variables that I input. There is a VBA macro (lets call it VBA1) that is used to solve the equations, after solving the equations the macro inputs the solution as values. Basically I can input variables, run macro VBA1 and it gives results as values.

    The VBA1 macro gives me modeled results, which depend on variables. I also have some real data from my experiments that I want to fit to the model. The problem can be solved by comparing these two data sets, defining SSE and minimizing it by varying input parameters. I guess it can be done by some optimization algorithm, but in excel we only have solver.

    Now the problem is that solver won’t accept the data from the model as it is pasted as values (I guess solver needs explicit solution with formulas), because there is no analytical solution, and as I mentioned earlier, I used newton-raphson iterative method for solution. I tried to write a macro that utilizes solver for optimization, it calls VBA1 and tries to minimize SSE, but nothing really happens. VBA1 inputs the solution as values, solver tries to change variables but nothing happens. I am not sure why it behaves like this.

    Is it possible to write a VBA utilizing solver so it can optimize variables and minimize SSE in this problem? If not possible to utilize solver then why?

  2. #2
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location
    Welcome to VBAX Nurlaj. We may need to see your code or a sample workbook here to assist you on this one. If you are able to , please attach a sample workbook by clicking on Go Advanced, Manage Attachments, Choose File, Upload, and post your reply.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •