MATLAB Solving Unknowns in MATLAB: Approximation Scheme

  • Thread starter Thread starter ballzac
  • Start date Start date
  • Tags Tags
    Matlab Unknowns
Click For Summary
The discussion revolves around using MATLAB for an approximation scheme where one variable is unknown, but the expected final result is known. The user seeks a method to keep a pronumeral in the results without assigning it a specific value. Suggestions include utilizing the symbolic math toolbox, which allows for symbolic computation, but the user indicates it may not be available at their university. Alternatives discussed involve normalizing the variable to a fixed value during iterations and then rescaling at the end. The conversation highlights the challenge of maintaining the unknown variable throughout the process while adhering to specific course requirements. The user expresses urgency due to an impending deadline and acknowledges the need to track the variable's behavior during iterations.
ballzac
Messages
100
Reaction score
0
Hi. I need to run through an approximation scheme, and one of the variables in the scheme is unknown, but I know what the final answer should be. I want to calculate the value of the unknown by figuring out what it must be for the approximation to equal the expected result after a significant number of iterations. Is there, in MATLAB, some way to use a pronumeral without assigning a value to it? i.e. so that the pronumeral remains in the result. e.g. we might run ten iterations of the program and have a^10 as a factor in the final result, then run it for 1000 iterations and have a^1000 in the final result. I have not been able to figure this out. Maybe there is a 'trick' that can be used for this kind of problem? Thanks in advance.
 
Physics news on Phys.org
ballzac said:
Hi. I need to run through an approximation scheme, and one of the variables in the scheme is unknown, but I know what the final answer should be. I want to calculate the value of the unknown by figuring out what it must be for the approximation to equal the expected result after a significant number of iterations. Is there, in MATLAB, some way to use a pronumeral without assigning a value to it? i.e. so that the pronumeral remains in the result. e.g. we might run ten iterations of the program and have a^10 as a factor in the final result, then run it for 1000 iterations and have a^1000 in the final result. I have not been able to figure this out. Maybe there is a 'trick' that can be used for this kind of problem? Thanks in advance.

Not that I'm aware of. Maybe with the symbolic toolbox? But regardless, you should probably be reformulating so you do some kind of Newton-Raphson or some other sort of fixed-point iteration?
http://en.wikipedia.org/wiki/Fixed_point_iteration
http://elm.eeng.dcu.ie/~ee317/Matlab_Examples/iter/tutinfo[1].htm
 
Last edited by a moderator:
I have a question that has one known value at each end (boundary conditions), and it is required to use one known value, and use that and the next value (which is unknown), and then follow the recurrence relation until the other known value is reached, and then use this value to calculate what the unknown value is. I hope that made sense. I am a little tired. So anyway, I'm sure there would be many ways to solve it, but that is specifically what we were told to do, and we were told to use MATLAB. Not sure how it was meant to be done. Oh well, I left it too late as it is due tomorrow, and I'm going to bed now, lol. Thanks for the info anyway. Cheers.
 
Yes, this would be possible with the symbolic math toolbox.

If you don't have that, maybe you can normalize everything to a (use a = 1 up until your final step), then re-scale? I don't think I fully understand your problem...

-Kerry
 
KLoux said:
Yes, this would be possible with the symbolic math toolbox.

If you don't have that, maybe you can normalize everything to a (use a = 1 up until your final step), then re-scale? I don't think I fully understand your problem...

-Kerry
I don't think I really do either :rolleyes: :redface:. But anyway, I think you're right that I will have to add it at the end. I'll just have to keep track of what happens to it at each iteration.

I gather we are not meant to use the symbolic math toolbox because AFAIK it is not installed at uni and has never been mentioned in the course. Thanks for the suggestion, I will see how it goes.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
8
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K