How to Solve Simultaneous Equations in a Do-Loop with Mathematica 7?

  • Context: Mathematica 
  • Thread starter Thread starter kaizen.moto
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary
SUMMARY

This discussion focuses on solving simultaneous equations within a Do-Loop using Mathematica 7. The user encountered issues with syntax errors, particularly missing semicolons and brackets in their matrix equations. The discussion provides specific substitution techniques using the replacement rule syntax and demonstrates the use of the Sum function to aggregate results. Additionally, it suggests that the user may benefit from seeking assistance in more specialized forums for Mathematica syntax queries.

PREREQUISITES
  • Familiarity with Mathematica 7 syntax and functions
  • Understanding of simultaneous equations and matrix operations
  • Knowledge of substitution techniques in Mathematica
  • Experience with Do-Loops and iterative processes in programming
NEXT STEPS
  • Research advanced substitution techniques in Mathematica
  • Learn about matrix equation handling in Mathematica 7
  • Explore the use of the Sum function for aggregating results in Mathematica
  • Investigate specialized forums for Mathematica syntax and troubleshooting
USEFUL FOR

Mathematics students, researchers using Mathematica for computational problems, and anyone looking to solve complex simultaneous equations in programming environments.

kaizen.moto
Messages
94
Reaction score
0
Hi all,

I got stucked with the problem with regard to Do-Loop and solving simultaneous equations together.

Please help me on this matter and the file is attached, Iam using Mathematica 7

Thanks
 

Attachments

Physics news on Phys.org
In Task 1 in (W1r)=(3m*n(Ar+Ar+1)...)) there is a missing ; and there are missing or extra {} or levels in your matrix equation that give errors. Once I try to guess what to do to fix those then it grinds away producing 37500 matrix equations and I assume it will finish in the future.

Task 2 is written in a very strange way but it does what you seem to request.

Task 3 is very difficult to understand. Substitute A0,A1,B0,B1 from Task 2 is clear. But substitute in what? In Task1? Sum W1r=0 what? In Task1?

To do substitutions in an expression usually you use
expression//.{A0-> -U10,A1-> -U11,B0-> -V10,B1-> -V11}
and that will replace all A0, A1,B0,B1 with your desired values in expression.

To Sum usually you use
Sum[W1r=0,{m,1,99,2},{n,1,99,2}]
if you have assigned the desired expression to W1r.

But it is not clear that I am answering what you have asked for or you have asked for what you need.

Perhaps the physics forums OtherSciences->Math&ScienceSoftware would be a better place to ask Mathematica syntax questions.
 
Perhaps you can see how to adapt this very simple example to your actual problem.

In[4]:= w=3m*n*a+8n^2*b;
rules=Solve[{a+u==0,b+v==0},{a,b}];
Sum[w//.rules,{m,1,5,2},{n,0,3,1}]

Out[6]= {-162 u-336 v}
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K