09-05-2006, 04:56 PM | #1 (permalink) |
Insane
|
Help with Maple
I figure I'm shooting in the dark with this question, but there might be a mathematician out there who can help with this problem. Basically, I'm trying to use Maple 10.0 to solve a homework problem and encountering an "Error: Cannot determine whether this expression is true or false" followed by a ton (think page-long) of exponentials. Here is the code:
Code:
CAexp := matrix(6, 1, [10, 5.0, 3.5, 1.1, .5, .1]); x := matrix(6, 1, [0, 1, 2, 3, 5, 7]); CAmodel := theta1*exp(-theta2*t); CApred := matrix(6, 1, [seq(eval(CAmodel, {t = x[j, 1]}), j = 1 .. 6)]); J := jacobian([seq(CApred[j, 1], j = 1 .. 6)], [theta1, theta2]); err := evalm(CAexp-CApred); niters := 0; theta := matrix(2, 1, [10, 1]); dtheta := evalm(theta); while 0.10e-3 < max(abs(dtheta[1, 1]/theta[1, 1]), abs(dtheta[2, 1]/theta[2, 1])) and niters < 100 do Jeval := eval(J, {theta1 = theta[1, 1], theta2 = theta[2, 1]}); JevalT := transpose(Jeval); dtheta := evalm(`&*`(`&*`(inverse(`&*`(JevalT, Jeval)), JevalT), eval(err, {theta1 = theta[1, 1], theta2 = theta[2, 1]}))); theta := evalm(theta+dtheta); niters := niters+1 end do This code does work as it comes from the professor and was used to solve the same type of problem but with different data, but I figure there is some error involving the specific data used in this case. I can copy and paste the error if necessary, but it is quite long. |
Tags |
maple |
|
|