필터 지우기
필터 지우기

Substatuting numbers in dsolve

조회 수: 1 (최근 30일)
Jerry Walker
Jerry Walker 2011년 8월 22일
The following is a program to solve a second order differential equation using dsolve. I would like to be able to vary the parameters of the RLC circuit that the programs solves. How do I get this program to run?
clc clear all close syms R1 R2 C L Vc0 iL0 R1 = 10; R2 = 8; C = 1/8; L = 2; Vc0 = 1; iL0 = 0.5;
V = dsolve('D2x + (1/L*C)*(L/R2+R1*C)*Dx + (1/L*C)*((R1+R2)/R2)*x = 0','Dx(0) = iL0/C-Vc0/(C*R2)','x(0) = 1') Vf = subs(I,{R1,R2,C,L,Vc0,iL0},{10,8,1/8,2,1,0.5})
  댓글 수: 1
Andrei Bobrov
Andrei Bobrov 2011년 8월 22일
syms R1 R2 C L Vc0 iL0
V = dsolve('D2x + (1/L*C)*(L/R2+R1*C)*Dx + (1/L*C)*((R1+R2)/R2)*x = 0','Dx(0) = iL0/C-Vc0/(C*R2)','x(0) = 1')
subs(V,{R1,R2,C,L,Vc0,iL0},{10,8,1/8,2,1,0.5})

댓글을 달려면 로그인하십시오.

답변 (1개)

Andrei Bobrov
Andrei Bobrov 2011년 8월 22일
variant
syms R1 R2 C L Vc0 iL0
V = dsolve('D2x + (1/L*C)*(L/R2+R1*C)*Dx + (1/L*C)*((R1+R2)/R2)*x = 0','Dx(0) = iL0/C-Vc0/(C*R2)','x(0) = 1')
1.
Vw = vpa(subs(V,{R1,R2,C,L,Vc0,iL0},{10,8,1/8,2,1,0.5}),5);
2.
G = matlabFunction(V);
Vw = G(10,8,1/8,2,1,0.5,sym('t'))

카테고리

Help CenterFile Exchange에서 Formula Manipulation and Simplification에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by