Solving differential equation that includes an (extra) unknown function












0














I am trying to find a solution for $C_a(t)$ in the below differential equation:



$$
V cdot frac {dC_a(t)} {dt}=R(t)-Q_v cdot C_a(t) \
$$

$
text{Where} \
qquad V text{ is the volume of the test chamber } [m^3] \
qquad C_a text{ is the concentration in test chamber } Big[frac{kg}{m^3} Big] \
qquad R text{ is the non-constant emission rate from test sample } Big[frac{kg}{m^2 cdot s} Big] \
qquad Q_v text{ is the constant volume flow rate of ventilation air passing through the test chamber } Big[frac{m^3}{s} Big] \
$

The non-constant emission rate is the "unknown function" mentioned in the question title. Stating that the function that governs emission rate is unknown is somewhat inaccurate as I have a vector containing values for emission for every examined time t.



Besides knowing values for $R$ at given times $t$, we know that $Ca(0) = 0$ and that $R(0) = 0$.



I am in the process of writing a small Matlab script, and therefore I am hoping to find a solution on a form that allows implementation and evaluation at given points in time (corresponding to the values in known vector $R$).



I have already given it my best, and I have arrived at the below expression (that I sincerely hope is correct). However, this expression considers $R(x)$ as a continuous function and will not be implemented easily.
$$
C_a(t) = exp(-Q_v t V^{-1}) int_{0}^{t}
exp(-Q_v x V^{-1}) R(x) V^{^-1} dx, quad for C_a(0)=0
$$

Can anybody help me find a simpler (explicit and fully analytical) solution for $C_a(t,R(t))$ that is easy to implement?










share|cite|improve this question






















  • If $R$ is only given at discrete times then you will probably need to write your own finite difference code, or else use some suitable interpolant of the data in the analytical solution.
    – Ian
    Nov 19 '18 at 1:16












  • By the way, in general when asking a question, it's best to strip down your problem as much as you possibly can without omitting information that is needed to answer the question. In this situation, your problem can be stripped down to $y'(t)=ay(t)+f(t)$ where $a$ is a constant and $f(t)$ is a function which is "really" continuous but is nevertheless only known only at discrete times.
    – Ian
    Nov 19 '18 at 1:17












  • Noted. And I do see your point. Thank you for your input.
    – Christopher
    Nov 19 '18 at 23:47
















0














I am trying to find a solution for $C_a(t)$ in the below differential equation:



$$
V cdot frac {dC_a(t)} {dt}=R(t)-Q_v cdot C_a(t) \
$$

$
text{Where} \
qquad V text{ is the volume of the test chamber } [m^3] \
qquad C_a text{ is the concentration in test chamber } Big[frac{kg}{m^3} Big] \
qquad R text{ is the non-constant emission rate from test sample } Big[frac{kg}{m^2 cdot s} Big] \
qquad Q_v text{ is the constant volume flow rate of ventilation air passing through the test chamber } Big[frac{m^3}{s} Big] \
$

The non-constant emission rate is the "unknown function" mentioned in the question title. Stating that the function that governs emission rate is unknown is somewhat inaccurate as I have a vector containing values for emission for every examined time t.



Besides knowing values for $R$ at given times $t$, we know that $Ca(0) = 0$ and that $R(0) = 0$.



I am in the process of writing a small Matlab script, and therefore I am hoping to find a solution on a form that allows implementation and evaluation at given points in time (corresponding to the values in known vector $R$).



I have already given it my best, and I have arrived at the below expression (that I sincerely hope is correct). However, this expression considers $R(x)$ as a continuous function and will not be implemented easily.
$$
C_a(t) = exp(-Q_v t V^{-1}) int_{0}^{t}
exp(-Q_v x V^{-1}) R(x) V^{^-1} dx, quad for C_a(0)=0
$$

Can anybody help me find a simpler (explicit and fully analytical) solution for $C_a(t,R(t))$ that is easy to implement?










share|cite|improve this question






















  • If $R$ is only given at discrete times then you will probably need to write your own finite difference code, or else use some suitable interpolant of the data in the analytical solution.
    – Ian
    Nov 19 '18 at 1:16












  • By the way, in general when asking a question, it's best to strip down your problem as much as you possibly can without omitting information that is needed to answer the question. In this situation, your problem can be stripped down to $y'(t)=ay(t)+f(t)$ where $a$ is a constant and $f(t)$ is a function which is "really" continuous but is nevertheless only known only at discrete times.
    – Ian
    Nov 19 '18 at 1:17












  • Noted. And I do see your point. Thank you for your input.
    – Christopher
    Nov 19 '18 at 23:47














0












0








0







I am trying to find a solution for $C_a(t)$ in the below differential equation:



