# Question:NLPSolve

## Question:NLPSolve

Maple
Hi.

I am trying to debug a small piece of code I've written.

I have a procedure for solving some quite complex equations. For single points in space.

I have a procedure that:

has some quantities passed to it,
brings in a 2 by 80
Does a for loop for each of the rows in the data, to take the first col value, and puts that along with the vars passed to it into the first procedure. It then works out the difference between the value given by the first procedure and the second col. Squares this and adds it to the total.

I'd like to use the NPLSolve minimize function to minimise this total squared sum of differences, by passing differnt values to the second function.

Unfortunatly this seems to fail. When I try to print out the values passed to the second proc I get just the names.

eg. (note not my real code)

proc1:=proc(a,b,c,d)

<some equation stuff>
end proc

proc2(a,b,c)
for j is length of matrix
d=matrix[1,j];
temp1:=proc1(a,b,c,d)
dif:=dif+(temp1-b)^2
end for
return dif
end proc

Optimization[NLPSolve](proc2(a,b,c), a=50E-9..100E-9,b=100E-9..150E-9,c=50..100)

This just takes forever, and putting print(a,b,c) into proc2 prints just

"a,b,c" not any numbers.
﻿