Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I am currently handling a big list which has the following dimension: {6, 3, 4, 2, 2, 1, 8} where the last number 8 represent a number of equation that are in each sublist. If I apply solve to the 7 level

Ssols = Map[Flatten[Solve[#, vars]] &,SSEquations, {7}]

I get a list in which


{6, 3, 4, 2, 2, 1}

so until now it seems fine, even if I don't understand this wrapping that comes out with another List containing the previous one.

But then things get compplicated

SCSystem = 
  Outer[# && #2 && #3 && #4 && #5 &, Eq1, Eq4, Eq5, Eq6, Eq8, {2}] 
  /.SCEq1 /. SCEq4 /. SCEq5 /. SCEq6 /. SCEq8 // MatrixForm;

{6, 3, 4, 2, 2, 1}

where: EqX = {IX,IIX, etc} and SCEqX ={IX->a+b<c,etc.} or similar inequalities

Now if I apply a FullSimplify to get which one of this set of inequalities is True and which one is not, and also geting a simplified form of the set of inequalities

 SCsols = ParallelMap[FullSimplify[#] &, SCSystem, {7}] //MatrixForm

I get something really strange

Dimensions[SCsols[[1, 1]]]

{6, 3, 4, 2, 2, 1}

How this is possible? Do you have any suggestions? And moreover I would like to go and substitute for each level 6 of Ssols the corresponding value in SCsols and I thought to do in the following way:

SCsolsSub = 
  Parallelize[Outer[#1 /. #2 &, SCsols, Ssols],{6}] // MatrixForm

but doesn't work probalby because the two list have not the same dimensions.

share|improve this question

marked as duplicate by R. M. Sep 26 '13 at 13:30

This question was marked as an exact duplicate of an existing question.

First: Remove //MatrixForm at the end of your expressions. If you want to visualize your equations as matrices do something like: mat={{0,0},{1,1}}; mat//MatrixForm. – Öskå Sep 26 '13 at 9:49
Hi, yes i just figured out that matrixform change the size of the list it take in input...i've removed it and now is going fine with the dimension, i'm not looking at the last operation. thanks for the hint! :) – Yyrkoon Sep 26 '13 at 9:58
Then, if you need further help you should provide a small working example or, if it's not possible, vars, SSEquations and every unknown in your post. – Öskå Sep 26 '13 at 10:07's kind of hard for me to report data and probably due to the big amount of variable will make everything more messy...what i'm trying to solve is actually find a function (or write one) that given to list with several levels. One containin expression of variable and one containing the substituition rules. I want that in the first one i substitute the second. A={{a+b<c&&a+c>2},{a+b>c&&a+c>5}} B={{a->1,b->2,c->3},{a->1,b->5,c->4}} and then get f[A/.B] C ={{1+2<3&&1+3>2},{1+5>4&&1+4>5}} – Yyrkoon Sep 26 '13 at 10:33
up vote 0 down vote accepted

So after removing the //MatrixForm, all the dimension were in agreement, in order to solve the last problem i've used:

SCsolsSub = MapThread[Reduce[#1 /. #2] &, {SCsols, SSsols}, 6]

share|improve this answer

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