Post Reply 
Issue with CAS solver function involving passing strings to the variable position.
10-01-2020, 04:38 PM (This post was last modified: 10-01-2020 04:47 PM by Gene222.)
Post: #4
RE: Issue with CAS solver function involving passingstrings to the variable position.
I don't know how to get SOLVE or fsolve to solve your equation. Some comments on your first program are:
(1) Your choose variable A is the same as your variables[6] which is also defined as A.
(2) I tried using fsolve instead of SOLVE, but it gave {} which I think means fsolve could not find an answer for the initial guess.
(3) I tried exporting the solve variables, but that did not help.
Below are the changes I made to your program in trying to get the program to work. I predefined your list variables, because I got tired of inputting the values in the INPUT screen.
Sorry I could not help you.
PHP Code:
EXPORT Â,τ,ω,A1,Answer;
EXPORT Find,Find_1,variables;

export Amplitude()
BEGIN
print();

Â:=0.0355;
K:=5;
τ:=10;
ω:=3.1415;
E:=0.5;
A1:=7;


CHOOSE(A,"Which Amplitude?","Final","Initial");
if 
A==1 then
variables
:={"Â","K","τ","ω","E","A1"};
input({{Find,variables,{56,15,0}},{Â,[0],{10,20,1}},{K,[0],{10,20,2}},{τ,[0],{10,20,3}},{ω,[0],{10,20,4}},{E,[0],{10,20,5}},{A1,[0],{10,20,6}}});
Find_1:=variables[Find]; Find:=Find_1;
Answer:=fsolve("Â=K*A/(sqrt((1-(τ*ω)^2)^2+(2*τ*ω*E)^2)),"+Find+"=1)");
print(
Answer);
end;
END
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 passingstrings to the variable position. - Gene222 - 10-01-2020 04:38 PM



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