equation solving – Is there a way to automatically store the output of a command to a variable directly?


Generally I do a computation then I have to manually take that number and make it equal to another variable which I define which I can then use to do subsequent computations. Something like this:

Solve((*Question 2*)

raise /. {Subscript(M, t)(*Changes*)-> (maxforce) (125/1000),

Subscript(d, m) -> 18.75/1000, f -> 0.15, Subscript(f, c) -> 0.15,

L -> 2.5/1000, Subscript((Alpha), n) -> 14.5 Degree,

Subscript(d, c) -> 16/1000} , {W})

So this piece of script will give me a value for W. I have to set maxforce before I do the computation as that is usually given in the question.

Basically what I am looking for is a way to automatically take the output of the script above and store it in a variable called “clampforce” for example without having me to manually run the script, copy the output and then define it in the variable. If I just say clampforce=(the entire script above) then what happens is that it stores not just the number in the clampforce variable but w->(the number) and that messes up other calculations. I just want to store the number from the solve command in another variable automatically.

I really appreciate any help. Thanks a lot guys!