Why solving Equations not valid for m = 5 and n = 13

In summary: The equality sign does not appear in the output.I have tried different values for m and n but the warnings keep coming up. This is making it very difficult to work on the problem. Can you please help me?Starting fresh and evaluating your notebook for m=5 and n=13 completes with 17 rules for each of Ao and Bo.
  • #1
kaizen.moto
98
0
Hi everyone,

Iam just wondering on why my codes (with Mathematica) are not valid for the case of m = 5 and n = 13. However, they work perfectly for other cases for example, when m = 1 and n = 1. Note that m = 1,3,5,7,..99 and n = 1,3,5,7,...99.

Please let me know about this matter.

Thanks a lot for any response.
 

Attachments

  • Exercise1.nb
    115.6 KB · Views: 451
Last edited:
Physics news on Phys.org
  • #2
Can you give us any hint about what isn't valid for m=5 and n=13?

Starting fresh and evaluating your notebook for m=1 and n=1 completes with 17 rules for each of Ao and Bo.

Starting fresh and evaluating your notebook for m=5 and n=13 completes with 17 rules for each of Ao and Bo.

There do not appear to be any warning messages about serious errors.

I am being very polite here. Perhaps this will help you with questions you ask in the future. Imagine someone from the other side of the world walks into your office, dumps 100-200 kbytes of source code on your desk, says "I typed some stuff in, some stuff came out, some stuff is wrong, what is it?" You are probably not going to take their 100-200 kbytes of source, read it all, reverse engineer it until you understand what field they are working in, what problem they are working on, how much they know, how much they don't know, what methods they are using, where they have a small misunderstanding or even a misplaced character, and then point that out to them. Or at least you will not do that very many times, not unless there is some superior/subordinate relationship that demands this or unless there is some expectation that the favor will be repaid in the future when you dump 200 kbytes on their desk.

Can you make the kind of problems that you post repeatedly substantially easier for someone who knows absolutely nothing about what is in your head because you have probably been working on your problem many hours a day perhaps for months or years?

Perhaps that will substantially increase the likelihood that you will get helpful replies and be able to get on with the work you need to do.

Because you seem to repeatedly have problems with not getting the same results from Do[] loops, perhaps Reap and Sow might help you. Here is a small example

In[1]:= Reap[Do[i;i^2;Sow[i+3];i-4,{i,1,6}]][[2,1]]
Out[1]= {4,5,6,7,8,9}

The i;i^2 and i-4 are just examples of intermediate results calculated during your Do, but that you are not interested in, what you want is to see the result of i+3 each time.

Reap "creates a bin" that results will be put into in order by Sow. Sow can put any sorts of results in there. The bin just keeps filling until the Do is finished and then the Reap takes all the results and hands them back to you. You can have multiple Sow inside the Do, each with different expressions that you want to collect for output at the end. That [[2,1]] at the end discards some extra information you probably don't need. But the point is that Reap will collect up all the results from Sow, in order, and give them to you as the result.

Perhaps Reap and Sow will let you use the Do loop you have been using and still get the results that you want.
 
  • #3
Thank you for the response.

First of all, I apologise for sending the question without giving much details and information about what the processes are involved within the codes.

I have re run the codes again for the case of m = 5 and n = 13. I got the following warnings at the final cell:

In[93]: sols=Solve[eqn,{Ao[1],Ao[2],...Bo[17]}]

' Solve::svars: Equations may not give solutions for all "solve" variables.>>

Out[93]: {{Ao[1] -> (-0.000274089 + 0. I) Bo[1] + (9.39803*10^-6 + 0. I) Bo[2] + (0.000764148 + 0. I) Bo[3] + (0.000392242 + 0. I) Bo[4] + (0.00012964 + 0. I) Bo[5] + (0.0000317941 + 0. I) Bo[6] + (5.3972*10^-6 + 0. I) Bo[7] + (1.03385*10^-7 + 0. I) Bo[8] - (4.11587*10^-7 + 0. I) Bo[9] - (2.28213*10^-7 + 0. I) Bo[10] - (8.62241*10^-8 + 0. I) Bo[11] - (2.6323*10^-8 + 0. I) Bo[12] - (6.26092*10^-9 + 0. I) Bo[13] - (1.13728*10^-9 + 0. I) Bo[14] - (3.75834*10^-10 + 0. I) Bo[15] + (1.06291*10^-10 + 0. I) Bo[16] + (2.17232*10^-10 + 0. I) Bo[17] - ((0.0000669681 + 0. I) a q)/Subscript[C, 11],........Ao[17] -> (0.000406024 + 0. I) Bo[1] - (0.000260281 + 0. I) Bo[2] + (0.000614667 + 0. I) Bo[3] + (0.000302377 0. I) Bo[4] + (0.0000883891 + 0. I) Bo[5] + (0.0000160242 + 0. I) Bo[6] + (3.52602*10^-7 + 0. I) Bo[7] - (1.25433*10^-6 + 0. I) Bo[8] - (7.0549*10^-7 + 0. I) Bo[9] - (2.68923*10^-7 + 0. I) Bo[10] - (8.28229*10^-8 + 0. I) Bo[11] - (2.10363*10^-8 + 0. I) Bo[12] - (3.81775*10^-9 + 0. I) Bo[13] - (6.9347*10^-10 + 0. I) Bo[14] - (9.55954*10^-11 + 0. I) Bo[15] - (0.000362862 + 0. I) Bo[16] + (0.000247239 + 0. I) Bo[17] - ((3.11726*10^-7 + 0. I) a q)/Subscript[C, 11]}}.

