I have a function beta defined as an integral. I want to define another function alpha "being the integral of that function".

9 vues (au cours des 30 derniers jours)
In particular I want to solve the differential equation d alpha(s)/ds = 1/2* beta(s)^2 and get the function alpha. Beta is defined as follows:
fun1=@(x) -exp((-c*x*b+a*exp(-b*x)-a)/b); beta=@(k) (exp(-(-c*k*b+a*exp(-b*k)-a)/b)*integral(fun1,0,k)); The problem is that I can't for example do something like alpha= @(x) integral(beta,0,x)

Réponses (1)

Torsten
Torsten le 12 Avr 2017
Modifié(e) : Torsten le 12 Avr 2017
Solve
d(alpha)/ds = 0.5*(exp(-(-c*s*b+a*exp(-b*s)-a)/b)*y)^2
dy/ds = -exp((-c*s*b+a*exp(-b*s)-a)/b)
alpha(0) = alpha0
y(0) = 0
using an ODE integrator.
Best wishes
Torsten.
  2 commentaires
giorgione palma
giorgione palma le 13 Avr 2017
thanks for your answer but I was more thinking about computing the integral rather than solve an ODE. I think there must be a way to compute the numeric integral such fun= @(t) int(f(s) * int(g(z), z == (0..s)), s == (0..t))
Torsten
Torsten le 13 Avr 2017
Computing an integral is the same as solving an ODE...
Best wishes
Torsten.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by