help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Intergration help required


From: Martin Helm
Subject: Re: Intergration help required
Date: Tue, 24 Jul 2012 15:25:51 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0

Am 24.07.2012 14:49, schrieb Mahvish Nazir:
>
> I am looking for a numerical solution only, but the problem is, the
> values of my constants will keep on changing. Does that mean everytime
> the value of my constant changes i have to write a new program to
> compute its numerical value?

To give you the main idea:

You create a function with all the constants as parameters like

function y = my_integrand(t, k, t_ai, t_hi, omega_ai, omega_hi)
...
endfunction

when you call a integrator like quad with an anonymous function which
has the constants fixed for your special case like

val = quad (@(t) my_integrand(t, ...fixed values ...), -5, 5)

what you put after the t, as the fixed values depends on your program
that needs not to be hardcoded values it can be some variables read from
a file or interactively entered or whatever else.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]