how to write initial condition v'(0)=0 in matlab

3 visualizzazioni (ultimi 30 giorni)
qudsia Bashir
qudsia Bashir il 30 Dic 2019
Risposto: Walter Roberson il 31 Dic 2019
i want to write the condition v'(-1)=0 in matlab but my code given below give error. Someone please help me.
code:condition=diff(v,y==-1,1)=0
  2 Commenti
darova
darova il 30 Dic 2019
Attach the entire problem/code
qudsia Bashir
qudsia Bashir il 31 Dic 2019
This is the code which i am using and its giving error when i try to write the condition v'(0)=0
clear all
syms v(y) m beta w(y) z(y) p gamma
p=-0.1;m=0.1;beta=2;
ode = diff(v,y,2) ==m^2*v;
cond1 = v(-1) == 0;
cond2 = diff(v,y==-1,1) == gamma;
conds = [cond1 cond2];
vSol(y)=dsolve(ode,conds)
v = vpa(vSol)
f = diff(w,y,2) ==m^2*w-6*beta*diff(v,y,1)^2*diff(v,y,2)+p;
condition1 = w(-1) == 0;
condition2 = diff(w,y==-1,1) == 0;
condition = [condition1 condition2];
wSol(y) = dsolve(f,condition);
w = vpa(wSol)
g = diff(z,y,2) ==m^2*z-6*beta*(2*diff(v,y,1)*diff(v,y,2)*diff(w,y,1)+diff(v,y,1)^2*diff(w,y,2));
condi1 = z(-1) == 0;
condi2 = diff(z,y==-1,1) == 0;
condi = [condi1 condi2];
zSol(y) = dsolve(g,condi);
z = vpa(zSol)
HPM=vpa(v+w+z)
y=-1:0.1:1
eval(HPM)
eval(z)

Accedi per commentare.

Risposte (1)

Walter Roberson
Walter Roberson il 31 Dic 2019
dw = diff(w,y);
condition2 = dw(-1) == 0;

Categorie

Scopri di più su Particle & Nuclear Physics 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