# How to solve for k in this model?

3 visualizzazioni (ultimi 30 giorni)
Zifeng Qiu il 5 Lug 2020
Risposto: Jyotsna Talluri il 8 Lug 2020
I have a question about how to solve for the variable k in this model. Where RK4 is a function that I wrote before.
u0 = 5000; % this is the code that i wrote for problem 2
lambda = 0.03;
pm = 9000;
eqn = lambda*p*(1-p/pm)-k == 500;
Kf = solve(eqn)
u0 = 5000; % this is the code for problem 1
lambda = 0.03;
pm = 9000;
k = 100;
f = @(t,p) lambda*p*(1-p/pm)-k;
[t,P] = RK4(f,u0,100,10)
Pf = P(end)
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
Jyotsna Talluri il 8 Lug 2020

Accedi per commentare.

### Risposte (1)

Jyotsna Talluri il 8 Lug 2020
First solve the diffrerential equation and obtain function P as function of t and k using dsolve
syms p(t) pm k lambda
lambda = 0.03;
pm = 9000;
eqn = diff(p,t) == lambda*p*(1-p/pm)-k
cond = p(0) == 5000;
P(t) = dsolve(eqn,cond);
Solve the equation P(100) = 500 (10% of 5000) for the value of k
k=solve(P(100) == 500,k)
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Equation Solving in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by