フィルターのクリア

ASSISTANCE ON RUNNING RANDOM VARIABLES IN A FUNCTION

3 ビュー (過去 30 日間)
CLEMENT CHIBOKO
CLEMENT CHIBOKO 2020 年 8 月 12 日
コメント済み: hosein Javan 2020 年 8 月 13 日
I have a function "dydt=Q(Cin-y)-(Vs/H1)(1-Fd)CT-(K1/H1)(CD1-CD2)"
There are values that are constant (all but Q and Cin)
I want to start on that function but it is difficult since I'm not familiar with matlab if I can have a full written code I will be more than thankful
It is for learning purpose: video links will also be much appreciated

採用された回答

hosein Javan
hosein Javan 2020 年 8 月 12 日
編集済み: hosein Javan 2020 年 8 月 12 日
I assumed that "y" must not be a constant since you have dy/dt. therefore I made it an input for the function
% define your constans here:
Vs =
H1 =
Fd =
CT =
K1 =
H1 =
CD1 =
CD2 =
% function definition:
dydt = @(Q,Cin,y) Q.*(Cin-y)-(Vs/H1)*(1-Fd)*CT-(K1/H1)*(CD1-CD2)
if you want to call(calculate) the function for a specific set of inputs, simply use the syntax:
% define input arguments:
Q =
Cin =
y =
% call function
dydt(Q,Cin,y)
% notice that if you varaibles depend on time or any other varibles, they must be defined
% as functions too, like:
% Q = @(t) 1+t.^2
  2 件のコメント
CLEMENT CHIBOKO
CLEMENT CHIBOKO 2020 年 8 月 13 日
Thank You!
hosein Javan
hosein Javan 2020 年 8 月 13 日
you're welcome.

サインインしてコメントする。

その他の回答 (2 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2020 年 8 月 12 日
Hi,
Here is a nice tutorial that explains everything what you need for your exercise.

John D'Errico
John D'Errico 2020 年 8 月 12 日
編集済み: John D'Errico 2020 年 8 月 12 日
Note that a random variable is a well defined term in mathematics and statistics, though much of the time when I see someone use that phrase, it is merely a way of describing a variable where they do not know the value, or where their professor will decide to call their code with some unknown value.
So, is this just a question about how to solve an ordinary differential equation, or how to solve a stochastic differential equation, thus an SDE?

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by