$$
V cdot frac {dC_a(t)} {dt}=R(t)-Q_v cdot C_a(t) \
$$

$
text{Where} \
qquad V text{ is the volume of the test chamber } [m^3] \
qquad C_a text{ is the concentration in test chamber } Big[frac{kg}{m^3} Big] \
qquad R text{ is the non-constant emission rate from test sample } Big[frac{kg}{m^2 cdot s} Big] \
qquad Q_v text{ is the constant volume flow rate of ventilation air passing through the test chamber } Big[frac{m^3}{s} Big] \
$

The non-constant emission rate is the "unknown function" mentioned in the question title. Stating that the function that governs emission rate is unknown is somewhat inaccurate as I have a vector containing values for emission for every examined time t.



Besides knowing values for $R$ at given times $t$, we know that $Ca(0) = 0$ and that $R(0) = 0$.



I am in the process of writing a small Matlab script, and therefore I am hoping to find a solution on a form that allows implementation and evaluation at given points in time (corresponding to the values in known vector $R$).



I have already given it my best, and I have arrived at the below expression (that I sincerely hope is correct). However, this expression considers $R(x)$ as a continuous function and will not be implemented easily.
$$
C_a(t) = exp(-Q_v t V^{-1}) int_{0}^{t}
exp(-Q_v x V^{-1}) R(x) V^{^-1} dx, quad for C_a(0)=0
$$

Can anybody help me find a simpler (explicit and fully analytical) solution for $C_a(t,R(t))$ that is easy to implement?










share|cite|improve this question













I am trying to find a solution for $C_a(t)$ in the below differential equation:



$$
V cdot frac {dC_a(t)} {dt}=R(t)-Q_v cdot C_a(t) \
$$

$
text{Where} \
qquad V text{ is the volume of the test chamber } [m^3] \
qquad C_a text{ is the concentration in test chamber } Big[frac{kg}{m^3} Big] \
qquad R text{ is the non-constant emission rate from test sample } Big[frac{kg}{m^2 cdot s} Big] \
qquad Q_v text{ is the constant volume flow rate of ventilation air passing through the test chamber } Big[frac{m^3}{s} Big] \
$

The non-constant emission rate is the "unknown function" mentioned in the question title. Stating that the function that governs emission rate is unknown is somewhat inaccurate as I have a vector containing values for emission for every examined time t.



Besides knowing values for $R$ at given times $t$, we know that $Ca(0) = 0$ and that $R(0) = 0$.



I am in the process of writing a small Matlab script, and therefore I am hoping to find a solution on a form that allows implementation and evaluation at given points in time (corresponding to the values in known vector $R$).



I have already given it my best, and I have arrived at the below expression (that I sincerely hope is correct). However, this expression considers $R(x)$ as a continuous function and will not be implemented easily.
$$
C_a(t) = exp(-Q_v t V^{-1}) int_{0}^{t}
exp(-Q_v x V^{-1}) R(x) V^{^-1} dx, quad for C_a(0)=0
$$

Can anybody help me find a simpler (explicit and fully analytical) solution for $C_a(t,R(t))$ that is easy to implement?







differential-equations matlab






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Nov 19 '18 at 1:09









Christopher

11




11












  • If $R$ is only given at discrete times then you will probably need to write your own finite difference code, or else use some suitable interpolant of the data in the analytical solution.
    – Ian
    Nov 19 '18 at 1:16












  • By the way, in general when asking a question, it's best to strip down your problem as much as you possibly can without omitting information that is needed to answer the question. In this situation, your problem can be stripped down to $y'(t)=ay(t)+f(t)$ where $a$ is a constant and $f(t)$ is a function which is "really" continuous but is nevertheless only known only at discrete times.
    – Ian
    Nov 19 '18 at 1:17












  • Noted. And I do see your point. Thank you for your input.
    – Christopher
    Nov 19 '18 at 23:47


















  • If $R$ is only given at discrete times then you will probably need to write your own finite difference code, or else use some suitable interpolant of the data in the analytical solution.
    – Ian
    Nov 19 '18 at 1:16












  • By the way, in general when asking a question, it's best to strip down your problem as much as you possibly can without omitting information that is needed to answer the question. In this situation, your problem can be stripped down to $y'(t)=ay(t)+f(t)$ where $a$ is a constant and $f(t)$ is a function which is "really" continuous but is nevertheless only known only at discrete times.
    – Ian
    Nov 19 '18 at 1:17












  • Noted. And I do see your point. Thank you for your input.
    – Christopher
    Nov 19 '18 at 23:47
















If $R$ is only given at discrete times then you will probably need to write your own finite difference code, or else use some suitable interpolant of the data in the analytical solution.
– Ian
Nov 19 '18 at 1:16