The above output shows that for every constant Ao[1], Ao[2],Ao[3]....Bo[17] gives the results which comprises of another constants. This shouldn't be the case that I am expected. What Iam looking for is the value of Ao[1], Ao[2] and so on should give a definite result,.i.e. not dependent of other constants.
These definite results for each unknown can be clearly seen for other cases for instance m=1, n=1.

Iam wondering how you managed to get no warnings for the case of m = 5 and n =13. Iam using Mathematica version 7 (windows).
 
  • #4
I took your original notebook, made a copy of it, did a fresh evaluation of one with m=1,n=1, did a fresh evaluation of the other with m=5,n=13, deleted all the intermediary calculations with the spelling caution messages, but nothing else, and attached each to this. You can open each of those and compare the results.

As you will see, other than the specific numeric coefficients, I get equations of the same form from both.

Even tiny changes in versions of Mathematica can result in substantial changes in behavior, particularly when it is being used in ways that Mathematica did not expect you to use it.

To track down why you are getting different results for the two cases I would suggest you remove the ";" from the end of your next to last line "eqn={Ao[1]+U1==0,...} and save a copy of the (likely very large) output from that line. Do this for both m=1,n=1 and m=5,n=13. Then compare those two outputs. I suspect you will find that somewhere in your 100+kbytes of code that the way you have written this results in a missing or extra variable and that is likely why when you finally invoke Solve that one case gives a result in the form you desire while the other is confused by the different eqn and gives the result that you do not want.

I hope this helps you track down where the discrepancy lies.
 

Attachments

  • Exercise1.nb
    17.3 KB · Views: 459
  • Copy of Exercise1.nb
    18.3 KB · Views: 456
  • #5


I would first like to commend you for your efforts in using Mathematica to solve equations. It is a powerful tool for mathematical calculations and can often provide quick and accurate solutions. However, it is important to note that not all equations can be solved for all values of the variables. In the case of m = 5 and n = 13, it is possible that the equation you are trying to solve is not valid for those specific values. This could be due to a number of reasons such as the equation being undefined for those values, or the equation being too complex to be solved by Mathematica. It is also possible that there may be a mistake in your code or input that is causing the issue. I would suggest checking for any errors in your code and double-checking the validity of the equation for those specific values of m and n. If the issue persists, it may be helpful to consult with a mathematician or seek assistance from the Mathematica community. Keep up the good work in your mathematical endeavors.
 

FAQ: Why solving Equations not valid for m = 5 and n = 13

1. Why is it not valid to solve equations when m = 5 and n = 13?

When solving equations, we often use substitution to find the value of a variable. However, if the given values of m and n are 5 and 13, respectively, substituting these values into the equation would result in an undefined or impossible solution. This is because certain mathematical operations, such as division by zero, are not defined and can lead to invalid solutions.

2. Can't we just substitute different values for m and n?

While it is possible to substitute different values for m and n, it is important to note that these values must satisfy the original equation for the solution to be valid. In the case of m = 5 and n = 13, these values do not satisfy the equation and therefore cannot be used to find a solution.

3. Are there any exceptions to this rule?

Yes, there are certain cases where m = 5 and n = 13 may be valid for solving equations. For example, if the equation has been specifically designed to allow for these values, or if there are other constraints or conditions that make these values acceptable.

4. Can we use other mathematical techniques to solve these equations?

In some cases, it may be possible to use alternative mathematical techniques, such as graphing or elimination, to solve equations when m = 5 and n = 13. However, it is important to carefully consider the validity of the solution and whether it makes sense in the context of the original problem.

5. How can we avoid invalid solutions when solving equations?

To avoid invalid solutions when solving equations, it is important to carefully check the given values and make sure they satisfy the equation. If there are any values that do not make sense or lead to undefined operations, it is best to avoid using them and look for alternative methods of solving the equation. Additionally, it can be helpful to double-check the solution to ensure that it makes sense in the context of the problem.

Similar threads

Replies
3
Views
2K
Replies
1
Views
2K
Replies
1
Views
1K
Replies
5
Views
3K
Replies
1
Views
1K
Replies
4
Views
3K
Back
Top