Message Boards Message Boards

0
|
17080 Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

FindRoot::nlnum: The function value s not a list of numbers with dim...

Posted 9 years ago

Hi, I'm Aerospace engineer. I try to compile this code but in the last part of it, appears that error. I dont understand where is the mistake. I have added such code in this message, and hope that someone give me an help. Thank you. Bye

Attachments:
5 Replies

Ok...I will do it. Thank you for suggestions.

Posted 9 years ago

This is certainly possible in Mathematica but it would take a complete understanding of the subject rather than of Mathematica itself. Only you can solve this... Here are some suggestions after inspecting your code: 1. try to localise the variables within a Module or by using With or Block (look in the documentation) 2. use as much as possible Table, Map, etc.. to create loops rather than For-Next. escape the loops with Sow/reap or collect results with Throw/Catch. (again, see the docs)

POSTED BY: Erik Mahieu

Sorry, but now I have another problem with the same code. I would like to do an external cycle on the r variable, so for each cycle in i variable I would like to change the value of r. I not be able to do it. I attached the code. Thank you

Attachments:

Grazie Mille!!!!

Posted 9 years ago

In the equations you try to solve, the muF1 contains a function Re

In[146]:= \[Mu]F1

Out[146]= 0.0119846 ((-3.03928 + 0. I) + (78.5811 + 0. I) d - 
   980.429 d^2 + 4199.85 d^3) Derivative[1][
  Re][(-3.03928 + 0. I) d + (39.2905 + 0. I) d^2 - 326.81 d^3 + 
   1049.96 d^4]

Where you define F1, eliminate the Re as follows (it is not needed)

F1 = Integrate[
    f, {x, 0, 2 \[Pi]/qbest}, {y, 0, 2 \[Pi] Sqrt[3]/qbest}]/area;

The muF1 will no longer contain Re' and will now be as follows:

0.0119846 ((-3.03928 + 0. I) + (78.5811 + 0. I) d - 980.429 d^2 + 
   4199.85 d^3)

If you now solve your equation it works fine:

In[154]:= FindRoot[{\[Mu]F1 == \[Mu]fliq, 
  PF1 == Pliq}, {{d, 0.167}, {n01, 0.001}}]

Out[154]= {d -> 0.183252 + 0. I, n01 -> 0.168551 + 0. I}

I attached the corrected nb

Attachments:
POSTED BY: Erik Mahieu
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