If $R$ is only given at discrete times then you will probably need to write your own finite difference code, or else use some suitable interpolant of the data in the analytical solution.
– Ian
Nov 19 '18 at 1:16














By the way, in general when asking a question, it's best to strip down your problem as much as you possibly can without omitting information that is needed to answer the question. In this situation, your problem can be stripped down to $y'(t)=ay(t)+f(t)$ where $a$ is a constant and $f(t)$ is a function which is "really" continuous but is nevertheless only known only at discrete times.
– Ian
Nov 19 '18 at 1:17






By the way, in general when asking a question, it's best to strip down your problem as much as you possibly can without omitting information that is needed to answer the question. In this situation, your problem can be stripped down to $y'(t)=ay(t)+f(t)$ where $a$ is a constant and $f(t)$ is a function which is "really" continuous but is nevertheless only known only at discrete times.
– Ian
Nov 19 '18 at 1:17














Noted. And I do see your point. Thank you for your input.
– Christopher
Nov 19 '18 at 23:47




Noted. And I do see your point. Thank you for your input.
– Christopher
Nov 19 '18 at 23:47










2 Answers
2






active

oldest

votes


















0














The solution with initial value $C_a(0) = C_0$ is
$$C_a(t) = exp(-Q_v t/V) left( C_0 + int_0^t exp(Q_v s/V) frac{R(s)}{V}; ds right) $$
You can approximate the integral with Riemann sums.






share|cite|improve this answer





















  • Thank you, Robert, Riemann sums were a a good suggestion!
    – Christopher
    Nov 19 '18 at 23:41



















0














Turns out that Matlab does have a function that allows for solving ODEs with time dependent terms.



Thank you all very much for your time and help.






share|cite|improve this answer





















    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "69"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3004379%2fsolving-differential-equation-that-includes-an-extra-unknown-function%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    The solution with initial value $C_a(0) = C_0$ is
    $$C_a(t) = exp(-Q_v t/V) left( C_0 + int_0^t exp(Q_v s/V) frac{R(s)}{V}; ds right) $$
    You can approximate the integral with Riemann sums.






    share|cite|improve this answer





















    • Thank you, Robert, Riemann sums were a a good suggestion!
      – Christopher
      Nov 19 '18 at 23:41
















    0














    The solution with initial value $C_a(0) = C_0$ is
    $$C_a(t) = exp(-Q_v t/V) left( C_0 + int_0^t exp(Q_v s/V) frac{R(s)}{V}; ds right) $$
    You can approximate the integral with Riemann sums.






    share|cite|improve this answer





















    • Thank you, Robert, Riemann sums were a a good suggestion!
      – Christopher
      Nov 19 '18 at 23:41














    0












    0








    0






    The solution with initial value $C_a(0) = C_0$ is
    $$C_a(t) = exp(-Q_v t/V) left( C_0 + int_0^t exp(Q_v s/V) frac{R(s)}{V}; ds right) $$
    You can approximate the integral with Riemann sums.






    share|cite|improve this answer












    The solution with initial value $C_a(0) = C_0$ is
    $$C_a(t) = exp(-Q_v t/V) left( C_0 + int_0^t exp(Q_v s/V) frac{R(s)}{V}; ds right) $$
    You can approximate the integral with Riemann sums.







    share|cite|improve this answer












    share|cite|improve this answer



    share|cite|improve this answer










    answered Nov 19 '18 at 1:44









    Robert Israel

    318k23208457




    318k23208457












    • Thank you, Robert, Riemann sums were a a good suggestion!
      – Christopher
      Nov 19 '18 at 23:41


















    • Thank you, Robert, Riemann sums were a a good suggestion!
      – Christopher
      Nov 19 '18 at 23:41
















    Thank you, Robert, Riemann sums were a a good suggestion!
    – Christopher
    Nov 19 '18 at 23:41




    Thank you, Robert, Riemann sums were a a good suggestion!
    – Christopher
    Nov 19 '18 at 23:41











    0














    Turns out that Matlab does have a function that allows for solving ODEs with time dependent terms.



    Thank you all very much for your time and help.






    share|cite|improve this answer


























      0














      Turns out that Matlab does have a function that allows for solving ODEs with time dependent terms.



      Thank you all very much for your time and help.






      share|cite|improve this answer
























        0












        0








        0






        Turns out that Matlab does have a function that allows for solving ODEs with time dependent terms.



        Thank you all very much for your time and help.






        share|cite|improve this answer












        Turns out that Matlab does have a function that allows for solving ODEs with time dependent terms.



        Thank you all very much for your time and help.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Nov 19 '18 at 23:45









        Christopher

        11




        11






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3004379%2fsolving-differential-equation-that-includes-an-extra-unknown-function%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            'app-layout' is not a known element: how to share Component with different Modules

            android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

            WPF add header to Image with URL pettitions [duplicate]