Jump to content

Amyone with maple 10 experiance

Featured Replies

I'm a tiny bit desperate on this one...

 

 

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)

matrix:=LOAD MATRIX

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.

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.