mathematical model into matlab

how can i write the following mathematical model in MATLAB and get answer of (q) for any value of (t) that i want to put in
q(t)= (6.25* 10^9)/(t+500)^3

Answers (2)

KSSV
KSSV on 6 May 2020
Edited: KSSV on 6 May 2020
Method 1 Anonymous Function
q = @(t) (6.25* 10^9)/(t+500)^3 ;
q(1)
Method 2
t = 1 ;
q = (6.25* 10^9)/(t+500)^3 ;
If you have an array of t :
t = 0:0.01:10 ;
q = (6.25* 10^9)./(t+500).^3 ;
plot(t,q)

4 Comments

Note: the above are not vectorized
if i want to derrive an equation. how should i do.
that equation has derrivative and log
Read about diff. If you want it symbolic read about syms.

Sign in to comment.

Walter Roberson
Walter Roberson on 6 May 2020
Edited: Walter Roberson on 6 May 2020
q = @(t) (6.25* 10^9)./(t+500).^3
This will work for vectors or arrays of t.

5 Comments

how should i derrive an equation. it has differentaion and log
I recommend using the Symbolic Toolbox
i have mailed you what i actually want to get
Indeed you did email me, but I always assume that email is confidential unless the sender says otherwise. It would not be proper for me to respond in public to confidential information.
(dq/dt)_in=0 kg/min
(dq/dt)_out=15c kg/min
c= q/(2500+5t)
dq/dt= (dq/dt)_in - (dq/dt)_out
dq/dt=0-( q/(2500+5t))15
dq/dt= (-3dt)/(t+500)
Taking log on both sides,
lnq= -3 ln⁡(t+500) +k_1 (where k1 is integration constant)
ln⁡q= ln⁡(t+500) ^(-3)+k_1
q= e^(k_1 )/(t+500)^3
We have q(0) = 50
50= e^(k_1 )/(0+500)^3
e^(k_1 )=6.25* 10^9
q(t)= (6.25* 10^9)/(t+500)^3
how can i make this model in matlab

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Products

Asked:

on 6 May 2020

Commented:

on 6 May 2020

Community Treasure Hunt

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

Start Hunting!