Solving Unknowns in MATLAB: Approximation Scheme

  • Context: MATLAB 
  • Thread starter Thread starter ballzac
  • Start date Start date
  • Tags Tags
    Matlab Unknowns
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 5K views
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.