Using quad

2 vues (au cours des 30 derniers jours)
Slo
Slo le 6 Déc 2011
A question is: there is function f(t,a,b) and g(t) where a, b are known variables. Find the area between the curves. I just want to know if I am doing it right, this was one of the old exam questions that could be again.
Is it
Area=quad(@f,a,b)-quad(@g,a,b)
or
fzero(@f(t)-@g(t))=c,d
Area=quad(@f,c,d)-quad(@g,c,d)
I am not getting this at all...
please can someone explain it to me but in a steps so I can understand it
Thank you

Réponse acceptée

Walter Roberson
Walter Roberson le 6 Déc 2011
None of the above.
f(t,a,b) where a and b are constants, is effectively a function in a single variable, t.
g(t) is already a function in a single variable, t.
In order to find the area between the curves, you would need to know the range of t that you were working over. That range is not given anywhere, and there is no reason to expect it to be related to "a" or "b".
The variables "c" and "d" do not appear in the problem definition, so the two answers that involve "c" and "d" must be presumed to be "noise" answers designed to distract.
The correct answer would involve
Area = quad(@(t) f(t,a,b), P, Q) - quad(@g, P, Q)
where P and Q are the unknown limits.
One cannot assume that the limits P and Q should be -inf and +inf, as quad() cannot be used with infinite limits. quadgk() can, though, be given infinite limits; if that is what one assumed then it would be
Area = quadgk(@(t) f(t,a,b) - g(t), -inf, inf)
But of course making an assumption on an exam is a Bad Thing.
  1 commentaire
Slo
Slo le 6 Déc 2011
Thank you so much sir. so I do not need to worry about a and b at all. I just need to find left and right limit which is P and Q using charts from the question and so on... Thanks again

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by