0
$\begingroup$

I require in this program to use only all the value of “p” form “solution 1” in “solution 2”. Instead of copy and paste each value of “p” individually in solution 2, I am trying to write a function to automatically calculate “da” and “s” from all output “p” in the same manipulate. Thanks for your help.

Table[
  Take[Solve[
    -10 p - 26 t == 5 &&
     -5.3 p + 19 t == (var1 - 50),
    {p, t}]], {var1, 10, 30, 4}] // Flatten(*solution 1*)

f[p_, t_] := Take[# & p] 

Manipulate[
 Solve[
  2.88286(*to include all values of p from solution 1*)== 
    0.42 - 2.4 s + 1.52 c &&
   da == 15 - 1.4 s + 0.425723972217329 c],
 {c, 10, 50}](*solution 2*)
$\endgroup$
1
0
$\begingroup$

It is not quite clear what are you after. Assuming that you want to get on the screen simultaneously the solutions of the equation 2 with all the values of p from the equation 1, try this

Manipulate[
 lst1 = Table[
     Solve[-10 p - 26 t == 5 && -5.3 p + 19 t == (var1 - 50)], {var1, 
      10, 30, 4}] /. {{x_, y_}} -> x[[2]] // Quiet;
 NSolve[{# == 0.42 - 2.4 s + 1.52 c, 
     da == 15 - 1.4 s + 0.425723972217329 }, {da, s}] & /@ lst1, {c, 
  10, 50}]

Have fun!

$\endgroup$
1
  • $\begingroup$ This looks the same as the answer I posted here earlier. $\endgroup$ – Rohit Namjoshi May 26 at 19:52

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.