Message Boards Message Boards

0
|
6287 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Can you help me find why I get the error message, please...

Posted 10 years ago

Dear All,

Here is a simple Manipulate within which there is a DO loop. I get an error message and I cannot find where I make the mistake. Could you please help me in finding the source of the error in the attached notebook.

Thanks, Jones

Attachments:
POSTED BY: Tugrul Temel
Posted 10 years ago

This has done serious injury to your code, but I believe it has also fixed some serious errors. For example, the expression to be displayed now appears before all the manipulate controls. That is as the documentation for Manipulate shows. The code appears to work now.

Manipulate[
 Subscript[k, 11] = (Subscript[\[Alpha], 1]/(1 - Subscript[\[Alpha], 1]))*Subscript[r, 1];
 Subscript[\[Eta], 11] = 1/(-1 + Subscript[\[Alpha], 1])/(E^(-Subscript[\[Alpha], 1]*Subscript[g1, 0])*
    (1/(Subscript[r, 1]*(1 - Subscript[\[Alpha], 1])))^-Subscript[\[Alpha], 1]);
 Subscript[y, 11] = (1 - Subscript[\[Eta], 11])*E^((1 - Subscript[\[Alpha], 1])*Subscript[g1, 0])*
   Subscript[k, 11]^Subscript[\[Alpha], 1];
 Subscript[g1, 1] = Subscript[\[Alpha], 1]*Subscript[g1, 0];
 Subscript[r, 2] = Subscript[\[Alpha], 1]*((1 - Subscript[\[Eta], 11])/(1 - 2*Subscript[\[Eta], 11]));
 Subscript[k, 12] = (Subscript[\[Alpha], 1]/(1 - Subscript[\[Alpha], 1]))*Subscript[r, 2];
 Subscript[\[Eta], 12] = 1/(-1 + Subscript[\[Alpha], 1])/(E^(-Subscript[\[Alpha], 1]*Subscript[g1, 1])*
    (1/(Subscript[r, 2]*(1 - Subscript[\[Alpha], 1])))^-Subscript[\[Alpha], 1]);
 Subscript[y, 12] = (1 - Subscript[\[Eta], 12])*E^((1 - Subscript[\[Alpha], 1])*Subscript[g1, 1])*
    Subscript[k, 12]^Subscript[\[Alpha], 1];
 Subscript[g1, 2] = Subscript[\[Alpha], 1]*Subscript[g1, 1];
 Subscript[r, 3] = Subscript[\[Alpha], 1]*((1 - Subscript[\[Eta], 12])/(1 - 2*Subscript[\[Eta], 12]));
 Subscript[k, 13] = (Subscript[\[Alpha], 1]/(1 - Subscript[\[Alpha], 1]))*Subscript[r, 3];
 Subscript[\[Eta], 13] = 1/(-1 + Subscript[\[Alpha], 1])/(E^(-Subscript[\[Alpha], 1]*Subscript[g1, 2])*
    (1/(Subscript[r, 3]*(1 - Subscript[\[Alpha], 1])))^-Subscript[\[Alpha], 1]);
 Subscript[y, 13] = (1 - Subscript[\[Eta], 13])*E^((1 - Subscript[\[Alpha], 1])*Subscript[g1, 2])*
    Subscript[k, 13]^Subscript[\[Alpha], 1];
 Subscript[g1, 3] = Subscript[\[Alpha], 1]*Subscript[g1, 2];
 Subscript[r, 4] = Subscript[\[Alpha], 1]*((1 - Subscript[\[Eta], 13])/(1 - 2*Subscript[\[Eta], 13]));
 ListLinePlot[{{Subscript[\[Eta], 11], Subscript[\[Eta], 12], Subscript[\[Eta], 13]},
     {Subscript[y, 11], Subscript[y, 12], Subscript[y, 13]}}],
 {{Subscript[\[Alpha], 1], 0.4, "\[Alpha]1"}, 0.1, 1, Appearance -> "Labeled"},
 {{Subscript[r, 1], 1, "r"}, 1, 5, Appearance -> "Labeled"},
 {{Subscript[g1, 0], 1, "g1"}, 1, 5, Appearance -> "Labeled"}]

Perhaps you can try making one small change at a time to make the code look more like your original and see if it continues to work after each change or try to understand why the change makes it no longer work.

POSTED BY: Bill Simpson
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