Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'NSolve / Solve Problem with Integral' topicStudent Support Forum > General > "NSolve / Solve Problem with Integral"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Bill Simpson
06/03/13 2:51pm

In Response To 'Re: NSolve / Solve Problem with Integral'
---------
I am confused.

You originally wrote "I cannot solve for A" and I thought I showed you exactly how to solve for A.

Then you write "But that does not give me a(t), that only gives me t(a)."

I didn't think anything I wrote gave you t(a). It showed you how to successfully solve for A given t.

You write "If I only needet a(t)"

From a literal reading of your original question I thought solving for A given t was exactly and all that you wanted.

I then assumed you would understand how to use what I showed. Perhaps that is not the case. One more try to show you how to use what I posted yesterday.

In[1]:= kg = 1; m = 1; sek = 1; amp = 1;(*Dimensions*)
c = 299792458 m/sek (*Light Speed*);
Gyr = 10^9*365.25*24*3600*sek (*Billion Years*);
Glyr = Gyr*c (*Billion Lightyears*);
Mpc = 3.085677581*10^22 m (*Megaparsec*);
H0 = 67110 m/Mpc/sek; \[CapitalOmega]R = 4.165*^-5; \[CapitalOmega]M = 0.3175;
\[CapitalOmega]\[CapitalLambda] = 0.6825 - \[CapitalOmega]R; \[CapitalOmega]\[CurlyEpsilon] = 0.04; \[CapitalOmega]T = \[CapitalOmega]R + \[CapitalOmega]M + \[CapitalOmega]\[CapitalLambda]; \[CapitalOmega]K = 1 - \[CapitalOmega]T;

f[A_Real] := NIntegrate[1/(a Sqrt[\[CapitalOmega]R a^-4 + \[CapitalOmega]M a^-3 + \[CapitalOmega]K a^-2 + \[CapitalOmega]\[CapitalLambda]]), {a, 0, A}, Method -> {"GlobalAdaptive", "MaxErrorIncreases" -> 10000, Method -> "GaussKronrodRule"}, MaxRecursion -> 10000];

aOf[t_Real] := A /. FindRoot[f[A] - t, {A, .1}];

t = 0.03733; aOf[t]

Out[9]= 0.0999987

In[10]:= NIntegrate[aOf[t]^2, {t, .5, 1}]

Out[10]= 0.339778

In[11]:= t = .5;Sin[aOf[t]]

Out[12]= 0.554296

So that is only what I showed yesterday with a few examples of how to use it.

If I still don't understand your question then I apologize and perhaps you could start over with a much more precise question which someone who doesn't know anything about what you have been working on for days or weeks and doesn't know anything about what is already in your head will be able to understand and use to provide you with exactly the answer you want on the first try. Including the specific list of calculations that you actually need to do would be very helpful. Not showing exactly what you will actually need to do is much more likely to result in an answer that isn't what you actually want or need.

Perhaps the moderators could write up a very good explanation of how to ask most questions so that it is likely to get the correct answer on the first try. There seem to be some things that come up again and again that such an explanation would help overcome. Making that explanation really easy to find seems like it would be very helpful.

URL: ,

Subject (listing for 'NSolve / Solve Problem with Integral')
Author Date Posted
NSolve / Solve Problem with Integral Yukterez 06/01/13 6:57pm
Re: NSolve / Solve Problem with Integral B 06/02/13 1:28pm
Re: NSolve / Solve Problem with Integral Yukterez 06/03/13 02:44am
Re: Re: NSolve / Solve Problem with Integral Bill Simpson 06/03/13 2:51pm
Re: Re: Re: NSolve / Solve Problem with Integral Yukterez 06/04/13 8:55pm
Thanks Problem solved Yukterez 06/04/13 10:34pm
Re: NSolve / Solve Problem with Integral Yukterez 06/04/13 9:45pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic