Post Reply 
Help with solve()
11-09-2017, 06:00 PM
Post: #16
RE: Help with solve()
(04-03-2017 12:00 AM)roadrunner Wrote:  A, B, and C already exist so declaring them local confuses the compiler. Try this:

Code:
EXPORT EXAMPLE()
BEGIN
 LOCAL TMP;
// LOCAL A,B,C;
 A:=2000.0;
 B:=1.0;
 C:=0.0;
 TMP:=solve((C/(π*B/12.0))-A,C);
 MSGBOX("RESULT = " + TMP);
END;

-road

MohrCircle()
BEGIN
//Declare Local Variables
LOCAL theta1,theta3,thetaPrime1,thetaPrime3,phiPrime,u,ch1;
LOCAL c:=1;
MSGBOX("Mohr's Circle Equations");
INPUT({{theta1,1},{theta3,1},{thetaPrime1,1},{thetaPrime3,1},{phiPrime,1},{u,1},​{c,1}},"Select given values");
CASE
IF c==0 THEN
INPUT({A,B,C,D,E,F},"Enter given values",
{"σ1=","σ3=","σ'1=","σ'3=","Ø'=","u="},
{"Major Princ Stress [kN/m²]","Min Princ Stress [kN/m²]",
"Maj Princ Eff Stress [kN/m²]","Min Princ Eff Stress [kN/m²]",
"Friction Angle [°]","Pore Water Pressure [kN/m²]"});
theta1:=A;
theta3:=B;
thetaPrime1:=C;
thetaPrime3:=D;
phiPrime:=E;
u:=F;
// Solve.SOLVE(thetaPrime1 = thetaPrime3*(TAN(45+(phiPrime/2)))^2 + 2*X*TAN(45+(phiPrime/2)),X);
c:=solve(C=D*(TAN(45+(E/2)))^2+2*X*TAN(45+(E/2)),X);
MSGBOX("c = "+c);
RETURN c;
END;
END;

Hi,

I tried the suggestion, however I also get "{X}" returned to the Home Screen. Not sure how to implement solve() in a program? Any suggestions?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Help with solve() - AngryNapkin - 03-31-2017, 02:07 PM
RE: Help with solve() - mop80087 - 03-31-2017, 03:19 PM
RE: Help with solve() - Arno K - 03-31-2017, 03:22 PM
RE: Help with solve() - Tim Wessman - 03-31-2017, 04:03 PM
RE: Help with solve() - AngryNapkin - 03-31-2017, 04:18 PM
RE: Help with solve() - AngryNapkin - 03-31-2017, 04:26 PM
RE: Help with solve() - roadrunner - 04-01-2017, 01:02 AM
RE: Help with solve() - AngryNapkin - 04-01-2017, 01:22 AM
RE: Help with solve() - roadrunner - 04-01-2017, 01:44 AM
RE: Help with solve() - AngryNapkin - 04-01-2017, 02:31 AM
RE: Help with solve() - Brad Barton - 04-01-2017, 03:48 AM
RE: Help with solve() - AngryNapkin - 04-02-2017, 09:38 PM
RE: Help with solve() - roadrunner - 04-03-2017, 12:00 AM
RE: Help with solve() - Kiyan - 11-09-2017 06:00 PM
RE: Help with solve() - AngryNapkin - 04-03-2017, 01:00 AM
RE: Help with solve() - roadrunner - 04-03-2017, 01:25 AM
RE: Help with solve() - Eddie W. Shore - 11-09-2017, 09:07 PM
RE: Help with solve() - Kiyan - 11-09-2017, 09:48 PM



User(s) browsing this thread: 1 Guest(s)