Message Boards Message Boards

Minimization error: constraints are not valid

Posted 1 year ago

In the notebook above, I am attempting to minimize a function that depends on the function θ(x). The purpose is to solve this problem and extract the variable q3. However, I keep encountering an error message from Mathematica. Could you please help me identify the mistake I am making?

POSTED BY: Felix Toperczer
2 Replies

ClearAll, without arguments, does not clear anything at all, I suspect. Cos[\[Theta]], Sin[\[Theta]], (\[Theta]')^2 do nothing useful for you; you should use Cos[\[Theta][x]], Sin[\[Theta][x]], (\[Theta]'[x])^2. The quantity U is best written as a function of the parameters q1,q2,q3, not of \[Theta]. This works:

Clear[q1, q2, q3, x, \[Theta], U]
w = 4.7;
h = 3.4;
A = 25;
\[Nu] = 0.45;
L = 36*Pi;
R = 36;
(*Steifigkeiten*)
a1 = 4*A*\[Pi]*w*h^3;
a2 = 4*A*\[Pi]*w^3*h;
a3 = (2*A*h*w*(h^2 + w^2))/(1 + \[Nu]);
\[Theta][x_] = q1 + q2*x + q3*x^2;
Solve[{\[Theta][0] == 0, \[Theta]'[0] == 0}]
U[q1_, q2_, q3_] =
  Integrate[(1/2)*(a1/R^2*Cos[\[Theta][x]]^2 +
      a2/R^2*Sin[\[Theta][x]]^2 +
      a3/L^2*(\[Theta]'[x])^2),
   {x, 0, 1}];
Plot[U[0, 0, q3], {q3, -2, 2}]
result = NMinimize[U[0, 0, q3], q3]
POSTED BY: Gianluca Gorni

q1 and q2 aren't variables

POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract