Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Unknowns in MATLAB?

  1. Apr 2, 2009 #1
    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.
  2. jcsd
  3. Apr 2, 2009 #2


    User Avatar
    Science Advisor

    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?
    Last edited by a moderator: Apr 24, 2017
  4. Apr 2, 2009 #3
    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.
  5. Apr 2, 2009 #4
    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...

  6. Apr 3, 2009 #5
    I don't think I really do either :uhh: :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.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook