0
$\begingroup$

I have a problem using NSolve in my Mathematica code. In my Code NSolve should find a value for qw, but it won't. The strange thing about this is, that NSolve isn't producing any errors. The first error appears when I try to replace the variables with the Result of NSolve

Sorry for the poor effort on the first try, here is the SSEC:

BearLM = {{1, 0, 0, 0, 0}, {0, 1, 0, 0, 0}, {0, 10^7, 1, 0, 0}, {-500,
     0, 0, 1, 0}, {0, 0, 0, 0, 1}};
RollLM[q_] = {{1, 20, Power[20, 2]/(2* 4.2*10^13), Power[20, 3]/(
    6 *4.2*10^13), q Power[20, 4]/(24* 4.2*10^13)}, {0, 1, 20/( 
    4.2*10^13), Power[20, 2]/(2* 4.2*10^13), 
    q Power[20, 3]/(6 *4.2*10^13)}, {0, 0, 1, 20, 
    q Power[20, 2]/2}, {0, 0, 0, 1, q 20}, {0, 0, 0, 0, 1}} ;
Vec11 = {vA, phiA, 0, 0, 1};
Vec12 = BearLM. Vec11; 
VecList1 = {Vec12};
Vec21 = {vS, phiS, 0, 0, 1};
Vec22 = BearLM.Vec21;
VecList2 = {Vec22};
Gls := {
   {vAR, phiAR, FQAR, MbAR, 1} == RollLM[qW + 1].Last[VecList1], 
   {vSR, phiSR, FQSR, MbSR, 1} == RollLM[-qW].Last[VecList2],
   vAR - vSR == 8.5*10^(-6) qW*Log[12000/(4.6*10^(-5) qW)]
   };

Res = NSolve[
   Gls, {vAR, phiAR, FQAR, MbAR, vSR, phiSR, FQSR, MbSR, qW}][[1]]
AppendTo[VecList1, {vAR, phiAR, FQAR, MbAR, 1} /. Res];
AppendTo[VecList2, {vSR, phiSR, FQSR, MbSR, 1} /. Res];
$\endgroup$
  • 1
    $\begingroup$ Can you produce a minimal representative example? See sscce.org for guidance. $\endgroup$ – Szabolcs Feb 18 at 14:41
  • 1
    $\begingroup$ Have you tried to use the options for NSolve? Check the documentation. $\endgroup$ – user59583 Feb 18 at 15:27
  • $\begingroup$ Could you please describe exactly what is "the trouble" you are having? We appreciate the code, but first we want to know what is wrong. $\endgroup$ – Somos Feb 18 at 21:44
  • $\begingroup$ Okay, now I can say that I can't use NSolve in that case, because I still have a lot of symblos that aren't solved. So this Problem is more of how can I simplify my equations so I can work with Solve or is their any kind of Mathematical way to solve this Problem? $\endgroup$ – CR36 Feb 20 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.