Post Reply 
Issue with CAS solver function involving passing strings to the variable position.
10-01-2020, 12:10 PM (This post was last modified: 10-01-2020 12:21 PM by Grayhek.)
Post: #3
RE:Issue with CAS solver function involving passing strings to the variable position.
(10-01-2020 10:07 AM)Gene222 Wrote:  I'm just a novice, but it looks like you mixing text and variables in the string expression. Try something like:
Answer:=CAS("SOLVE(Â=K*A/(sqrt((1-(τ*ω)^2)^2+(2*τ*ω*E)^2))," + Find + ",1)");

So it works better than before in that it doesn't return an error but it doesn't evaluate the equation. I normally ran into that problem when I didn't us the program in the solver app but I checked and made sure I was in the Solver app and it still was not running properly. I ran it in the CAS environment and it returned an error.
Code:

//Amplitude 
        export Sys_Ctrl_Amplitude()
        BEGIN
            Local Find,Find_1,variables,Answer;
            print();
            
            G:=0;
            CHOOSE(G,"Which Amplitude?","Final","Initial");
            if G==1 then
                variables:={"Â","K","τ","ω","ζ","A"};
                input({{Find,variables,{56,15,0}},{Â,[0],{10,20,1}},{K,[0],{10,20,2}},{τ,[0],{10,20,3}},{ω,[0],{10,20,4}},{ζ,[0],{10,20,5}},{A,[0],{10,20,6}}});
                Find_1:=variables[Find]; Find:=Find_1;
                //input({{K,[0],{10,20,2}},{τ,[0],{10,20,3}},{ω,[0],{10,20,4}},{ζ,[0],{10,20,5}},{A,[0],{10,20,6}}});
                Answer:=CAS("SOLVE(Â=K*A/(sqrt((1-(τ*ω)^2)^2+(2*τ*ω*ζ)^2)),"+Find+",1)");
                //print("Â= "+Answer);
                print(Find+"= "+Answer);
            end;
        END;


Attached File(s) Thumbnail(s)
       
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE:Issue with CAS solver function involving passing strings to the variable position. - Grayhek - 10-01-2020 12:10 PM



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